@wordpress/editor 14.30.1-next.836ecdcae.0 → 14.31.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.
Files changed (95) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/bindings/api.js +2 -0
  3. package/build/bindings/api.js.map +1 -1
  4. package/build/bindings/term-data.js +171 -0
  5. package/build/bindings/term-data.js.map +1 -0
  6. package/build/components/collab-sidebar/add-comment.js +6 -3
  7. package/build/components/collab-sidebar/add-comment.js.map +1 -1
  8. package/build/components/collab-sidebar/comment-author-info.js +3 -3
  9. package/build/components/collab-sidebar/comment-author-info.js.map +1 -1
  10. package/build/components/collab-sidebar/comment-form.js +24 -8
  11. package/build/components/collab-sidebar/comment-form.js.map +1 -1
  12. package/build/components/collab-sidebar/comment-indicator-toolbar.js +112 -0
  13. package/build/components/collab-sidebar/comment-indicator-toolbar.js.map +1 -0
  14. package/build/components/collab-sidebar/comments.js +47 -58
  15. package/build/components/collab-sidebar/comments.js.map +1 -1
  16. package/build/components/collab-sidebar/index.js +120 -96
  17. package/build/components/collab-sidebar/index.js.map +1 -1
  18. package/build/components/post-excerpt/panel.js +5 -2
  19. package/build/components/post-excerpt/panel.js.map +1 -1
  20. package/build/components/post-taxonomies/hierarchical-term-selector.js +21 -9
  21. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  22. package/build/components/post-template/hooks.js +20 -5
  23. package/build/components/post-template/hooks.js.map +1 -1
  24. package/build/components/provider/index.js +1 -1
  25. package/build/components/provider/index.js.map +1 -1
  26. package/build/dataviews/store/private-actions.js +1 -1
  27. package/build/dataviews/store/private-actions.js.map +1 -1
  28. package/build-module/bindings/api.js +2 -0
  29. package/build-module/bindings/api.js.map +1 -1
  30. package/build-module/bindings/term-data.js +165 -0
  31. package/build-module/bindings/term-data.js.map +1 -0
  32. package/build-module/components/collab-sidebar/add-comment.js +6 -3
  33. package/build-module/components/collab-sidebar/add-comment.js.map +1 -1
  34. package/build-module/components/collab-sidebar/comment-author-info.js +4 -4
  35. package/build-module/components/collab-sidebar/comment-author-info.js.map +1 -1
  36. package/build-module/components/collab-sidebar/comment-form.js +24 -9
  37. package/build-module/components/collab-sidebar/comment-form.js.map +1 -1
  38. package/build-module/components/collab-sidebar/comment-indicator-toolbar.js +104 -0
  39. package/build-module/components/collab-sidebar/comment-indicator-toolbar.js.map +1 -0
  40. package/build-module/components/collab-sidebar/comments.js +50 -61
  41. package/build-module/components/collab-sidebar/comments.js.map +1 -1
  42. package/build-module/components/collab-sidebar/index.js +121 -97
  43. package/build-module/components/collab-sidebar/index.js.map +1 -1
  44. package/build-module/components/post-excerpt/panel.js +5 -2
  45. package/build-module/components/post-excerpt/panel.js.map +1 -1
  46. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +21 -11
  47. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  48. package/build-module/components/post-template/hooks.js +20 -5
  49. package/build-module/components/post-template/hooks.js.map +1 -1
  50. package/build-module/components/provider/index.js +1 -1
  51. package/build-module/components/provider/index.js.map +1 -1
  52. package/build-module/dataviews/store/private-actions.js +1 -1
  53. package/build-module/dataviews/store/private-actions.js.map +1 -1
  54. package/build-style/style-rtl.css +71 -15
  55. package/build-style/style.css +71 -15
  56. package/build-types/bindings/api.d.ts.map +1 -1
  57. package/build-types/bindings/term-data.d.ts +25 -0
  58. package/build-types/bindings/term-data.d.ts.map +1 -0
  59. package/build-types/components/collab-sidebar/add-comment.d.ts.map +1 -1
  60. package/build-types/components/collab-sidebar/comment-author-info.d.ts.map +1 -1
  61. package/build-types/components/collab-sidebar/comment-form.d.ts +5 -1
  62. package/build-types/components/collab-sidebar/comment-form.d.ts.map +1 -1
  63. package/build-types/components/collab-sidebar/comment-indicator-toolbar.d.ts +7 -0
  64. package/build-types/components/collab-sidebar/comment-indicator-toolbar.d.ts.map +1 -0
  65. package/build-types/components/collab-sidebar/comments.d.ts +3 -1
  66. package/build-types/components/collab-sidebar/comments.d.ts.map +1 -1
  67. package/build-types/components/collab-sidebar/index.d.ts.map +1 -1
  68. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts +10 -1
  69. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -1
  70. package/build-types/components/post-template/hooks.d.ts +1 -1
  71. package/build-types/components/post-template/hooks.d.ts.map +1 -1
  72. package/build-types/components/provider/index.d.ts.map +1 -1
  73. package/package.json +37 -37
  74. package/src/bindings/api.js +2 -0
  75. package/src/bindings/term-data.js +159 -0
  76. package/src/components/collab-sidebar/add-comment.js +20 -9
  77. package/src/components/collab-sidebar/comment-author-info.js +14 -4
  78. package/src/components/collab-sidebar/comment-form.js +32 -10
  79. package/src/components/collab-sidebar/comment-indicator-toolbar.js +124 -0
  80. package/src/components/collab-sidebar/comments.js +104 -106
  81. package/src/components/collab-sidebar/index.js +157 -122
  82. package/src/components/collab-sidebar/style.scss +82 -17
  83. package/src/components/post-excerpt/panel.js +6 -1
  84. package/src/components/post-taxonomies/hierarchical-term-selector.js +25 -8
  85. package/src/components/post-template/hooks.js +23 -7
  86. package/src/components/provider/index.js +4 -1
  87. package/src/dataviews/store/private-actions.ts +1 -1
  88. package/tsconfig.tsbuildinfo +1 -1
  89. package/build/components/collab-sidebar/comment-button-toolbar.js +0 -37
  90. package/build/components/collab-sidebar/comment-button-toolbar.js.map +0 -1
  91. package/build-module/components/collab-sidebar/comment-button-toolbar.js +0 -30
  92. package/build-module/components/collab-sidebar/comment-button-toolbar.js.map +0 -1
  93. package/build-types/components/collab-sidebar/comment-button-toolbar.d.ts +0 -5
  94. package/build-types/components/collab-sidebar/comment-button-toolbar.d.ts.map +0 -1
  95. package/src/components/collab-sidebar/comment-button-toolbar.js +0 -29
package/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 14.31.0 (2025-09-17)
6
+
5
7
  ## 14.30.0 (2025-09-03)
6
8
 
7
9
  ## 14.29.0 (2025-08-20)
@@ -9,6 +9,7 @@ var _blocks = require("@wordpress/blocks");
9
9
  var _patternOverrides = _interopRequireDefault(require("./pattern-overrides"));
10
10
  var _postData = _interopRequireDefault(require("./post-data"));
11
11
  var _postMeta = _interopRequireDefault(require("./post-meta"));
12
+ var _termData = _interopRequireDefault(require("./term-data"));
12
13
  /**
13
14
  * WordPress dependencies
14
15
  */
@@ -31,5 +32,6 @@ function registerCoreBlockBindingsSources() {
31
32
  (0, _blocks.registerBlockBindingsSource)(_patternOverrides.default);
32
33
  (0, _blocks.registerBlockBindingsSource)(_postData.default);
33
34
  (0, _blocks.registerBlockBindingsSource)(_postMeta.default);
35
+ (0, _blocks.registerBlockBindingsSource)(_termData.default);
34
36
  }
35
37
  //# sourceMappingURL=api.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_blocks","require","_patternOverrides","_interopRequireDefault","_postData","_postMeta","registerCoreBlockBindingsSources","registerBlockBindingsSource","patternOverrides","postData","postMeta"],"sources":["@wordpress/editor/src/bindings/api.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { registerBlockBindingsSource } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport patternOverrides from './pattern-overrides';\nimport postData from './post-data';\nimport postMeta from './post-meta';\n\n/**\n * Function to register core block bindings sources provided by the editor.\n *\n * @example\n * ```js\n * import { registerCoreBlockBindingsSources } from '@wordpress/editor';\n *\n * registerCoreBlockBindingsSources();\n * ```\n */\nexport function registerCoreBlockBindingsSources() {\n\tregisterBlockBindingsSource( patternOverrides );\n\tregisterBlockBindingsSource( postData );\n\tregisterBlockBindingsSource( postMeta );\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAKA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,SAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,SAAA,GAAAF,sBAAA,CAAAF,OAAA;AAVA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASK,gCAAgCA,CAAA,EAAG;EAClD,IAAAC,mCAA2B,EAAEC,yBAAiB,CAAC;EAC/C,IAAAD,mCAA2B,EAAEE,iBAAS,CAAC;EACvC,IAAAF,mCAA2B,EAAEG,iBAAS,CAAC;AACxC","ignoreList":[]}
1
+ {"version":3,"names":["_blocks","require","_patternOverrides","_interopRequireDefault","_postData","_postMeta","_termData","registerCoreBlockBindingsSources","registerBlockBindingsSource","patternOverrides","postData","postMeta","termData"],"sources":["@wordpress/editor/src/bindings/api.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { registerBlockBindingsSource } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport patternOverrides from './pattern-overrides';\nimport postData from './post-data';\nimport postMeta from './post-meta';\nimport termData from './term-data';\n\n/**\n * Function to register core block bindings sources provided by the editor.\n *\n * @example\n * ```js\n * import { registerCoreBlockBindingsSources } from '@wordpress/editor';\n *\n * registerCoreBlockBindingsSources();\n * ```\n */\nexport function registerCoreBlockBindingsSources() {\n\tregisterBlockBindingsSource( patternOverrides );\n\tregisterBlockBindingsSource( postData );\n\tregisterBlockBindingsSource( postMeta );\n\tregisterBlockBindingsSource( termData );\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAKA,IAAAC,iBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,SAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,SAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,SAAA,GAAAH,sBAAA,CAAAF,OAAA;AAXA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASM,gCAAgCA,CAAA,EAAG;EAClD,IAAAC,mCAA2B,EAAEC,yBAAiB,CAAC;EAC/C,IAAAD,mCAA2B,EAAEE,iBAAS,CAAC;EACvC,IAAAF,mCAA2B,EAAEG,iBAAS,CAAC;EACvC,IAAAH,mCAA2B,EAAEI,iBAAS,CAAC;AACxC","ignoreList":[]}
@@ -0,0 +1,171 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _i18n = require("@wordpress/i18n");
8
+ var _coreData = require("@wordpress/core-data");
9
+ /**
10
+ * WordPress dependencies
11
+ */
12
+
13
+ /**
14
+ * Creates the data fields object with the given term data values and ID value.
15
+ *
16
+ * @param {Object} termDataValues The term data values.
17
+ * @param {string|number} idValue The ID value to use.
18
+ * @return {Object} The data fields object.
19
+ */
20
+ function createDataFields(termDataValues, idValue) {
21
+ var _termDataValues$count;
22
+ return {
23
+ id: {
24
+ label: (0, _i18n.__)('Term ID'),
25
+ value: idValue,
26
+ type: 'string'
27
+ },
28
+ name: {
29
+ label: (0, _i18n.__)('Name'),
30
+ value: termDataValues?.name,
31
+ type: 'string'
32
+ },
33
+ slug: {
34
+ label: (0, _i18n.__)('Slug'),
35
+ value: termDataValues?.slug,
36
+ type: 'string'
37
+ },
38
+ link: {
39
+ label: (0, _i18n.__)('Link'),
40
+ value: termDataValues?.link,
41
+ type: 'string'
42
+ },
43
+ description: {
44
+ label: (0, _i18n.__)('Description'),
45
+ value: termDataValues?.description,
46
+ type: 'string'
47
+ },
48
+ parent: {
49
+ label: (0, _i18n.__)('Parent ID'),
50
+ value: termDataValues?.parent,
51
+ type: 'string'
52
+ },
53
+ count: {
54
+ label: (0, _i18n.__)('Count'),
55
+ value: `(${(_termDataValues$count = termDataValues?.count) !== null && _termDataValues$count !== void 0 ? _termDataValues$count : 0})`,
56
+ type: 'string'
57
+ }
58
+ };
59
+ }
60
+
61
+ /**
62
+ * Gets a list of term data fields with their values and labels
63
+ * to be consumed in the needed callbacks.
64
+ * If the value is not available based on context, like in templates,
65
+ * it falls back to the default value, label, or key.
66
+ *
67
+ * @param {Object} select The select function from the data store.
68
+ * @param {Object} context The context provided.
69
+ * @return {Object} List of term data fields with their value and label.
70
+ *
71
+ * @example
72
+ * ```js
73
+ * {
74
+ * name: {
75
+ * label: 'Term Name',
76
+ * value: 'Category Name',
77
+ * },
78
+ * count: {
79
+ * label: 'Term Count',
80
+ * value: 5,
81
+ * },
82
+ * ...
83
+ * }
84
+ * ```
85
+ */
86
+ function getTermDataFields(select, context) {
87
+ const {
88
+ getEntityRecord
89
+ } = select(_coreData.store);
90
+ let termDataValues, dataFields;
91
+ if (context?.taxonomy && context?.termId) {
92
+ termDataValues = getEntityRecord('taxonomy', context?.taxonomy, context?.termId);
93
+ if (!termDataValues && context?.termData) {
94
+ termDataValues = context.termData;
95
+ }
96
+ if (termDataValues) {
97
+ dataFields = createDataFields(termDataValues, context?.termId);
98
+ }
99
+ } else if (context?.termData) {
100
+ termDataValues = context.termData;
101
+ dataFields = createDataFields(termDataValues, termDataValues?.term_id);
102
+ }
103
+ if (!dataFields || !Object.keys(dataFields).length) {
104
+ return null;
105
+ }
106
+ return dataFields;
107
+ }
108
+
109
+ /**
110
+ * @type {WPBlockBindingsSource}
111
+ */
112
+ var _default = exports.default = {
113
+ name: 'core/term-data',
114
+ usesContext: ['taxonomy', 'termId', 'termData'],
115
+ getValues({
116
+ select,
117
+ context,
118
+ bindings
119
+ }) {
120
+ const dataFields = getTermDataFields(select, context);
121
+ const newValues = {};
122
+ for (const [attributeName, source] of Object.entries(bindings)) {
123
+ var _ref;
124
+ // Use the value, the field label, or the field key.
125
+ const fieldKey = source.args.key;
126
+ const {
127
+ value: fieldValue,
128
+ label: fieldLabel
129
+ } = dataFields?.[fieldKey] || {};
130
+ newValues[attributeName] = (_ref = fieldValue !== null && fieldValue !== void 0 ? fieldValue : fieldLabel) !== null && _ref !== void 0 ? _ref : fieldKey;
131
+ }
132
+ return newValues;
133
+ },
134
+ // eslint-disable-next-line no-unused-vars
135
+ setValues({
136
+ dispatch,
137
+ context,
138
+ bindings
139
+ }) {
140
+ // Terms are typically not editable through block bindings in most contexts.
141
+ return false;
142
+ },
143
+ canUserEditValue({
144
+ select,
145
+ context,
146
+ args
147
+ }) {
148
+ // Terms are typically read-only when displayed.
149
+ if (context?.termQuery || context?.termQueryId) {
150
+ return false;
151
+ }
152
+
153
+ // Lock editing when `taxonomy` or `termId` is not defined.
154
+ if (!context?.taxonomy || !context?.termId) {
155
+ return false;
156
+ }
157
+ const fieldValue = getTermDataFields(select, context)?.[args.key]?.value;
158
+ // Empty string or `false` could be a valid value, so we need to check if the field value is undefined.
159
+ if (fieldValue === undefined) {
160
+ return false;
161
+ }
162
+ return false;
163
+ },
164
+ getFieldsList({
165
+ select,
166
+ context
167
+ }) {
168
+ return getTermDataFields(select, context);
169
+ }
170
+ };
171
+ //# sourceMappingURL=term-data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_i18n","require","_coreData","createDataFields","termDataValues","idValue","_termDataValues$count","id","label","__","value","type","name","slug","link","description","parent","count","getTermDataFields","select","context","getEntityRecord","coreDataStore","dataFields","taxonomy","termId","termData","term_id","Object","keys","length","_default","exports","default","usesContext","getValues","bindings","newValues","attributeName","source","entries","_ref","fieldKey","args","key","fieldValue","fieldLabel","setValues","dispatch","canUserEditValue","termQuery","termQueryId","undefined","getFieldsList"],"sources":["@wordpress/editor/src/bindings/term-data.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { store as coreDataStore } from '@wordpress/core-data';\n\n/**\n * Creates the data fields object with the given term data values and ID value.\n *\n * @param {Object} termDataValues The term data values.\n * @param {string|number} idValue The ID value to use.\n * @return {Object} The data fields object.\n */\nfunction createDataFields( termDataValues, idValue ) {\n\treturn {\n\t\tid: {\n\t\t\tlabel: __( 'Term ID' ),\n\t\t\tvalue: idValue,\n\t\t\ttype: 'string',\n\t\t},\n\t\tname: {\n\t\t\tlabel: __( 'Name' ),\n\t\t\tvalue: termDataValues?.name,\n\t\t\ttype: 'string',\n\t\t},\n\t\tslug: {\n\t\t\tlabel: __( 'Slug' ),\n\t\t\tvalue: termDataValues?.slug,\n\t\t\ttype: 'string',\n\t\t},\n\t\tlink: {\n\t\t\tlabel: __( 'Link' ),\n\t\t\tvalue: termDataValues?.link,\n\t\t\ttype: 'string',\n\t\t},\n\t\tdescription: {\n\t\t\tlabel: __( 'Description' ),\n\t\t\tvalue: termDataValues?.description,\n\t\t\ttype: 'string',\n\t\t},\n\t\tparent: {\n\t\t\tlabel: __( 'Parent ID' ),\n\t\t\tvalue: termDataValues?.parent,\n\t\t\ttype: 'string',\n\t\t},\n\t\tcount: {\n\t\t\tlabel: __( 'Count' ),\n\t\t\tvalue: `(${ termDataValues?.count ?? 0 })`,\n\t\t\ttype: 'string',\n\t\t},\n\t};\n}\n\n/**\n * Gets a list of term data 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 term data fields with their value and label.\n *\n * @example\n * ```js\n * {\n * name: {\n * label: 'Term Name',\n * value: 'Category Name',\n * },\n * count: {\n * label: 'Term Count',\n * value: 5,\n * },\n * ...\n * }\n * ```\n */\nfunction getTermDataFields( select, context ) {\n\tconst { getEntityRecord } = select( coreDataStore );\n\n\tlet termDataValues, dataFields;\n\tif ( context?.taxonomy && context?.termId ) {\n\t\ttermDataValues = getEntityRecord(\n\t\t\t'taxonomy',\n\t\t\tcontext?.taxonomy,\n\t\t\tcontext?.termId\n\t\t);\n\n\t\tif ( ! termDataValues && context?.termData ) {\n\t\t\ttermDataValues = context.termData;\n\t\t}\n\n\t\tif ( termDataValues ) {\n\t\t\tdataFields = createDataFields( termDataValues, context?.termId );\n\t\t}\n\t} else if ( context?.termData ) {\n\t\ttermDataValues = context.termData;\n\t\tdataFields = createDataFields(\n\t\t\ttermDataValues,\n\t\t\ttermDataValues?.term_id\n\t\t);\n\t}\n\n\tif ( ! dataFields || ! Object.keys( dataFields ).length ) {\n\t\treturn null;\n\t}\n\n\treturn dataFields;\n}\n\n/**\n * @type {WPBlockBindingsSource}\n */\nexport default {\n\tname: 'core/term-data',\n\tusesContext: [ 'taxonomy', 'termId', 'termData' ],\n\tgetValues( { select, context, bindings } ) {\n\t\tconst dataFields = getTermDataFields( select, context );\n\n\t\tconst newValues = {};\n\t\tfor ( const [ attributeName, source ] of Object.entries( bindings ) ) {\n\t\t\t// Use the value, the field label, or the field key.\n\t\t\tconst fieldKey = source.args.key;\n\t\t\tconst { value: fieldValue, label: fieldLabel } =\n\t\t\t\tdataFields?.[ fieldKey ] || {};\n\t\t\tnewValues[ attributeName ] = fieldValue ?? fieldLabel ?? fieldKey;\n\t\t}\n\t\treturn newValues;\n\t},\n\t// eslint-disable-next-line no-unused-vars\n\tsetValues( { dispatch, context, bindings } ) {\n\t\t// Terms are typically not editable through block bindings in most contexts.\n\t\treturn false;\n\t},\n\tcanUserEditValue( { select, context, args } ) {\n\t\t// Terms are typically read-only when displayed.\n\t\tif ( context?.termQuery || context?.termQueryId ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Lock editing when `taxonomy` or `termId` is not defined.\n\t\tif ( ! context?.taxonomy || ! context?.termId ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst fieldValue = getTermDataFields( select, context )?.[ args.key ]\n\t\t\t?.value;\n\t\t// Empty string or `false` could be a valid value, so we need to check if the field value is undefined.\n\t\tif ( fieldValue === undefined ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn false;\n\t},\n\tgetFieldsList( { select, context } ) {\n\t\treturn getTermDataFields( select, context );\n\t},\n};\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASE,gBAAgBA,CAAEC,cAAc,EAAEC,OAAO,EAAG;EAAA,IAAAC,qBAAA;EACpD,OAAO;IACNC,EAAE,EAAE;MACHC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;MACrE;MACA,MAAMC,QAAQ,GAAGH,MAAM,CAACI,IAAI,CAACC,GAAG;MAChC,MAAM;QAAElC,KAAK,EAAEmC,UAAU;QAAErC,KAAK,EAAEsC;MAAW,CAAC,GAC7CvB,UAAU,GAAImB,QAAQ,CAAE,IAAI,CAAC,CAAC;MAC/BL,SAAS,CAAEC,aAAa,CAAE,IAAAG,IAAA,GAAGI,UAAU,aAAVA,UAAU,cAAVA,UAAU,GAAIC,UAAU,cAAAL,IAAA,cAAAA,IAAA,GAAIC,QAAQ;IAClE;IACA,OAAOL,SAAS;EACjB,CAAC;EACD;EACAU,SAASA,CAAE;IAAEC,QAAQ;IAAE5B,OAAO;IAAEgB;EAAS,CAAC,EAAG;IAC5C;IACA,OAAO,KAAK;EACb,CAAC;EACDa,gBAAgBA,CAAE;IAAE9B,MAAM;IAAEC,OAAO;IAAEuB;EAAK,CAAC,EAAG;IAC7C;IACA,IAAKvB,OAAO,EAAE8B,SAAS,IAAI9B,OAAO,EAAE+B,WAAW,EAAG;MACjD,OAAO,KAAK;IACb;;IAEA;IACA,IAAK,CAAE/B,OAAO,EAAEI,QAAQ,IAAI,CAAEJ,OAAO,EAAEK,MAAM,EAAG;MAC/C,OAAO,KAAK;IACb;IAEA,MAAMoB,UAAU,GAAG3B,iBAAiB,CAAEC,MAAM,EAAEC,OAAQ,CAAC,GAAIuB,IAAI,CAACC,GAAG,CAAE,EAClElC,KAAK;IACR;IACA,IAAKmC,UAAU,KAAKO,SAAS,EAAG;MAC/B,OAAO,KAAK;IACb;IAEA,OAAO,KAAK;EACb,CAAC;EACDC,aAAaA,CAAE;IAAElC,MAAM;IAAEC;EAAQ,CAAC,EAAG;IACpC,OAAOF,iBAAiB,CAAEC,MAAM,EAAEC,OAAQ,CAAC;EAC5C;AACD,CAAC","ignoreList":[]}
@@ -9,6 +9,7 @@ var _i18n = require("@wordpress/i18n");
9
9
  var _data = require("@wordpress/data");
10
10
  var _components = require("@wordpress/components");
11
11
  var _blockEditor = require("@wordpress/block-editor");
12
+ var _blocks = require("@wordpress/blocks");
12
13
  var _commentAuthorInfo = _interopRequireDefault(require("./comment-author-info"));
13
14
  var _commentForm = _interopRequireDefault(require("./comment-form"));
14
15
  var _jsxRuntime = require("react/jsx-runtime");
@@ -36,7 +37,8 @@ function AddComment({
36
37
  }) {
37
38
  const {
38
39
  clientId,
39
- blockCommentId
40
+ blockCommentId,
41
+ isEmptyDefaultBlock
40
42
  } = (0, _data.useSelect)(select => {
41
43
  const {
42
44
  getSelectedBlock
@@ -44,10 +46,11 @@ function AddComment({
44
46
  const selectedBlock = getSelectedBlock();
45
47
  return {
46
48
  clientId: selectedBlock?.clientId,
47
- blockCommentId: selectedBlock?.attributes?.blockCommentId
49
+ blockCommentId: selectedBlock?.attributes?.blockCommentId,
50
+ isEmptyDefaultBlock: selectedBlock ? (0, _blocks.isUnmodifiedDefaultBlock)(selectedBlock) : false
48
51
  };
49
52
  });
50
- if (!showCommentBoard || !clientId || undefined !== blockCommentId) {
53
+ if (!showCommentBoard || !clientId || undefined !== blockCommentId || isEmptyDefaultBlock) {
51
54
  return null;
52
55
  }
53
56
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalVStack, {
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_data","_components","_blockEditor","_commentAuthorInfo","_interopRequireDefault","_commentForm","_jsxRuntime","AddComment","onSubmit","showCommentBoard","setShowCommentBoard","clientId","blockCommentId","useSelect","select","getSelectedBlock","blockEditorStore","selectedBlock","attributes","undefined","jsxs","__experimentalVStack","spacing","className","children","jsx","__experimentalHStack","alignment","default","inputComment","onCancel","submitButtonText","_x"],"sources":["@wordpress/editor/src/components/collab-sidebar/add-comment.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { _x } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport CommentAuthorInfo from './comment-author-info';\nimport CommentForm from './comment-form';\n\n/**\n * Renders the UI for adding a comment in the Gutenberg editor's collaboration sidebar.\n *\n * @param {Object} props - The component props.\n * @param {Function} props.onSubmit - A callback function to be called when the user submits a comment.\n * @param {boolean} props.showCommentBoard - The function to edit the comment.\n * @param {Function} props.setShowCommentBoard - The function to delete the comment.\n * @return {React.ReactNode} The rendered comment input UI.\n */\nexport function AddComment( {\n\tonSubmit,\n\tshowCommentBoard,\n\tsetShowCommentBoard,\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?.blockCommentId,\n\t\t};\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\tspacing=\"3\"\n\t\t\tclassName=\"editor-collab-sidebar-panel__thread editor-collab-sidebar-panel__active-thread editor-collab-sidebar-panel__focus-thread\"\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={ ( inputComment ) => {\n\t\t\t\t\tonSubmit( inputComment );\n\t\t\t\t} }\n\t\t\t\tonCancel={ () => {\n\t\t\t\t\tsetShowCommentBoard( false );\n\t\t\t\t} }\n\t\t\t\tsubmitButtonText={ _x( 'Comment', 'Add comment button' ) }\n\t\t\t/>\n\t\t</VStack>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAIA,IAAAG,YAAA,GAAAH,OAAA;AAKA,IAAAI,kB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ChBpB,mBAAmB,CAAE,KAAM,CAAC;MAC7B,CAAG;MACHqB,gBAAgB,EAAG,IAAAC,QAAE,EAAE,SAAS,EAAE,oBAAqB;IAAG,CAC1D,CAAC;EAAA,CACK,CAAC;AAEX","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_data","_components","_blockEditor","_blocks","_commentAuthorInfo","_interopRequireDefault","_commentForm","_jsxRuntime","AddComment","onSubmit","showCommentBoard","setShowCommentBoard","clientId","blockCommentId","isEmptyDefaultBlock","useSelect","select","getSelectedBlock","blockEditorStore","selectedBlock","attributes","isUnmodifiedDefaultBlock","undefined","jsxs","__experimentalVStack","spacing","className","children","jsx","__experimentalHStack","alignment","default","inputComment","onCancel","submitButtonText","_x"],"sources":["@wordpress/editor/src/components/collab-sidebar/add-comment.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { _x } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { isUnmodifiedDefaultBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport CommentAuthorInfo from './comment-author-info';\nimport CommentForm from './comment-form';\n\n/**\n * Renders the UI for adding a comment in the Gutenberg editor's collaboration sidebar.\n *\n * @param {Object} props - The component props.\n * @param {Function} props.onSubmit - A callback function to be called when the user submits a comment.\n * @param {boolean} props.showCommentBoard - The function to edit the comment.\n * @param {Function} props.setShowCommentBoard - The function to delete the comment.\n * @return {React.ReactNode} The rendered comment input UI.\n */\nexport function AddComment( {\n\tonSubmit,\n\tshowCommentBoard,\n\tsetShowCommentBoard,\n} ) {\n\tconst { clientId, blockCommentId, isEmptyDefaultBlock } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getSelectedBlock } = select( blockEditorStore );\n\t\t\tconst selectedBlock = getSelectedBlock();\n\t\t\treturn {\n\t\t\t\tclientId: selectedBlock?.clientId,\n\t\t\t\tblockCommentId: selectedBlock?.attributes?.blockCommentId,\n\t\t\t\tisEmptyDefaultBlock: selectedBlock\n\t\t\t\t\t? isUnmodifiedDefaultBlock( selectedBlock )\n\t\t\t\t\t: false,\n\t\t\t};\n\t\t}\n\t);\n\n\tif (\n\t\t! showCommentBoard ||\n\t\t! clientId ||\n\t\tundefined !== blockCommentId ||\n\t\tisEmptyDefaultBlock\n\t) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<VStack\n\t\t\tspacing=\"3\"\n\t\t\tclassName=\"editor-collab-sidebar-panel__thread editor-collab-sidebar-panel__active-thread editor-collab-sidebar-panel__focus-thread\"\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={ ( inputComment ) => {\n\t\t\t\t\tonSubmit( inputComment );\n\t\t\t\t} }\n\t\t\t\tonCancel={ () => {\n\t\t\t\t\tsetShowCommentBoard( false );\n\t\t\t\t} }\n\t\t\t\tsubmitButtonText={ _x( 'Comment', 'Add comment button' ) }\n\t\t\t/>\n\t\t</VStack>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAIA,IAAAG,YAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAKA,IAAAK,kBAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,YAAA,GAAAD,sBAAA,CAAAN,OAAA;AAAyC,IAAAQ,WAAA,GAAAR,OAAA;AAhBzC;AACA;AACA;;AAUA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASS,UAAUA,CAAE;EAC3BC,QAAQ;EACRC,gBAAgB;EAChBC;AACD,CAAC,EAAG;EACH,MAAM;IAAEC,QAAQ;IAAE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sx-runtime");
45
45
  } = getSettings();
46
46
  const defaultAvatar = __experimentalDiscussionSettings?.avatarURL;
47
47
  return {
48
- currentUserAvatar: (_userData$avatar_urls = userData?.avatar_urls[48]) !== null && _userData$avatar_urls !== void 0 ? _userData$avatar_urls : defaultAvatar,
48
+ currentUserAvatar: (_userData$avatar_urls = userData?.avatar_urls?.[48]) !== null && _userData$avatar_urls !== void 0 ? _userData$avatar_urls : defaultAvatar,
49
49
  currentUserName: userData?.name
50
50
  };
51
51
  }, []);
@@ -65,9 +65,9 @@ var _jsxRuntime = require("react/jsx-runtime");
65
65
  className: "editor-collab-sidebar-panel__user-name",
66
66
  children: name !== null && name !== void 0 ? name : currentUserName
67
67
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)("time", {
68
- dateTime: (0, _date.dateI18n)('c', date !== null && date !== void 0 ? date : currentDate),
68
+ dateTime: (0, _date.dateI18n)('c', date ? (0, _date.getDate)(date) : currentDate),
69
69
  className: "editor-collab-sidebar-panel__user-time",
70
- children: (0, _date.dateI18n)(dateTimeFormat, date !== null && date !== void 0 ? date : currentDate)
70
+ children: (0, _date.dateI18n)(dateTimeFormat, date ? (0, _date.getDate)(date) : currentDate)
71
71
  })]
72
72
  })]
73
73
  });
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_i18n","_date","_coreData","_data","_blockEditor","_jsxRuntime","CommentAuthorInfo","avatar","name","date","dateSettings","getDateSettings","dateTimeFormat","formats","time","useEntityProp","currentUserAvatar","currentUserName","useSelect","select","_userData$avatar_urls","userData","coreStore","getCurrentUser","getSettings","blockEditorStore","__experimentalDiscussionSettings","defaultAvatar","avatarURL","avatar_urls","currentDate","Date","jsxs","Fragment","children","jsx","src","className","alt","__","width","height","__experimentalVStack","spacing","dateTime","dateI18n","_default","exports","default"],"sources":["@wordpress/editor/src/components/collab-sidebar/comment-author-info.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalVStack as VStack } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { dateI18n, getSettings as getDateSettings } from '@wordpress/date';\nimport { useEntityProp, store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Render author information for a comment.\n *\n * @param {Object} props - Component properties.\n * @param {string} props.avatar - URL of the author's avatar.\n * @param {string} props.name - Name of the author.\n * @param {string} props.date - Date of the comment.\n *\n * @return {React.ReactNode} The JSX element representing the author's information.\n */\nfunction CommentAuthorInfo( { avatar, name, date } ) {\n\tconst dateSettings = getDateSettings();\n\tconst [ dateTimeFormat = dateSettings.formats.time ] = useEntityProp(\n\t\t'root',\n\t\t'site',\n\t\t'time_format'\n\t);\n\n\tconst { currentUserAvatar, currentUserName } = useSelect( ( select ) => {\n\t\tconst userData = select( coreStore ).getCurrentUser();\n\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { __experimentalDiscussionSettings } = getSettings();\n\t\tconst defaultAvatar = __experimentalDiscussionSettings?.avatarURL;\n\t\treturn {\n\t\t\tcurrentUserAvatar: userData?.avatar_urls[ 48 ] ?? defaultAvatar,\n\t\t\tcurrentUserName: userData?.name,\n\t\t};\n\t}, [] );\n\n\tconst currentDate = new Date();\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/>\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<time\n\t\t\t\t\tdateTime={ dateI18n( 'c', date ?? currentDate ) }\n\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__user-time\"\n\t\t\t\t>\n\t\t\t\t\t{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AC;EAEP,MAAMsB,WAAW,GAAG,IAAIC,IAAI,CAAC,CAAC;EAE9B,oBACC,IAAA1B,WAAA,CAAA2B,IAAA,EAAA3B,WAAA,CAAA4B,QAAA;IAAAC,QAAA,gBACC,IAAA7B,WAAA,CAAA8B,GAAA;MACCC,GAAG,EAAG7B,MAAM,aAANA,MAAM,cAANA,MAAM,GAAIS,iBAAmB;MACnCqB,SAAS,EAAC;MACV;MAAA;MACAC,GAAG,EAAG,IAAAC,QAAE,EAAE,aAAc,CAAG;MAC3BC,KAAK,EAAG,EAAI;MACZC,MAAM,EAAG;IAAI,CACb,CAAC,eACF,IAAApC,WAAA,CAAA2B,IAAA,EAAClC,WAAA,CAAA4C,oBAAM;MAACC,OAAO,EAAC,GAAG;MAAAT,QAAA,gBAClB,IAAA7B,WAAA,CAAA8B,GAAA;QAAME,SAAS,EAAC,wCAAwC;QAAAH,QAAA,EACrD1B,IAAI,aAAJA,IAAI,cAAJA,IAAI,GAAIS;MAAe,CACpB,CAAC,eACP,IAAAZ,WAAA,CAAA8B,GAAA;QACCS,QAAQ,EAAG,IAAAC,cAAQ,EAAE,GAAG,EAAEpC,IAAI,aAAJA,IAAI,cAAJA,IAAI,GAAIqB,WAAY,CAAG;QACjDO,SAAS,EAAC,wCAAwC;QAAAH,QAAA,EAEhD,IAAAW,cAAQ,EAAEjC,cAAc,EAAEH,IAAI,aAAJA,IAAI,cAAJA,IAAI,GAAIqB,WAAY;MAAC,CAC5C,CAAC;IAAA,CACA,CAAC;EAAA,CACR,CAAC;AAEL;AAAC,IAAAgB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc1C,iBAAiB","ignoreList":[]}
1
+ {"version":3,"names":["_components","require","_i18n","_date","_coreData","_data","_blockEditor","_jsxRuntime","CommentAuthorInfo","avatar","name","date","dateSettings","getDateSettings","dateTimeFormat","formats","time","useEntityProp","currentUserAvatar","currentUserName","useSelect","select","_userData$avatar_urls","userData","coreStore","getCurrentUser","getSettings","blockEditorStore","__experimentalDiscussionSettings","defaultAvatar","avatarURL","avatar_urls","currentDate","Date","jsxs","Fragment","children","jsx","src","className","alt","__","width","height","__experimentalVStack","spacing","dateTime","dateI18n","getDate","_default","exports","default"],"sources":["@wordpress/editor/src/components/collab-sidebar/comment-author-info.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalVStack as VStack } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tdateI18n,\n\tgetDate,\n\tgetSettings as getDateSettings,\n} from '@wordpress/date';\nimport { useEntityProp, store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Render author information for a comment.\n *\n * @param {Object} props - Component properties.\n * @param {string} props.avatar - URL of the author's avatar.\n * @param {string} props.name - Name of the author.\n * @param {string} props.date - Date of the comment.\n *\n * @return {React.ReactNode} The JSX element representing the author's information.\n */\nfunction CommentAuthorInfo( { avatar, name, date } ) {\n\tconst dateSettings = getDateSettings();\n\tconst [ dateTimeFormat = dateSettings.formats.time ] = useEntityProp(\n\t\t'root',\n\t\t'site',\n\t\t'time_format'\n\t);\n\n\tconst { currentUserAvatar, currentUserName } = useSelect( ( select ) => {\n\t\tconst userData = select( coreStore ).getCurrentUser();\n\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { __experimentalDiscussionSettings } = getSettings();\n\t\tconst defaultAvatar = __experimentalDiscussionSettings?.avatarURL;\n\t\treturn {\n\t\t\tcurrentUserAvatar: userData?.avatar_urls?.[ 48 ] ?? defaultAvatar,\n\t\t\tcurrentUserName: userData?.name,\n\t\t};\n\t}, [] );\n\n\tconst currentDate = new Date();\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/>\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<time\n\t\t\t\t\tdateTime={ dateI18n(\n\t\t\t\t\t\t'c',\n\t\t\t\t\t\tdate ? getDate( date ) : currentDate\n\t\t\t\t\t) }\n\t\t\t\t\tclassName=\"editor-collab-sidebar-panel__user-time\"\n\t\t\t\t>\n\t\t\t\t\t{ dateI18n(\n\t\t\t\t\t\tdateTimeFormat,\n\t\t\t\t\t\tdate ? getDate( date ) : currentDate\n\t\t\t\t\t) }\n\t\t\t\t</time>\n\t\t\t</VStack>\n\t\t</>\n\t);\n}\n\nexport default CommentAuthorInfo;\n"],"mappings":";;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAKA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAAoE,IAAAM,WAAA,GAAAN,OAAA;AAZpE;AACA;AACA;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GACA,SAASO,iBAAiBA,CAAE;EAAEC,MAAM;EAAEC,IAAI;EAAEC;AAAK,CAAC,EAAG;EACpD,MAAMC,YAAY,GAAG,IAAAC,iBAAe,EAAC,CAAC;EACtC,MAAM,CAAEC,cAAc,GAAGF,YAAY,CAACG,OAAO,CAACC,IAAI,CAAE,GAAG,IAAAC,uBAAa,EACnE,MAAM,EACN,MAAM,EACN,aACD,CAAC;EAED,MAAM;IAAEC,iBAAiB;IAAEC;EAAgB,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAAA,IAAAC,qBAAA;IACvE,MAAMC,QAAQ,GAAGF,MAAM,CAAEG,eAAU,CAAC,CAACC,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,EACTjC,cAAc,EACdH,IAAI,GAAG,IAAAqC,aAAO,EAAErC,IAAK,CAAC,GAAGqB,WAC1B;MAAC,CACI,CAAC;IAAA,CACA,CAAC;EAAA,CACR,CAAC;AAEL;AAAC,IAAAiB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEc3C,iBAAiB","ignoreList":[]}
@@ -1,14 +1,21 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.default = void 0;
8
+ var _reactAutosizeTextarea = _interopRequireDefault(require("react-autosize-textarea"));
7
9
  var _element = require("@wordpress/element");
8
10
  var _components = require("@wordpress/components");
9
11
  var _i18n = require("@wordpress/i18n");
12
+ var _compose = require("@wordpress/compose");
10
13
  var _utils = require("./utils");
11
14
  var _jsxRuntime = require("react/jsx-runtime");
15
+ /**
16
+ * External dependencies
17
+ */
18
+
12
19
  /**
13
20
  * WordPress dependencies
14
21
  */
@@ -25,27 +32,36 @@ var _jsxRuntime = require("react/jsx-runtime");
25
32
  * @param {Function} props.onCancel - The function to call when canceling the comment update.
26
33
  * @param {Object} props.thread - The comment thread object.
27
34
  * @param {string} props.submitButtonText - The text to display on the submit button.
35
+ * @param {string?} props.placeholderText - The placeholder text for the comment input.
36
+ * @param {number?} props.rows - The number of rows for the comment input.
28
37
  * @return {React.ReactNode} The CommentForm component.
29
38
  */function CommentForm({
30
39
  onSubmit,
31
40
  onCancel,
32
41
  thread,
33
- submitButtonText
42
+ submitButtonText,
43
+ placeholderText,
44
+ rows = 4
34
45
  }) {
35
46
  var _thread$content$raw;
36
47
  const [inputComment, setInputComment] = (0, _element.useState)((_thread$content$raw = thread?.content?.raw) !== null && _thread$content$raw !== void 0 ? _thread$content$raw : '');
48
+ const inputId = (0, _compose.useInstanceId)(CommentForm, 'comment-input');
37
49
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
38
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.TextareaControl, {
39
- __next40pxDefaultSize: true,
40
- __nextHasNoMarginBottom: true,
50
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.VisuallyHidden, {
51
+ as: "label",
52
+ htmlFor: inputId,
53
+ children: (0, _i18n.__)('Comment')
54
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactAutosizeTextarea.default, {
55
+ id: inputId,
41
56
  value: inputComment !== null && inputComment !== void 0 ? inputComment : '',
42
- onChange: setInputComment,
43
- label: (0, _i18n.__)('Comment'),
44
- hideLabelFromVision: true
57
+ onChange: comment => setInputComment(comment.target.value),
58
+ rows: rows,
59
+ maxRows: 20,
60
+ placeholder: placeholderText || ''
45
61
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_components.__experimentalHStack, {
46
- alignment: "left",
47
62
  spacing: "3",
48
63
  justify: "flex-start",
64
+ wrap: true,
49
65
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
50
66
  __next40pxDefaultSize: true,
51
67
  accessibleWhenDisabled: true,
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_components","_i18n","_utils","_jsxRuntime","CommentForm","onSubmit","onCancel","thread","submitButtonText","_thread$content$raw","inputComment","setInputComment","useState","content","raw","jsxs","Fragment","children","jsx","TextareaControl","__next40pxDefaultSize","__nextHasNoMarginBottom","value","onChange","label","__","hideLabelFromVision","__experimentalHStack","alignment","spacing","justify","Button","accessibleWhenDisabled","variant","onClick","disabled","sanitizeCommentString","length","text","_x","_default","exports","default"],"sources":["@wordpress/editor/src/components/collab-sidebar/comment-form.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport {\n\t__experimentalHStack as HStack,\n\tButton,\n\tTextareaControl,\n} from '@wordpress/components';\nimport { _x, __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { sanitizeCommentString } from './utils';\n\n/**\n * EditComment component.\n *\n * @param {Object} props - The component props.\n * @param {Function} props.onSubmit - The function to call when updating the comment.\n * @param {Function} props.onCancel - The function to call when canceling the comment update.\n * @param {Object} props.thread - The comment thread object.\n * @param {string} props.submitButtonText - The text to display on the submit button.\n * @return {React.ReactNode} The CommentForm component.\n */\nfunction CommentForm( { onSubmit, onCancel, thread, submitButtonText } ) {\n\tconst [ inputComment, setInputComment ] = useState(\n\t\tthread?.content?.raw ?? ''\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<TextareaControl\n\t\t\t\t__next40pxDefaultSize\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tvalue={ inputComment ?? '' }\n\t\t\t\tonChange={ setInputComment }\n\t\t\t\tlabel={ __( 'Comment' ) }\n\t\t\t\thideLabelFromVision\n\t\t\t/>\n\t\t\t<HStack alignment=\"left\" spacing=\"3\" justify=\"flex-start\">\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tonSubmit( inputComment );\n\t\t\t\t\t\tsetInputComment( '' );\n\t\t\t\t\t} }\n\t\t\t\t\tdisabled={\n\t\t\t\t\t\t0 === sanitizeCommentString( inputComment ).length\n\t\t\t\t\t}\n\t\t\t\t\ttext={ submitButtonText }\n\t\t\t\t/>\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\tonClick={ onCancel }\n\t\t\t\t\ttext={ _x( 'Cancel', 'Cancel comment button' ) }\n\t\t\t\t/>\n\t\t\t</HStack>\n\t\t</>\n\t);\n}\n\nexport default CommentForm;\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAKA,IAAAE,KAAA,GAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAH,OAAA;A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,CACzB,CAAC,eACF,IAAAL,WAAA,CAAAe,GAAA,EAAClB,WAAA,CAAA+B,MAAM;QACNX,qBAAqB;QACrBa,OAAO,EAAC,UAAU;QAClBC,OAAO,EAAG5B,QAAU;QACpBgC,IAAI,EAAG,IAAAC,QAAE,EAAE,QAAQ,EAAE,uBAAwB;MAAG,CAChD,CAAC;IAAA,CACK,CAAC;EAAA,CACR,CAAC;AAEL;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEctC,WAAW","ignoreList":[]}
1
+ {"version":3,"names":["_reactAutosizeTextarea","_interopRequireDefault","require","_element","_components","_i18n","_compose","_utils","_jsxRuntime","CommentForm","onSubmit","onCancel","thread","submitButtonText","placeholderText","rows","_thread$content$raw","inputComment","setInputComment","useState","content","raw","inputId","useInstanceId","jsxs","Fragment","children","jsx","VisuallyHidden","as","htmlFor","__","default","id","value","onChange","comment","target","maxRows","placeholder","__experimentalHStack","spacing","justify","wrap","Button","__next40pxDefaultSize","accessibleWhenDisabled","variant","onClick","disabled","sanitizeCommentString","length","text","_x","_default","exports"],"sources":["@wordpress/editor/src/components/collab-sidebar/comment-form.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport TextareaAutosize from 'react-autosize-textarea';\n\n/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport {\n\t__experimentalHStack as HStack,\n\tButton,\n\tVisuallyHidden,\n} from '@wordpress/components';\nimport { _x, __ } from '@wordpress/i18n';\nimport { useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { sanitizeCommentString } from './utils';\n\n/**\n * EditComment component.\n *\n * @param {Object} props - The component props.\n * @param {Function} props.onSubmit - The function to call when updating the comment.\n * @param {Function} props.onCancel - The function to call when canceling the comment update.\n * @param {Object} props.thread - The comment thread object.\n * @param {string} props.submitButtonText - The text to display on the submit button.\n * @param {string?} props.placeholderText - The placeholder text for the comment input.\n * @param {number?} props.rows - The number of rows for the comment input.\n * @return {React.ReactNode} The CommentForm component.\n */\nfunction CommentForm( {\n\tonSubmit,\n\tonCancel,\n\tthread,\n\tsubmitButtonText,\n\tplaceholderText,\n\trows = 4,\n} ) {\n\tconst [ inputComment, setInputComment ] = useState(\n\t\tthread?.content?.raw ?? ''\n\t);\n\n\tconst inputId = useInstanceId( CommentForm, 'comment-input' );\n\n\treturn (\n\t\t<>\n\t\t\t<VisuallyHidden as=\"label\" htmlFor={ inputId }>\n\t\t\t\t{ __( 'Comment' ) }\n\t\t\t</VisuallyHidden>\n\t\t\t<TextareaAutosize\n\t\t\t\tid={ inputId }\n\t\t\t\tvalue={ inputComment ?? '' }\n\t\t\t\tonChange={ ( comment ) =>\n\t\t\t\t\tsetInputComment( comment.target.value )\n\t\t\t\t}\n\t\t\t\trows={ rows }\n\t\t\t\tmaxRows={ 20 }\n\t\t\t\tplaceholder={ placeholderText || '' }\n\t\t\t></TextareaAutosize>\n\t\t\t<HStack spacing=\"3\" justify=\"flex-start\" wrap>\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\taccessibleWhenDisabled\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tonSubmit( inputComment );\n\t\t\t\t\t\tsetInputComment( '' );\n\t\t\t\t\t} }\n\t\t\t\t\tdisabled={\n\t\t\t\t\t\t0 === sanitizeCommentString( inputComment ).length\n\t\t\t\t\t}\n\t\t\t\t\ttext={ submitButtonText }\n\t\t\t\t/>\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\tonClick={ onCancel }\n\t\t\t\t\ttext={ _x( 'Cancel', 'Cancel comment button' ) }\n\t\t\t\t/>\n\t\t\t</HStack>\n\t\t</>\n\t);\n}\n\nexport default CommentForm;\n"],"mappings":";;;;;;;AAGA,IAAAA,sBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,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AAe,IAAI;IAAI,CACnB,CAAC,eACpB,IAAAN,WAAA,CAAAgB,IAAA,EAACpB,WAAA,CAAAoC,oBAAM;MAACC,OAAO,EAAC,GAAG;MAACC,OAAO,EAAC,YAAY;MAACC,IAAI;MAAAjB,QAAA,gBAC5C,IAAAlB,WAAA,CAAAmB,GAAA,EAACvB,WAAA,CAAAwC,MAAM;QACNC,qBAAqB;QACrBC,sBAAsB;QACtBC,OAAO,EAAC,SAAS;QACjBC,OAAO,EAAGA,CAAA,KAAM;UACftC,QAAQ,CAAEO,YAAa,CAAC;UACxBC,eAAe,CAAE,EAAG,CAAC;QACtB,CAAG;QACH+B,QAAQ,EACP,CAAC,KAAK,IAAAC,4BAAqB,EAAEjC,YAAa,CAAC,CAACkC,MAC5C;QACDC,IAAI,EAAGvC;MAAkB,CACzB,CAAC,eACF,IAAAL,WAAA,CAAAmB,GAAA,EAACvB,WAAA,CAAAwC,MAAM;QACNC,qBAAqB;QACrBE,OAAO,EAAC,UAAU;QAClBC,OAAO,EAAGrC,QAAU;QACpByC,IAAI,EAAG,IAAAC,QAAE,EAAE,QAAQ,EAAE,uBAAwB;MAAG,CAChD,CAAC;IAAA,CACK,CAAC;EAAA,CACR,CAAC;AAEL;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAvB,OAAA,GAEcvB,WAAW","ignoreList":[]}
@@ -0,0 +1,112 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _components = require("@wordpress/components");
9
+ var _i18n = require("@wordpress/i18n");
10
+ var _element = require("@wordpress/element");
11
+ var _blockEditor = require("@wordpress/block-editor");
12
+ var _clsx = _interopRequireDefault(require("clsx"));
13
+ var _lockUnlock = require("../../lock-unlock");
14
+ var _jsxRuntime = require("react/jsx-runtime");
15
+ /**
16
+ * WordPress dependencies
17
+ */
18
+
19
+ /**
20
+ * External dependencies
21
+ */
22
+
23
+ /**
24
+ * Internal dependencies
25
+ */
26
+
27
+ const {
28
+ CommentIconToolbarSlotFill
29
+ } = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
30
+ const CommentAvatarIndicator = ({
31
+ onClick,
32
+ thread,
33
+ hasMoreComments
34
+ }) => {
35
+ const threadParticipants = (0, _element.useMemo)(() => {
36
+ if (!thread) {
37
+ return [];
38
+ }
39
+ const participantsMap = new Map();
40
+ const allComments = [thread, ...thread.reply];
41
+
42
+ // Sort by date to show participants in chronological order.
43
+ allComments.sort((a, b) => new Date(a.date) - new Date(b.date));
44
+ allComments.forEach(comment => {
45
+ // Track thread participants (original commenter + repliers).
46
+ if (comment.author_name && comment.author_avatar_urls) {
47
+ const authorKey = `${comment.author}-${comment.author_name}`;
48
+ if (!participantsMap.has(authorKey)) {
49
+ participantsMap.set(authorKey, {
50
+ name: comment.author_name,
51
+ avatar: comment.author_avatar_urls?.['48'] || comment.author_avatar_urls?.['96'],
52
+ isOriginalCommenter: comment.id === thread.id,
53
+ date: comment.date
54
+ });
55
+ }
56
+ }
57
+ });
58
+ return Array.from(participantsMap.values());
59
+ }, [thread]);
60
+ const hasUnresolved = thread?.status !== 'approved';
61
+
62
+ // Check if this specific thread has more participants due to pagination.
63
+ // If we have pagination AND this thread + its replies equals or exceeds the API limit,
64
+ // then this thread likely has more participants that weren't loaded.
65
+ const threadHasMoreParticipants = hasMoreComments && thread?.reply && 1 + thread.reply.length >= 100;
66
+ if (!threadParticipants.length) {
67
+ return null;
68
+ }
69
+
70
+ // Show up to 3 avatars, with overflow indicator.
71
+ const maxAvatars = 3;
72
+ const visibleParticipants = threadParticipants.slice(0, maxAvatars);
73
+ const overflowCount = Math.max(0, threadParticipants.length - maxAvatars);
74
+
75
+ // If we hit the comment limit, show "100+" instead of exact overflow count.
76
+ const overflowText = threadHasMoreParticipants && overflowCount > 0 ? (0, _i18n.__)('100+') : (0, _i18n.sprintf)(
77
+ // translators: %s: Number of comments.
78
+ (0, _i18n.__)('+%s'), overflowCount);
79
+ const overflowTitle = threadHasMoreParticipants && overflowCount > 0 ? (0, _i18n.__)('100+ participants') : (0, _i18n.sprintf)(
80
+ // translators: %s: Number of comments.
81
+ (0, _i18n.__)('+%s more participants'), overflowCount);
82
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(CommentIconToolbarSlotFill.Fill, {
83
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.ToolbarButton, {
84
+ className: (0, _clsx.default)('comment-avatar-indicator', {
85
+ 'has-unresolved': hasUnresolved
86
+ }),
87
+ label: (0, _i18n._x)('View comments', 'View comment thread'),
88
+ onClick: onClick,
89
+ showTooltip: true,
90
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
91
+ className: "comment-avatar-stack",
92
+ children: [visibleParticipants.map((participant, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
93
+ src: participant.avatar,
94
+ alt: participant.name,
95
+ className: "comment-avatar",
96
+ style: {
97
+ zIndex: maxAvatars - index
98
+ }
99
+ }, participant.name + index)), overflowCount > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
100
+ className: "comment-avatar-overflow",
101
+ style: {
102
+ zIndex: 0
103
+ },
104
+ title: overflowTitle,
105
+ children: overflowText
106
+ })]
107
+ })
108
+ })
109
+ });
110
+ };
111
+ var _default = exports.default = CommentAvatarIndicator;
112
+ //# sourceMappingURL=comment-indicator-toolbar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_components","require","_i18n","_element","_blockEditor","_clsx","_interopRequireDefault","_lockUnlock","_jsxRuntime","CommentIconToolbarSlotFill","unlock","blockEditorPrivateApis","CommentAvatarIndicator","onClick","thread","hasMoreComments","threadParticipants","useMemo","participantsMap","Map","allComments","reply","sort","a","b","Date","date","forEach","comment","author_name","author_avatar_urls","authorKey","author","has","set","name","avatar","isOriginalCommenter","id","Array","from","values","hasUnresolved","status","threadHasMoreParticipants","length","maxAvatars","visibleParticipants","slice","overflowCount","Math","max","overflowText","__","sprintf","overflowTitle","jsx","Fill","children","ToolbarButton","className","clsx","label","_x","showTooltip","jsxs","map","participant","index","src","alt","style","zIndex","title","_default","exports","default"],"sources":["@wordpress/editor/src/components/collab-sidebar/comment-indicator-toolbar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ToolbarButton } from '@wordpress/components';\nimport { _x, __, sprintf } from '@wordpress/i18n';\nimport { useMemo } from '@wordpress/element';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { CommentIconToolbarSlotFill } = unlock( blockEditorPrivateApis );\n\nconst CommentAvatarIndicator = ( { onClick, thread, hasMoreComments } ) => {\n\tconst threadParticipants = useMemo( () => {\n\t\tif ( ! thread ) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst participantsMap = new Map();\n\t\tconst allComments = [ thread, ...thread.reply ];\n\n\t\t// Sort by date to show participants in chronological order.\n\t\tallComments.sort( ( a, b ) => new Date( a.date ) - new Date( b.date ) );\n\n\t\tallComments.forEach( ( comment ) => {\n\t\t\t// Track thread participants (original commenter + repliers).\n\t\t\tif ( comment.author_name && comment.author_avatar_urls ) {\n\t\t\t\tconst authorKey = `${ comment.author }-${ comment.author_name }`;\n\t\t\t\tif ( ! participantsMap.has( authorKey ) ) {\n\t\t\t\t\tparticipantsMap.set( authorKey, {\n\t\t\t\t\t\tname: comment.author_name,\n\t\t\t\t\t\tavatar:\n\t\t\t\t\t\t\tcomment.author_avatar_urls?.[ '48' ] ||\n\t\t\t\t\t\t\tcomment.author_avatar_urls?.[ '96' ],\n\t\t\t\t\t\tisOriginalCommenter: comment.id === thread.id,\n\t\t\t\t\t\tdate: comment.date,\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\n\t\treturn Array.from( participantsMap.values() );\n\t}, [ thread ] );\n\n\tconst hasUnresolved = thread?.status !== 'approved';\n\n\t// Check if this specific thread has more participants due to pagination.\n\t// If we have pagination AND this thread + its replies equals or exceeds the API limit,\n\t// then this thread likely has more participants that weren't loaded.\n\tconst threadHasMoreParticipants =\n\t\thasMoreComments && thread?.reply && 1 + thread.reply.length >= 100;\n\n\tif ( ! threadParticipants.length ) {\n\t\treturn null;\n\t}\n\n\t// Show up to 3 avatars, with overflow indicator.\n\tconst maxAvatars = 3;\n\tconst visibleParticipants = threadParticipants.slice( 0, maxAvatars );\n\tconst overflowCount = Math.max( 0, threadParticipants.length - maxAvatars );\n\n\t// If we hit the comment limit, show \"100+\" instead of exact overflow count.\n\tconst overflowText =\n\t\tthreadHasMoreParticipants && overflowCount > 0\n\t\t\t? __( '100+' )\n\t\t\t: sprintf(\n\t\t\t\t\t// translators: %s: Number of comments.\n\t\t\t\t\t__( '+%s' ),\n\t\t\t\t\toverflowCount\n\t\t\t );\n\n\tconst overflowTitle =\n\t\tthreadHasMoreParticipants && overflowCount > 0\n\t\t\t? __( '100+ participants' )\n\t\t\t: sprintf(\n\t\t\t\t\t// translators: %s: Number of comments.\n\t\t\t\t\t__( '+%s more participants' ),\n\t\t\t\t\toverflowCount\n\t\t\t );\n\n\treturn (\n\t\t<CommentIconToolbarSlotFill.Fill>\n\t\t\t<ToolbarButton\n\t\t\t\tclassName={ clsx( 'comment-avatar-indicator', {\n\t\t\t\t\t'has-unresolved': hasUnresolved,\n\t\t\t\t} ) }\n\t\t\t\tlabel={ _x( 'View comments', 'View comment thread' ) }\n\t\t\t\tonClick={ onClick }\n\t\t\t\tshowTooltip\n\t\t\t>\n\t\t\t\t<div className=\"comment-avatar-stack\">\n\t\t\t\t\t{ visibleParticipants.map( ( participant, index ) => (\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\tkey={ participant.name + index }\n\t\t\t\t\t\t\tsrc={ participant.avatar }\n\t\t\t\t\t\t\talt={ participant.name }\n\t\t\t\t\t\t\tclassName=\"comment-avatar\"\n\t\t\t\t\t\t\tstyle={ { zIndex: maxAvatars - index } }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) ) }\n\t\t\t\t\t{ overflowCount > 0 && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName=\"comment-avatar-overflow\"\n\t\t\t\t\t\t\tstyle={ { zIndex: 0 } }\n\t\t\t\t\t\t\ttitle={ overflowTitle }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ overflowText }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t</ToolbarButton>\n\t\t</CommentIconToolbarSlotFill.Fill>\n\t);\n};\n\nexport default CommentAvatarIndicator;\n"],"mappings":";;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAKA,IAAAI,KAAA,GAAAC,sBAAA,CAAAL,OAAA;AAKA,IAAAM,WAAA,GAAAN,OAAA;AAA2C,IAAAO,WAAA,GAAAP,OAAA;AAhB3C;AACA;AACA;;AAMA;AACA;AACA;;AAGA;AACA;AACA;;AAGA,MAAM;EAAEQ;AAA2B,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAEvE,MAAMC,sBAAsB,GAAGA,CAAE;EAAEC,OAAO;EAAEC,MAAM;EAAEC;AAAgB,CAAC,KAAM;EAC1E,MAAMC,kBAAkB,GAAG,IAAAC,gBAAO,EAAE,MAAM;IACzC,IAAK,CAAEH,MAAM,EAAG;MACf,OAAO,EAAE;IACV;IAEA,MAAMI,eAAe,GAAG,IAAIC,GAAG,CAAC,CAAC;IACjC,MAAMC,WAAW,GAAG,CAAEN,MAAM,EAAE,GAAGA,MAAM,CAACO,KAAK,CAAE;;IAE/C;IACAD,WAAW,CAACE,IAAI,CAAE,CAAEC,CAAC,EAAEC,CAAC,KAAM,IAAIC,IAAI,CAAEF,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