@wordpress/block-library 9.0.4 → 9.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -17
- package/build/button/index.js +1 -0
- package/build/button/index.js.map +1 -1
- package/build/comment-date/edit.js +1 -1
- package/build/comment-date/edit.js.map +1 -1
- package/build/list-item/edit.native.js +1 -15
- package/build/list-item/edit.native.js.map +1 -1
- package/build/missing/edit.native.js +29 -4
- package/build/missing/edit.native.js.map +1 -1
- package/build/post-content/index.js +13 -1
- package/build/post-content/index.js.map +1 -1
- package/build/post-date/edit.js +1 -1
- package/build/post-date/edit.js.map +1 -1
- package/build/pullquote/index.js +13 -0
- package/build/pullquote/index.js.map +1 -1
- package/build/query/edit/inspector-controls/create-new-post-link.js +10 -10
- package/build/query/edit/inspector-controls/create-new-post-link.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +2 -2
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/quote/index.js +13 -0
- package/build/quote/index.js.map +1 -1
- package/build/site-tagline/index.js +1 -0
- package/build/site-tagline/index.js.map +1 -1
- package/build/site-title/index.js +1 -0
- package/build/site-title/index.js.map +1 -1
- package/build/table-of-contents/index.js +1 -1
- package/build/verse/index.js +14 -0
- package/build/verse/index.js.map +1 -1
- package/build-module/button/index.js +1 -0
- package/build-module/button/index.js.map +1 -1
- package/build-module/comment-date/edit.js +2 -2
- package/build-module/comment-date/edit.js.map +1 -1
- package/build-module/list-item/edit.native.js +2 -16
- package/build-module/list-item/edit.native.js.map +1 -1
- package/build-module/missing/edit.native.js +30 -5
- package/build-module/missing/edit.native.js.map +1 -1
- package/build-module/post-content/index.js +13 -1
- package/build-module/post-content/index.js.map +1 -1
- package/build-module/post-date/edit.js +2 -2
- package/build-module/post-date/edit.js.map +1 -1
- package/build-module/pullquote/index.js +13 -0
- package/build-module/pullquote/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/create-new-post-link.js +10 -10
- package/build-module/query/edit/inspector-controls/create-new-post-link.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +2 -2
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/quote/index.js +13 -0
- package/build-module/quote/index.js.map +1 -1
- package/build-module/site-tagline/index.js +1 -0
- package/build-module/site-tagline/index.js.map +1 -1
- package/build-module/site-title/index.js +1 -0
- package/build-module/site-title/index.js.map +1 -1
- package/build-module/table-of-contents/index.js +1 -1
- package/build-module/verse/index.js +14 -0
- package/build-module/verse/index.js.map +1 -1
- package/build-style/editor-rtl.css +0 -11
- package/build-style/editor.css +0 -11
- package/build-style/image/style-rtl.css +6 -0
- package/build-style/image/style.css +6 -0
- package/build-style/media-text/style-rtl.css +4 -0
- package/build-style/media-text/style.css +4 -0
- package/build-style/navigation/editor-rtl.css +0 -11
- package/build-style/navigation/editor.css +0 -11
- package/build-style/style-rtl.css +10 -0
- package/build-style/style.css +10 -0
- package/package.json +35 -35
- package/src/button/block.json +1 -0
- package/src/buttons/test/edit.native.js +48 -8
- package/src/comment-date/edit.js +8 -2
- package/src/comment-date/index.php +7 -5
- package/src/image/style.scss +10 -0
- package/src/list-item/edit.native.js +2 -22
- package/src/media-text/style.scss +4 -0
- package/src/missing/edit.native.js +44 -12
- package/src/missing/test/__snapshots__/edit.native.js.snap +75 -59
- package/src/navigation/editor.scss +0 -12
- package/src/paragraph/test/__snapshots__/edit.native.js.snap +30 -0
- package/src/paragraph/test/edit.native.js +99 -0
- package/src/post-content/block.json +13 -1
- package/src/post-date/edit.js +8 -2
- package/src/post-date/index.php +14 -3
- package/src/pullquote/block.json +13 -0
- package/src/query/edit/inspector-controls/create-new-post-link.js +12 -8
- package/src/query/edit/inspector-controls/index.js +5 -3
- package/src/quote/block.json +13 -0
- package/src/site-logo/index.php +6 -0
- package/src/site-tagline/block.json +1 -0
- package/src/site-title/block.json +1 -0
- package/src/social-links/test/edit.native.js +41 -5
- package/src/table-of-contents/block.json +1 -1
- package/src/verse/block.json +14 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 9.2.0 (2024-06-26)
|
|
6
|
+
|
|
7
|
+
## 9.1.0 (2024-06-15)
|
|
8
|
+
|
|
5
9
|
## 9.0.0 (2024-05-31)
|
|
6
10
|
|
|
7
11
|
### Breaking Changes
|
|
@@ -43,7 +47,7 @@
|
|
|
43
47
|
|
|
44
48
|
## 8.21.0 (2023-10-18)
|
|
45
49
|
|
|
46
|
-
### Bug
|
|
50
|
+
### Bug Fixes
|
|
47
51
|
|
|
48
52
|
- Fix Image block lightbox missing alt attribute and improve accessibility. ([#54608](https://github.com/WordPress/gutenberg/pull/55010))
|
|
49
53
|
|
|
@@ -105,13 +109,13 @@
|
|
|
105
109
|
|
|
106
110
|
## 7.14.0 (2022-09-13)
|
|
107
111
|
|
|
108
|
-
### New
|
|
112
|
+
### New Features
|
|
109
113
|
|
|
110
114
|
- Made it possible to import individual blocks ([#42258](https://github.com/WordPress/gutenberg/pull/42258)). Check [README](./README.md#loading-individual-blocks) for more information.
|
|
111
115
|
|
|
112
116
|
## 7.13.0 (2022-08-24)
|
|
113
117
|
|
|
114
|
-
### Bug
|
|
118
|
+
### Bug Fixes
|
|
115
119
|
|
|
116
120
|
- Ensure all dependencies allow version ranges ([#43355](https://github.com/WordPress/gutenberg/pull/43355)).
|
|
117
121
|
|
|
@@ -129,7 +133,7 @@
|
|
|
129
133
|
|
|
130
134
|
## 7.6.0 (2022-05-18)
|
|
131
135
|
|
|
132
|
-
###
|
|
136
|
+
### Enhancements
|
|
133
137
|
|
|
134
138
|
- Declare blocks as \_\_experimental in block.json to automate syncing Gutenberg packages to WordPress ([#40655](https://github.com/WordPress/gutenberg/pull/40655)).
|
|
135
139
|
|
|
@@ -141,11 +145,11 @@
|
|
|
141
145
|
|
|
142
146
|
## 7.2.0 (2022-03-23)
|
|
143
147
|
|
|
144
|
-
### Bug
|
|
148
|
+
### Bug Fixes
|
|
145
149
|
|
|
146
150
|
- Table block: Fix deprecation eligibility to prevent loss of named (color palette) background color ([#39445](https://github.com/WordPress/gutenberg/pull/39445)).
|
|
147
151
|
|
|
148
|
-
###
|
|
152
|
+
### Enhancements
|
|
149
153
|
|
|
150
154
|
- Social Icons: Avoid loss of previously selected background color when switching back from "Logos Only" style ([#39276](https://github.com/WordPress/gutenberg/pull/39276)).
|
|
151
155
|
|
|
@@ -153,11 +157,11 @@
|
|
|
153
157
|
|
|
154
158
|
## 7.0.0 (2022-02-10)
|
|
155
159
|
|
|
156
|
-
### Breaking
|
|
160
|
+
### Breaking Changes
|
|
157
161
|
|
|
158
162
|
- The `GUTENBERG_PHASE` environment variable has been renamed to `IS_GUTENBERG_PLUGIN` and is now a boolean ([#38202](https://github.com/WordPress/gutenberg/pull/38202)).
|
|
159
163
|
|
|
160
|
-
### Bug
|
|
164
|
+
### Bug Fixes
|
|
161
165
|
|
|
162
166
|
- Gallery block: disable edit as html support ([#39318](https://github.com/WordPress/gutenberg/pull/39318)).
|
|
163
167
|
- Removed unused `@wordpress/escape-html` and `@wordpress/is-shallow-equal` dependencies ([#38388](https://github.com/WordPress/gutenberg/pull/38388)).
|
|
@@ -168,13 +172,13 @@
|
|
|
168
172
|
|
|
169
173
|
## 6.0.0 (2021-09-09)
|
|
170
174
|
|
|
171
|
-
### Breaking
|
|
175
|
+
### Breaking Changes
|
|
172
176
|
|
|
173
177
|
- Remove the background-colors, foreground-colors, and gradient-colors mixins.
|
|
174
178
|
|
|
175
179
|
## 5.0.0 (2021-07-29)
|
|
176
180
|
|
|
177
|
-
### Breaking
|
|
181
|
+
### Breaking Changes
|
|
178
182
|
|
|
179
183
|
- Upgraded React components to work with v17.0 ([#29118](https://github.com/WordPress/gutenberg/pull/29118)). There are no new features in React v17.0 as explained in the [blog post](https://reactjs.org/blog/2020/10/20/react-v17.html).
|
|
180
184
|
|
|
@@ -221,7 +225,7 @@
|
|
|
221
225
|
|
|
222
226
|
## 2.27.0 (2020-12-17)
|
|
223
227
|
|
|
224
|
-
###
|
|
228
|
+
### Enhancements
|
|
225
229
|
|
|
226
230
|
- File Block: Copy url button is moved to Block toolbar.
|
|
227
231
|
- Code and Preformatted Blocks: delete on backspace from an empty block.
|
|
@@ -233,13 +237,13 @@
|
|
|
233
237
|
([#26569](https://github.com/WordPress/gutenberg/pull/26569)).
|
|
234
238
|
- Fix Image Block, reset image dimensions when replace URL. bug mentioned in ([#26333](https://github.com/WordPress/gutenberg/issues/26333)).
|
|
235
239
|
|
|
236
|
-
###
|
|
240
|
+
### Enhancements
|
|
237
241
|
|
|
238
242
|
- File Block: Copy url button is moved to Block toolbar.
|
|
239
243
|
|
|
240
244
|
## 2.23.0 (2020-09-03)
|
|
241
245
|
|
|
242
|
-
###
|
|
246
|
+
### Enhancements
|
|
243
247
|
|
|
244
248
|
- Site title is now a link.
|
|
245
249
|
|
|
@@ -286,7 +290,7 @@
|
|
|
286
290
|
|
|
287
291
|
## 2.3.0 (2019-03-06)
|
|
288
292
|
|
|
289
|
-
### New
|
|
293
|
+
### New Features
|
|
290
294
|
|
|
291
295
|
- Add background color controls for the table block.
|
|
292
296
|
- Add new `RSS` block ([#7966](https://github.com/WordPress/gutenberg/pull/7966)).
|
|
@@ -318,7 +322,7 @@
|
|
|
318
322
|
|
|
319
323
|
## 2.2.2 (2018-11-12)
|
|
320
324
|
|
|
321
|
-
###
|
|
325
|
+
### Internal
|
|
322
326
|
|
|
323
327
|
- Columns Block: Improve usability while editing columns.
|
|
324
328
|
|
|
@@ -332,7 +336,7 @@
|
|
|
332
336
|
|
|
333
337
|
## 2.1.8 (2018-11-03)
|
|
334
338
|
|
|
335
|
-
###
|
|
339
|
+
### Internal
|
|
336
340
|
|
|
337
341
|
- File Block: Create file blocks when dropping multiple files at once.
|
|
338
342
|
|
|
@@ -366,7 +370,7 @@
|
|
|
366
370
|
|
|
367
371
|
## 2.0.0 (2018-09-05)
|
|
368
372
|
|
|
369
|
-
### Breaking
|
|
373
|
+
### Breaking Changes
|
|
370
374
|
|
|
371
375
|
- Change how required built-ins are polyfilled with Babel 7 ([#9171](https://github.com/WordPress/gutenberg/pull/9171)). If you're using an environment that has limited or no support for ES2015+ such as lower versions of IE then using [core-js](https://github.com/zloirock/core-js) or [@babel/polyfill](https://babeljs.io/docs/en/next/babel-polyfill) will add support for these methods.
|
|
372
376
|
|
package/build/button/index.js
CHANGED
|
@@ -112,6 +112,7 @@ const metadata = exports.metadata = {
|
|
|
112
112
|
__experimentalTextTransform: true,
|
|
113
113
|
__experimentalTextDecoration: true,
|
|
114
114
|
__experimentalLetterSpacing: true,
|
|
115
|
+
__experimentalWritingMode: true,
|
|
115
116
|
__experimentalDefaultControls: {
|
|
116
117
|
fontSize: true
|
|
117
118
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_icons","_initBlock","_interopRequireDefault","_deprecated","_edit","_save","metadata","exports","$schema","apiVersion","name","title","category","parent","description","keywords","textdomain","attributes","tagName","type","textAlign","url","source","selector","attribute","__experimentalRole","text","linkTarget","rel","placeholder","backgroundColor","textColor","gradient","width","supports","anchor","splitting","align","alignWide","color","__experimentalSkipSerialization","gradients","__experimentalDefaultControls","background","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","reusable","shadow","spacing","padding","__experimentalBorder","radius","style","__experimentalSelector","interactivity","clientNavigation","styles","label","isDefault","editorStyle","settings","icon","example","className","__","edit","save","deprecated","merge","a","init","initBlock"],"sources":["@wordpress/block-library/src/button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { button as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tclassName: 'is-style-fill',\n\t\t\ttext: __( 'Call to Action' ),\n\t\t},\n\t},\n\tedit,\n\tsave,\n\tdeprecated,\n\tmerge: ( a, { text = '' } ) => ( {\n\t\t...a,\n\t\ttext: ( a.text || '' ) + text,\n\t} ),\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAKA,IAAAE,UAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,WAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,KAAA,GAAAF,sBAAA,CAAAH,OAAA;AAEA,IAAAM,KAAA,GAAAH,sBAAA,CAAAH,OAAA;AAbA;AACA;AACA;AAIA;AACA;AACA;AAFA,MAAAO,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,MAAA;EAAAC,WAAA;EAAAC,QAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,OAAA;MAAAC,IAAA;MAAA;MAAA;IAAA;IAAAA,IAAA;MAAAA,IAAA;MAAA;IAAA;IAAAC,SAAA;MAAAD,IAAA;IAAA;IAAAE,GAAA;MAAAF,IAAA;MAAAG,MAAA;MAAAC,QAAA;MAAAC,SAAA;MAAAC,kBAAA;IAAA;IAAAd,KAAA;MAAAQ,IAAA;MAAAG,MAAA;MAAAC,QAAA;MAAAC,SAAA;MAAAC,kBAAA;IAAA;IAAAC,IAAA;MAAAP,IAAA;MAAAG,MAAA;MAAAC,QAAA;MAAAE,kBAAA;IAAA;IAAAE,UAAA;MAAAR,IAAA;MAAAG,MAAA;MAAAC,QAAA;MAAAC,SAAA;MAAAC,kBAAA;IAAA;IAAAG,GAAA;MAAAT,IAAA;MAAAG,MAAA;MAAAC,QAAA;MAAAC,SAAA;MAAAC,kBAAA;IAAA;IAAAI,WAAA;MAAAV,IAAA;IAAA;IAAAW,eAAA;MAAAX,IAAA;IAAA;IAAAY,SAAA;MAAAZ,IAAA;IAAA;IAAAa,QAAA;MAAAb,IAAA;IAAA;IAAAc,KAAA;MAAAd,IAAA;IAAA;EAAA;EAAAe,QAAA;IAAAC,MAAA;IAAAC,SAAA;IAAAC,KAAA;IAAAC,SAAA;IAAAC,KAAA;MAAAC,+BAAA;MAAAC,SAAA;MAAAC,6BAAA;QAAAC,UAAA;QAAAjB,IAAA;MAAA;IAAA;IAAAkB,UAAA;MAAAC,QAAA;MAAAC,UAAA;MAAAC,wBAAA;MAAAC,wBAAA;MAAAC,uBAAA;MAAAC,2BAAA;MAAAC,4BAAA;MAAAC,2BAAA;
|
|
1
|
+
{"version":3,"names":["_i18n","require","_icons","_initBlock","_interopRequireDefault","_deprecated","_edit","_save","metadata","exports","$schema","apiVersion","name","title","category","parent","description","keywords","textdomain","attributes","tagName","type","textAlign","url","source","selector","attribute","__experimentalRole","text","linkTarget","rel","placeholder","backgroundColor","textColor","gradient","width","supports","anchor","splitting","align","alignWide","color","__experimentalSkipSerialization","gradients","__experimentalDefaultControls","background","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","__experimentalWritingMode","reusable","shadow","spacing","padding","__experimentalBorder","radius","style","__experimentalSelector","interactivity","clientNavigation","styles","label","isDefault","editorStyle","settings","icon","example","className","__","edit","save","deprecated","merge","a","init","initBlock"],"sources":["@wordpress/block-library/src/button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { button as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport deprecated from './deprecated';\nimport edit from './edit';\nimport metadata from './block.json';\nimport save from './save';\n\nconst { name } = metadata;\n\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\texample: {\n\t\tattributes: {\n\t\t\tclassName: 'is-style-fill',\n\t\t\ttext: __( 'Call to Action' ),\n\t\t},\n\t},\n\tedit,\n\tsave,\n\tdeprecated,\n\tmerge: ( a, { text = '' } ) => ( {\n\t\t...a,\n\t\ttext: ( a.text || '' ) + text,\n\t} ),\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAKA,IAAAE,UAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,WAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,KAAA,GAAAF,sBAAA,CAAAH,OAAA;AAEA,IAAAM,KAAA,GAAAH,sBAAA,CAAAH,OAAA;AAbA;AACA;AACA;AAIA;AACA;AACA;AAFA,MAAAO,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,MAAA;EAAAC,WAAA;EAAAC,QAAA;EAAAC,UAAA;EAAAC,UAAA;IAAAC,OAAA;MAAAC,IAAA;MAAA;MAAA;IAAA;IAAAA,IAAA;MAAAA,IAAA;MAAA;IAAA;IAAAC,SAAA;MAAAD,IAAA;IAAA;IAAAE,GAAA;MAAAF,IAAA;MAAAG,MAAA;MAAAC,QAAA;MAAAC,SAAA;MAAAC,kBAAA;IAAA;IAAAd,KAAA;MAAAQ,IAAA;MAAAG,MAAA;MAAAC,QAAA;MAAAC,SAAA;MAAAC,kBAAA;IAAA;IAAAC,IAAA;MAAAP,IAAA;MAAAG,MAAA;MAAAC,QAAA;MAAAE,kBAAA;IAAA;IAAAE,UAAA;MAAAR,IAAA;MAAAG,MAAA;MAAAC,QAAA;MAAAC,SAAA;MAAAC,kBAAA;IAAA;IAAAG,GAAA;MAAAT,IAAA;MAAAG,MAAA;MAAAC,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,EAAE;MACXsD,SAAS,EAAE,eAAe;MAC1B7C,IAAI,EAAE,IAAA8C,QAAE,EAAE,gBAAiB;IAC5B;EACD,CAAC;EACDC,IAAI,EAAJA,aAAI;EACJC,IAAI,EAAJA,aAAI;EACJC,UAAU,EAAVA,mBAAU;EACVC,KAAK,EAAEA,CAAEC,CAAC,EAAE;IAAEnD,IAAI,GAAG;EAAG,CAAC,MAAQ;IAChC,GAAGmD,CAAC;IACJnD,IAAI,EAAE,CAAEmD,CAAC,CAACnD,IAAI,IAAI,EAAE,IAAKA;EAC1B,CAAC;AACF,CAAC;AAEM,MAAMoD,IAAI,GAAGA,CAAA,KAAM,IAAAC,kBAAS,EAAE;EAAErE,IAAI;EAAEJ,QAAQ;EAAE8D;AAAS,CAAE,CAAC;AAAC7D,OAAA,CAAAuE,IAAA,GAAAA,IAAA","ignoreList":[]}
|
|
@@ -63,7 +63,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
63
63
|
}
|
|
64
64
|
let commentDate = date instanceof Date ? /*#__PURE__*/(0, _jsxRuntime.jsx)("time", {
|
|
65
65
|
dateTime: (0, _date.dateI18n)('c', date),
|
|
66
|
-
children: (0, _date.dateI18n)(format || siteFormat, date)
|
|
66
|
+
children: format === 'human-diff' ? (0, _date.humanTimeDiff)(date) : (0, _date.dateI18n)(format || siteFormat, date)
|
|
67
67
|
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)("time", {
|
|
68
68
|
children: date
|
|
69
69
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_coreData","require","_date","_blockEditor","_components","_i18n","_jsxRuntime","Edit","attributes","format","isLink","context","commentId","setAttributes","blockProps","useBlockProps","date","useEntityProp","siteFormat","getDateSettings","formats","inspectorControls","jsx","InspectorControls","children","jsxs","PanelBody","title","__","__experimentalDateFormatPicker","defaultFormat","onChange","nextFormat","ToggleControl","__nextHasNoMarginBottom","label","checked","_x","commentDate","Date","dateTime","dateI18n","href","onClick","event","preventDefault","Fragment"],"sources":["@wordpress/block-library/src/comment-date/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEntityProp } from '@wordpress/core-data';\nimport {
|
|
1
|
+
{"version":3,"names":["_coreData","require","_date","_blockEditor","_components","_i18n","_jsxRuntime","Edit","attributes","format","isLink","context","commentId","setAttributes","blockProps","useBlockProps","date","useEntityProp","siteFormat","getDateSettings","formats","inspectorControls","jsx","InspectorControls","children","jsxs","PanelBody","title","__","__experimentalDateFormatPicker","defaultFormat","onChange","nextFormat","ToggleControl","__nextHasNoMarginBottom","label","checked","_x","commentDate","Date","dateTime","dateI18n","humanTimeDiff","href","onClick","event","preventDefault","Fragment"],"sources":["@wordpress/block-library/src/comment-date/edit.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEntityProp } from '@wordpress/core-data';\nimport {\n\tdateI18n,\n\thumanTimeDiff,\n\tgetSettings as getDateSettings,\n} from '@wordpress/date';\nimport {\n\tInspectorControls,\n\tuseBlockProps,\n\t__experimentalDateFormatPicker as DateFormatPicker,\n} from '@wordpress/block-editor';\nimport { PanelBody, ToggleControl } from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\n\n/**\n * Renders the `core/comment-date` block on the editor.\n *\n * @param {Object} props React props.\n * @param {Object} props.setAttributes Callback for updating block attributes.\n * @param {Object} props.attributes Block attributes.\n * @param {string} props.attributes.format Format of the date.\n * @param {string} props.attributes.isLink Whether the author name should be linked.\n * @param {Object} props.context Inherited context.\n * @param {string} props.context.commentId The comment ID.\n *\n * @return {JSX.Element} React element.\n */\nexport default function Edit( {\n\tattributes: { format, isLink },\n\tcontext: { commentId },\n\tsetAttributes,\n} ) {\n\tconst blockProps = useBlockProps();\n\tlet [ date ] = useEntityProp( 'root', 'comment', 'date', commentId );\n\tconst [ siteFormat = getDateSettings().formats.date ] = useEntityProp(\n\t\t'root',\n\t\t'site',\n\t\t'date_format'\n\t);\n\n\tconst inspectorControls = (\n\t\t<InspectorControls>\n\t\t\t<PanelBody title={ __( 'Settings' ) }>\n\t\t\t\t<DateFormatPicker\n\t\t\t\t\tformat={ format }\n\t\t\t\t\tdefaultFormat={ siteFormat }\n\t\t\t\t\tonChange={ ( nextFormat ) =>\n\t\t\t\t\t\tsetAttributes( { format: nextFormat } )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t<ToggleControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Link to comment' ) }\n\t\t\t\t\tonChange={ () => setAttributes( { isLink: ! isLink } ) }\n\t\t\t\t\tchecked={ isLink }\n\t\t\t\t/>\n\t\t\t</PanelBody>\n\t\t</InspectorControls>\n\t);\n\n\tif ( ! commentId || ! date ) {\n\t\tdate = _x( 'Comment Date', 'block title' );\n\t}\n\n\tlet commentDate =\n\t\tdate instanceof Date ? (\n\t\t\t<time dateTime={ dateI18n( 'c', date ) }>\n\t\t\t\t{ format === 'human-diff'\n\t\t\t\t\t? humanTimeDiff( date )\n\t\t\t\t\t: dateI18n( format || siteFormat, date ) }\n\t\t\t</time>\n\t\t) : (\n\t\t\t<time>{ date }</time>\n\t\t);\n\n\tif ( isLink ) {\n\t\tcommentDate = (\n\t\t\t<a\n\t\t\t\thref=\"#comment-date-pseudo-link\"\n\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t>\n\t\t\t\t{ commentDate }\n\t\t\t</a>\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ inspectorControls }\n\t\t\t<div { ...blockProps }>{ commentDate }</div>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,YAAA,GAAAF,OAAA;AAKA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAAyC,IAAAK,WAAA,GAAAL,OAAA;AAfzC;AACA;AACA;;AAeA;AACA;AACA;AACA;AACA;AACA;A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,CAAEE,SAAS,IAAI,CAAEI,IAAI,EAAG;IAC5BA,IAAI,GAAG,IAAAqB,QAAE,EAAE,cAAc,EAAE,aAAc,CAAC;EAC3C;EAEA,IAAIC,WAAW,GACdtB,IAAI,YAAYuB,IAAI,gBACnB,IAAAjC,WAAA,CAAAgB,GAAA;IAAMkB,QAAQ,EAAG,IAAAC,cAAQ,EAAE,GAAG,EAAEzB,IAAK,CAAG;IAAAQ,QAAA,EACrCf,MAAM,KAAK,YAAY,GACtB,IAAAiC,mBAAa,EAAE1B,IAAK,CAAC,GACrB,IAAAyB,cAAQ,EAAEhC,MAAM,IAAIS,UAAU,EAAEF,IAAK;EAAC,CACpC,CAAC,gBAEP,IAAAV,WAAA,CAAAgB,GAAA;IAAAE,QAAA,EAAQR;EAAI,CAAQ,CACpB;EAEF,IAAKN,MAAM,EAAG;IACb4B,WAAW,gBACV,IAAAhC,WAAA,CAAAgB,GAAA;MACCqB,IAAI,EAAC,2BAA2B;MAChCC,OAAO,EAAKC,KAAK,IAAMA,KAAK,CAACC,cAAc,CAAC,CAAG;MAAAtB,QAAA,EAE7Cc;IAAW,CACX,CACH;EACF;EAEA,oBACC,IAAAhC,WAAA,CAAAmB,IAAA,EAAAnB,WAAA,CAAAyC,QAAA;IAAAvB,QAAA,GACGH,iBAAiB,eACnB,IAAAf,WAAA,CAAAgB,GAAA;MAAA,GAAUR,UAAU;MAAAU,QAAA,EAAKc;IAAW,CAAO,CAAC;EAAA,CAC3C,CAAC;AAEL","ignoreList":[]}
|
|
@@ -12,7 +12,6 @@ var _compose = require("@wordpress/compose");
|
|
|
12
12
|
var _data = require("@wordpress/data");
|
|
13
13
|
var _element = require("@wordpress/element");
|
|
14
14
|
var _hooks = require("./hooks");
|
|
15
|
-
var _utils = require("./utils");
|
|
16
15
|
var _edit = require("./edit.js");
|
|
17
16
|
var _style = _interopRequireDefault(require("./style.scss"));
|
|
18
17
|
var _listStyleType = _interopRequireDefault(require("./list-style-type"));
|
|
@@ -33,7 +32,6 @@ const OPACITY = '9e';
|
|
|
33
32
|
function ListItemEdit({
|
|
34
33
|
attributes,
|
|
35
34
|
setAttributes,
|
|
36
|
-
onReplace,
|
|
37
35
|
clientId,
|
|
38
36
|
style,
|
|
39
37
|
mergeBlocks
|
|
@@ -107,18 +105,7 @@ function ListItemEdit({
|
|
|
107
105
|
content,
|
|
108
106
|
clientId
|
|
109
107
|
}, preventDefault);
|
|
110
|
-
const onSplit = (0, _hooks.useSplit)(clientId);
|
|
111
108
|
const onMerge = (0, _hooks.useMerge)(clientId, mergeBlocks);
|
|
112
|
-
const onSplitList = (0, _element.useCallback)(value => {
|
|
113
|
-
if (!preventDefault.current) {
|
|
114
|
-
return onSplit(value);
|
|
115
|
-
}
|
|
116
|
-
}, [clientId, onSplit]);
|
|
117
|
-
const onReplaceList = (0, _element.useCallback)((blocks, ...args) => {
|
|
118
|
-
if (!preventDefault.current) {
|
|
119
|
-
onReplace((0, _utils.convertToListItems)(blocks), ...args);
|
|
120
|
-
}
|
|
121
|
-
}, [clientId, onReplace, _utils.convertToListItems]);
|
|
122
109
|
const onLayout = (0, _element.useCallback)(({
|
|
123
110
|
nativeEvent
|
|
124
111
|
}) => {
|
|
@@ -151,6 +138,7 @@ function ListItemEdit({
|
|
|
151
138
|
style: _style.default['wp-block-list-item__list-item-content'],
|
|
152
139
|
onLayout: onLayout,
|
|
153
140
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.RichText, {
|
|
141
|
+
__unstableUseSplitSelection: true,
|
|
154
142
|
identifier: "content",
|
|
155
143
|
tagName: "p",
|
|
156
144
|
onChange: nextContent => setAttributes({
|
|
@@ -159,9 +147,7 @@ function ListItemEdit({
|
|
|
159
147
|
value: content,
|
|
160
148
|
placeholder: placeholder || (0, _i18n.__)('List'),
|
|
161
149
|
placeholderTextColor: defaultPlaceholderTextColorWithOpacity,
|
|
162
|
-
onSplit: onSplitList,
|
|
163
150
|
onMerge: onMerge,
|
|
164
|
-
onReplace: onReplaceList,
|
|
165
151
|
onEnter: onEnter,
|
|
166
152
|
style: styleWithPlaceholderOpacity,
|
|
167
153
|
deleteEnter: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_blockEditor","_i18n","_compose","_data","_element","_hooks","_utils","_edit","_style","_interopRequireDefault","_listStyleType","_jsxRuntime","OPACITY","ListItemEdit","attributes","setAttributes","onReplace","clientId","style","mergeBlocks","contentWidth","setContentWidth","useState","placeholder","content","blockIndex","hasInnerBlocks","indentationLevel","numberOfListItems","ordered","reversed","start","useSelect","select","getBlockAttributes","getBlockCount","getBlockIndex","getBlockParentsByBlockName","getBlockRootClientId","blockEditorStore","currentIdentationLevel","length","currentBlockIndex","blockWithInnerBlocks","rootClientId","blockAttributes","totalListItems","isOrdered","isReversed","startValue","blockProps","useBlockProps","styles","innerBlocksProps","useInnerBlocksProps","renderAppender","defaultPlaceholderFromScheme","usePreferredColorSchemeStyle","currentTextColor","color","baseColors","text","defaultPlaceholderTextColor","defaultPlaceholderTextColorWithOpacity","styleWithPlaceholderOpacity","placeholderColor","preventDefault","useRef","onEnter","useEnter","onSplit","useSplit","onMerge","useMerge","onSplitList","useCallback","value","current","onReplaceList","blocks","args","convertToListItems","onLayout","nativeEvent","prevState","width","layout","Math","floor","jsxs","View","children","jsx","default","RichText","identifier","tagName","onChange","nextContent","__","placeholderTextColor","deleteEnter","containerWidth","BlockControls","group","IndentUI"],"sources":["@wordpress/block-library/src/list-item/edit.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tRichText,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tBlockControls,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { useState, useCallback, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useSplit, useMerge, useEnter } from './hooks';\nimport { convertToListItems } from './utils';\nimport { IndentUI } from './edit.js';\nimport styles from './style.scss';\nimport ListStyleType from './list-style-type';\n\nconst OPACITY = '9e';\n\nexport default function ListItemEdit( {\n\tattributes,\n\tsetAttributes,\n\tonReplace,\n\tclientId,\n\tstyle,\n\tmergeBlocks,\n} ) {\n\tconst [ contentWidth, setContentWidth ] = useState();\n\tconst { placeholder, content } = attributes;\n\tconst {\n\t\tblockIndex,\n\t\thasInnerBlocks,\n\t\tindentationLevel,\n\t\tnumberOfListItems,\n\t\tordered,\n\t\treversed,\n\t\tstart,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockAttributes,\n\t\t\t\tgetBlockCount,\n\t\t\t\tgetBlockIndex,\n\t\t\t\tgetBlockParentsByBlockName,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst currentIdentationLevel = getBlockParentsByBlockName(\n\t\t\t\tclientId,\n\t\t\t\t'core/list-item',\n\t\t\t\ttrue\n\t\t\t).length;\n\t\t\tconst currentBlockIndex = getBlockIndex( clientId );\n\t\t\tconst blockWithInnerBlocks = getBlockCount( clientId ) > 0;\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\tconst blockAttributes = getBlockAttributes( rootClientId );\n\t\t\tconst totalListItems = getBlockCount( rootClientId );\n\t\t\tconst {\n\t\t\t\tordered: isOrdered,\n\t\t\t\treversed: isReversed,\n\t\t\t\tstart: startValue,\n\t\t\t} = blockAttributes || {};\n\n\t\t\treturn {\n\t\t\t\tblockIndex: currentBlockIndex,\n\t\t\t\thasInnerBlocks: blockWithInnerBlocks,\n\t\t\t\tindentationLevel: currentIdentationLevel,\n\t\t\t\tnumberOfListItems: totalListItems,\n\t\t\t\tordered: isOrdered,\n\t\t\t\treversed: isReversed,\n\t\t\t\tstart: startValue,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst blockProps = useBlockProps( {\n\t\t...( hasInnerBlocks && styles[ 'wp-block-list-item__nested-blocks' ] ),\n\t} );\n\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\trenderAppender: false,\n\t} );\n\n\t// Set default placeholder text color from light/dark scheme or base colors\n\tconst defaultPlaceholderFromScheme = usePreferredColorSchemeStyle(\n\t\tstyles[ 'wp-block-list-item__list-item-placeholder' ],\n\t\tstyles[ 'wp-block-list-item__list-item-placeholder--dark' ]\n\t);\n\n\tconst currentTextColor = style?.color || style?.baseColors?.color?.text;\n\n\tconst defaultPlaceholderTextColor = currentTextColor\n\t\t? currentTextColor\n\t\t: defaultPlaceholderFromScheme?.color;\n\n\t// Add hex opacity to default placeholder text color and style object\n\tconst defaultPlaceholderTextColorWithOpacity =\n\t\tdefaultPlaceholderTextColor + OPACITY;\n\n\tconst styleWithPlaceholderOpacity = {\n\t\t...style,\n\t\t...( style?.color && {\n\t\t\tplaceholderColor: style.color + OPACITY,\n\t\t} ),\n\t};\n\n\tconst preventDefault = useRef( false );\n\tconst { onEnter } = useEnter( { content, clientId }, preventDefault );\n\tconst onSplit = useSplit( clientId );\n\tconst onMerge = useMerge( clientId, mergeBlocks );\n\tconst onSplitList = useCallback(\n\t\t( value ) => {\n\t\t\tif ( ! preventDefault.current ) {\n\t\t\t\treturn onSplit( value );\n\t\t\t}\n\t\t},\n\t\t[ clientId, onSplit ]\n\t);\n\tconst onReplaceList = useCallback(\n\t\t( blocks, ...args ) => {\n\t\t\tif ( ! preventDefault.current ) {\n\t\t\t\tonReplace( convertToListItems( blocks ), ...args );\n\t\t\t}\n\t\t},\n\t\t[ clientId, onReplace, convertToListItems ]\n\t);\n\tconst onLayout = useCallback( ( { nativeEvent } ) => {\n\t\tsetContentWidth( ( prevState ) => {\n\t\t\tconst { width } = nativeEvent.layout;\n\n\t\t\tif ( ! prevState || prevState.width !== width ) {\n\t\t\t\treturn Math.floor( width );\n\t\t\t}\n\t\t\treturn prevState;\n\t\t} );\n\t}, [] );\n\n\treturn (\n\t\t<View style={ styles[ 'wp-block-list-item__list-item-parent' ] }>\n\t\t\t<View style={ styles[ 'wp-block-list-item__list-item' ] }>\n\t\t\t\t<View style={ styles[ 'wp-block-list-item__list-item-icon' ] }>\n\t\t\t\t\t<ListStyleType\n\t\t\t\t\t\tblockIndex={ blockIndex }\n\t\t\t\t\t\tindentationLevel={ indentationLevel }\n\t\t\t\t\t\tnumberOfListItems={ numberOfListItems }\n\t\t\t\t\t\tordered={ ordered }\n\t\t\t\t\t\treversed={ reversed }\n\t\t\t\t\t\tstart={ start }\n\t\t\t\t\t\tstyle={ style }\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t\t<View\n\t\t\t\t\tstyle={ styles[ 'wp-block-list-item__list-item-content' ] }\n\t\t\t\t\tonLayout={ onLayout }\n\t\t\t\t>\n\t\t\t\t\t<RichText\n\t\t\t\t\t\tidentifier=\"content\"\n\t\t\t\t\t\ttagName=\"p\"\n\t\t\t\t\t\tonChange={ ( nextContent ) =>\n\t\t\t\t\t\t\tsetAttributes( { content: nextContent } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalue={ content }\n\t\t\t\t\t\tplaceholder={ placeholder || __( 'List' ) }\n\t\t\t\t\t\tplaceholderTextColor={\n\t\t\t\t\t\t\tdefaultPlaceholderTextColorWithOpacity\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonSplit={ onSplitList }\n\t\t\t\t\t\tonMerge={ onMerge }\n\t\t\t\t\t\tonReplace={ onReplaceList }\n\t\t\t\t\t\tonEnter={ onEnter }\n\t\t\t\t\t\tstyle={ styleWithPlaceholderOpacity }\n\t\t\t\t\t\tdeleteEnter\n\t\t\t\t\t\tcontainerWidth={ contentWidth }\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t</View>\n\t\t\t<View { ...innerBlocksProps }></View>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<IndentUI clientId={ clientId } />\n\t\t\t</BlockControls>\n\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AAa;UACvBF,OAAO,EAAGA,OAAS;UACnBxD,SAAS,EAAG8D,aAAe;UAC3BV,OAAO,EAAGA,OAAS;UACnBlD,KAAK,EAAG8C,2BAA6B;UACrCqC,WAAW;UACXC,cAAc,EAAGlF;QAAc,CAC/B;MAAC,CACG,CAAC;IAAA,CACF,CAAC,eACP,IAAAT,WAAA,CAAAiF,GAAA,EAAC9F,YAAA,CAAA4F,IAAI;MAAA,GAAMrC;IAAgB,CAAS,CAAC,eACrC,IAAA1C,WAAA,CAAAiF,GAAA,EAAC5F,YAAA,CAAAuG,aAAa;MAACC,KAAK,EAAC,OAAO;MAAAb,QAAA,eAC3B,IAAAhF,WAAA,CAAAiF,GAAA,EAACrF,KAAA,CAAAkG,QAAQ;QAACxF,QAAQ,EAAGA;MAAU,CAAE;IAAC,CACpB,CAAC;EAAA,CACX,CAAC;AAET","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_blockEditor","_i18n","_compose","_data","_element","_hooks","_edit","_style","_interopRequireDefault","_listStyleType","_jsxRuntime","OPACITY","ListItemEdit","attributes","setAttributes","clientId","style","mergeBlocks","contentWidth","setContentWidth","useState","placeholder","content","blockIndex","hasInnerBlocks","indentationLevel","numberOfListItems","ordered","reversed","start","useSelect","select","getBlockAttributes","getBlockCount","getBlockIndex","getBlockParentsByBlockName","getBlockRootClientId","blockEditorStore","currentIdentationLevel","length","currentBlockIndex","blockWithInnerBlocks","rootClientId","blockAttributes","totalListItems","isOrdered","isReversed","startValue","blockProps","useBlockProps","styles","innerBlocksProps","useInnerBlocksProps","renderAppender","defaultPlaceholderFromScheme","usePreferredColorSchemeStyle","currentTextColor","color","baseColors","text","defaultPlaceholderTextColor","defaultPlaceholderTextColorWithOpacity","styleWithPlaceholderOpacity","placeholderColor","preventDefault","useRef","onEnter","useEnter","onMerge","useMerge","onLayout","useCallback","nativeEvent","prevState","width","layout","Math","floor","jsxs","View","children","jsx","default","RichText","__unstableUseSplitSelection","identifier","tagName","onChange","nextContent","value","__","placeholderTextColor","deleteEnter","containerWidth","BlockControls","group","IndentUI"],"sources":["@wordpress/block-library/src/list-item/edit.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tRichText,\n\tuseBlockProps,\n\tuseInnerBlocksProps,\n\tBlockControls,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\nimport { usePreferredColorSchemeStyle } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { useState, useCallback, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { useMerge, useEnter } from './hooks';\nimport { IndentUI } from './edit.js';\nimport styles from './style.scss';\nimport ListStyleType from './list-style-type';\n\nconst OPACITY = '9e';\n\nexport default function ListItemEdit( {\n\tattributes,\n\tsetAttributes,\n\tclientId,\n\tstyle,\n\tmergeBlocks,\n} ) {\n\tconst [ contentWidth, setContentWidth ] = useState();\n\tconst { placeholder, content } = attributes;\n\tconst {\n\t\tblockIndex,\n\t\thasInnerBlocks,\n\t\tindentationLevel,\n\t\tnumberOfListItems,\n\t\tordered,\n\t\treversed,\n\t\tstart,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockAttributes,\n\t\t\t\tgetBlockCount,\n\t\t\t\tgetBlockIndex,\n\t\t\t\tgetBlockParentsByBlockName,\n\t\t\t\tgetBlockRootClientId,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst currentIdentationLevel = getBlockParentsByBlockName(\n\t\t\t\tclientId,\n\t\t\t\t'core/list-item',\n\t\t\t\ttrue\n\t\t\t).length;\n\t\t\tconst currentBlockIndex = getBlockIndex( clientId );\n\t\t\tconst blockWithInnerBlocks = getBlockCount( clientId ) > 0;\n\t\t\tconst rootClientId = getBlockRootClientId( clientId );\n\t\t\tconst blockAttributes = getBlockAttributes( rootClientId );\n\t\t\tconst totalListItems = getBlockCount( rootClientId );\n\t\t\tconst {\n\t\t\t\tordered: isOrdered,\n\t\t\t\treversed: isReversed,\n\t\t\t\tstart: startValue,\n\t\t\t} = blockAttributes || {};\n\n\t\t\treturn {\n\t\t\t\tblockIndex: currentBlockIndex,\n\t\t\t\thasInnerBlocks: blockWithInnerBlocks,\n\t\t\t\tindentationLevel: currentIdentationLevel,\n\t\t\t\tnumberOfListItems: totalListItems,\n\t\t\t\tordered: isOrdered,\n\t\t\t\treversed: isReversed,\n\t\t\t\tstart: startValue,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst blockProps = useBlockProps( {\n\t\t...( hasInnerBlocks && styles[ 'wp-block-list-item__nested-blocks' ] ),\n\t} );\n\n\tconst innerBlocksProps = useInnerBlocksProps( blockProps, {\n\t\trenderAppender: false,\n\t} );\n\n\t// Set default placeholder text color from light/dark scheme or base colors\n\tconst defaultPlaceholderFromScheme = usePreferredColorSchemeStyle(\n\t\tstyles[ 'wp-block-list-item__list-item-placeholder' ],\n\t\tstyles[ 'wp-block-list-item__list-item-placeholder--dark' ]\n\t);\n\n\tconst currentTextColor = style?.color || style?.baseColors?.color?.text;\n\n\tconst defaultPlaceholderTextColor = currentTextColor\n\t\t? currentTextColor\n\t\t: defaultPlaceholderFromScheme?.color;\n\n\t// Add hex opacity to default placeholder text color and style object\n\tconst defaultPlaceholderTextColorWithOpacity =\n\t\tdefaultPlaceholderTextColor + OPACITY;\n\n\tconst styleWithPlaceholderOpacity = {\n\t\t...style,\n\t\t...( style?.color && {\n\t\t\tplaceholderColor: style.color + OPACITY,\n\t\t} ),\n\t};\n\n\tconst preventDefault = useRef( false );\n\tconst { onEnter } = useEnter( { content, clientId }, preventDefault );\n\tconst onMerge = useMerge( clientId, mergeBlocks );\n\tconst onLayout = useCallback( ( { nativeEvent } ) => {\n\t\tsetContentWidth( ( prevState ) => {\n\t\t\tconst { width } = nativeEvent.layout;\n\n\t\t\tif ( ! prevState || prevState.width !== width ) {\n\t\t\t\treturn Math.floor( width );\n\t\t\t}\n\t\t\treturn prevState;\n\t\t} );\n\t}, [] );\n\n\treturn (\n\t\t<View style={ styles[ 'wp-block-list-item__list-item-parent' ] }>\n\t\t\t<View style={ styles[ 'wp-block-list-item__list-item' ] }>\n\t\t\t\t<View style={ styles[ 'wp-block-list-item__list-item-icon' ] }>\n\t\t\t\t\t<ListStyleType\n\t\t\t\t\t\tblockIndex={ blockIndex }\n\t\t\t\t\t\tindentationLevel={ indentationLevel }\n\t\t\t\t\t\tnumberOfListItems={ numberOfListItems }\n\t\t\t\t\t\tordered={ ordered }\n\t\t\t\t\t\treversed={ reversed }\n\t\t\t\t\t\tstart={ start }\n\t\t\t\t\t\tstyle={ style }\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t\t<View\n\t\t\t\t\tstyle={ styles[ 'wp-block-list-item__list-item-content' ] }\n\t\t\t\t\tonLayout={ onLayout }\n\t\t\t\t>\n\t\t\t\t\t<RichText\n\t\t\t\t\t\t__unstableUseSplitSelection\n\t\t\t\t\t\tidentifier=\"content\"\n\t\t\t\t\t\ttagName=\"p\"\n\t\t\t\t\t\tonChange={ ( nextContent ) =>\n\t\t\t\t\t\t\tsetAttributes( { content: nextContent } )\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvalue={ content }\n\t\t\t\t\t\tplaceholder={ placeholder || __( 'List' ) }\n\t\t\t\t\t\tplaceholderTextColor={\n\t\t\t\t\t\t\tdefaultPlaceholderTextColorWithOpacity\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonMerge={ onMerge }\n\t\t\t\t\t\tonEnter={ onEnter }\n\t\t\t\t\t\tstyle={ styleWithPlaceholderOpacity }\n\t\t\t\t\t\tdeleteEnter\n\t\t\t\t\t\tcontainerWidth={ contentWidth }\n\t\t\t\t\t/>\n\t\t\t\t</View>\n\t\t\t</View>\n\t\t\t<View { ...innerBlocksProps }></View>\n\t\t\t<BlockControls group=\"block\">\n\t\t\t\t<IndentUI clientId={ clientId } />\n\t\t\t</Block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
|
var _blockEditor = require("@wordpress/block-editor");
|
|
19
19
|
var _notices = require("@wordpress/notices");
|
|
20
|
+
var _reactNativeBridge = require("@wordpress/react-native-bridge");
|
|
20
21
|
var _style = _interopRequireDefault(require("./style.scss"));
|
|
21
22
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
22
23
|
/**
|
|
@@ -47,10 +48,32 @@ class UnsupportedBlockEdit extends _element.Component {
|
|
|
47
48
|
this.onHelpButtonPressed = this.onHelpButtonPressed.bind(this);
|
|
48
49
|
}
|
|
49
50
|
toggleSheet() {
|
|
51
|
+
const {
|
|
52
|
+
attributes,
|
|
53
|
+
block,
|
|
54
|
+
clientId
|
|
55
|
+
} = this.props;
|
|
56
|
+
const {
|
|
57
|
+
originalName
|
|
58
|
+
} = attributes;
|
|
59
|
+
const title = this.getTitle();
|
|
60
|
+
const blockContent = (0, _blocks.serialize)(block ? [block] : []);
|
|
61
|
+
if (this.canEditUnsupportedBlock()) {
|
|
62
|
+
(0, _reactNativeBridge.requestUnsupportedBlockFallback)(blockContent, clientId, originalName, title);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
50
65
|
this.setState({
|
|
51
66
|
showHelp: !this.state.showHelp
|
|
52
67
|
});
|
|
53
68
|
}
|
|
69
|
+
canEditUnsupportedBlock() {
|
|
70
|
+
const {
|
|
71
|
+
canEnableUnsupportedBlockEditor,
|
|
72
|
+
isEditableInUnsupportedBlockEditor,
|
|
73
|
+
isUnsupportedBlockEditorSupported
|
|
74
|
+
} = this.props;
|
|
75
|
+
return !canEnableUnsupportedBlockEditor && isUnsupportedBlockEditorSupported && isEditableInUnsupportedBlockEditor;
|
|
76
|
+
}
|
|
54
77
|
closeSheet() {
|
|
55
78
|
this.setState({
|
|
56
79
|
showHelp: false
|
|
@@ -152,6 +175,7 @@ class UnsupportedBlockEdit extends _element.Component {
|
|
|
152
175
|
originalName
|
|
153
176
|
} = this.props.attributes;
|
|
154
177
|
const {
|
|
178
|
+
isSelected,
|
|
155
179
|
getStylesFromColorScheme,
|
|
156
180
|
preferredColorScheme
|
|
157
181
|
} = this.props;
|
|
@@ -161,20 +185,21 @@ class UnsupportedBlockEdit extends _element.Component {
|
|
|
161
185
|
const subTitleStyle = getStylesFromColorScheme(_style.default.unsupportedBlockSubtitle, _style.default.unsupportedBlockSubtitleDark);
|
|
162
186
|
const subtitle = /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
163
187
|
style: subTitleStyle,
|
|
164
|
-
children: (0, _i18n.__)('Unsupported')
|
|
188
|
+
children: this.canEditUnsupportedBlock() ? (0, _i18n.__)('Tap to edit') : (0, _i18n.__)('Unsupported')
|
|
165
189
|
});
|
|
166
190
|
const icon = blockType ? (0, _blocks.normalizeIconObject)(blockType.settings.icon) : _icons.plugins;
|
|
167
191
|
const iconStyle = getStylesFromColorScheme(_style.default.unsupportedBlockIcon, _style.default.unsupportedBlockIconDark);
|
|
168
192
|
const iconClassName = 'unsupported-icon' + '-' + preferredColorScheme;
|
|
169
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.
|
|
170
|
-
disabled: !
|
|
193
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TouchableOpacity, {
|
|
194
|
+
disabled: !isSelected,
|
|
195
|
+
activeOpacity: 0.5,
|
|
171
196
|
accessibilityLabel: (0, _i18n.__)('Help button'),
|
|
172
197
|
accessibilityRole: "button",
|
|
173
198
|
accessibilityHint: (0, _i18n.__)('Tap here to show help'),
|
|
174
199
|
onPress: this.toggleSheet,
|
|
175
200
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
176
201
|
style: getStylesFromColorScheme(_style.default.unsupportedBlock, _style.default.unsupportedBlockDark),
|
|
177
|
-
children: [this.renderHelpIcon(), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
202
|
+
children: [!this.canEditUnsupportedBlock() && this.renderHelpIcon(), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
178
203
|
style: _style.default.unsupportedBlockHeader,
|
|
179
204
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Icon, {
|
|
180
205
|
className: iconClassName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_components","_compose","_blockLibrary","_blocks","_element","_i18n","_icons","_data","_hooks","_blockEditor","_notices","_style","_interopRequireDefault","_jsxRuntime","UBE_INCOMPATIBLE_BLOCKS","I18N_BLOCK_SCHEMA_TITLE","EMPTY_ARRAY","UnsupportedBlockEdit","Component","constructor","props","state","showHelp","toggleSheet","bind","closeSheet","requestFallback","onHelpButtonPressed","setState","componentWillUnmount","timeout","clearTimeout","getTitle","originalName","attributes","blockType","coreBlocks","title","metadata","textdomain","_x","renderHelpIcon","infoIconStyle","getStylesFromColorScheme","styles","infoIcon","infoIconDark","jsx","TouchableOpacity","onPress","style","helpIconContainer","accessibilityLabel","__","accessibilityRole","accessibilityHint","children","Icon","className","label","icon","help","fill","color","isSelected","selectBlock","canEnableUnsupportedBlockEditor","isUnsupportedBlockEditorSupported","sendButtonPressMessage","sendFallbackMessage","renderSheet","blockTitle","blockName","block","clientId","createSuccessNotice","replaceBlocks","titleFormat","sprintf","description","applyFilters","customActions","successNotice","UnsupportedBlockDetails","showSheet","onCloseSheet","customBlockTitle","render","preferredColorScheme","titleStyle","unsupportedBlockMessage","unsupportedBlockMessageDark","subTitleStyle","unsupportedBlockSubtitle","unsupportedBlockSubtitleDark","subtitle","Text","normalizeIconObject","settings","plugins","iconStyle","unsupportedBlockIcon","unsupportedBlockIconDark","iconClassName","TouchableWithoutFeedback","disabled","jsxs","View","unsupportedBlock","unsupportedBlockDark","unsupportedBlockHeader","src","exports","_default","default","compose","withSelect","select","getBlock","getSettings","blockEditorStore","capabilities","unsupportedBlockEditor","isEditableInUnsupportedBlockEditor","includes","withDispatch","dispatch","ownProps","noticesStore","rawHandler","HTML","serialize","withPreferredColorScheme"],"sources":["@wordpress/block-library/src/missing/edit.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tView,\n\tText,\n\tTouchableWithoutFeedback,\n\tTouchableOpacity,\n} from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { Icon } from '@wordpress/components';\nimport { compose, withPreferredColorScheme } from '@wordpress/compose';\nimport { coreBlocks } from '@wordpress/block-library';\nimport { normalizeIconObject, rawHandler, serialize } from '@wordpress/blocks';\nimport { Component } from '@wordpress/element';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { help, plugins } from '@wordpress/icons';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { applyFilters } from '@wordpress/hooks';\nimport {\n\tUnsupportedBlockDetails,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\n// Blocks that can't be edited through the Unsupported block editor identified by their name.\nconst UBE_INCOMPATIBLE_BLOCKS = [ 'core/block' ];\nconst I18N_BLOCK_SCHEMA_TITLE = 'block title';\n\nconst EMPTY_ARRAY = [];\n\nexport class UnsupportedBlockEdit extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\t\tthis.state = { showHelp: false };\n\t\tthis.toggleSheet = this.toggleSheet.bind( this );\n\t\tthis.closeSheet = this.closeSheet.bind( this );\n\t\tthis.requestFallback = this.requestFallback.bind( this );\n\t\tthis.onHelpButtonPressed = this.onHelpButtonPressed.bind( this );\n\t}\n\n\ttoggleSheet() {\n\t\tthis.setState( {\n\t\t\tshowHelp: ! this.state.showHelp,\n\t\t} );\n\t}\n\n\tcloseSheet() {\n\t\tthis.setState( {\n\t\t\tshowHelp: false,\n\t\t} );\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif ( this.timeout ) {\n\t\t\tclearTimeout( this.timeout );\n\t\t}\n\t}\n\n\tgetTitle() {\n\t\tconst { originalName } = this.props.attributes;\n\t\tconst blockType = coreBlocks[ originalName ];\n\t\tconst title = blockType?.metadata.title;\n\t\tconst textdomain = blockType?.metadata.textdomain;\n\n\t\treturn title && textdomain\n\t\t\t? // eslint-disable-next-line @wordpress/i18n-no-variables, @wordpress/i18n-text-domain\n\t\t\t _x( title, I18N_BLOCK_SCHEMA_TITLE, textdomain )\n\t\t\t: originalName;\n\t}\n\n\trenderHelpIcon() {\n\t\tconst infoIconStyle = this.props.getStylesFromColorScheme(\n\t\t\tstyles.infoIcon,\n\t\t\tstyles.infoIconDark\n\t\t);\n\n\t\treturn (\n\t\t\t<TouchableOpacity\n\t\t\t\tonPress={ this.onHelpButtonPressed }\n\t\t\t\tstyle={ styles.helpIconContainer }\n\t\t\t\taccessibilityLabel={ __( 'Help button' ) }\n\t\t\t\taccessibilityRole=\"button\"\n\t\t\t\taccessibilityHint={ __( 'Tap here to show help' ) }\n\t\t\t>\n\t\t\t\t<Icon\n\t\t\t\t\tclassName=\"unsupported-icon-help\"\n\t\t\t\t\tlabel={ __( 'Help icon' ) }\n\t\t\t\t\ticon={ help }\n\t\t\t\t\tfill={ infoIconStyle.color }\n\t\t\t\t/>\n\t\t\t</TouchableOpacity>\n\t\t);\n\t}\n\n\tonHelpButtonPressed() {\n\t\tif ( ! this.props.isSelected ) {\n\t\t\tthis.props.selectBlock();\n\t\t}\n\t\tthis.toggleSheet();\n\t}\n\n\trequestFallback() {\n\t\tif (\n\t\t\tthis.props.canEnableUnsupportedBlockEditor &&\n\t\t\tthis.props.isUnsupportedBlockEditorSupported === false\n\t\t) {\n\t\t\tthis.toggleSheet();\n\t\t\tthis.setState( { sendButtonPressMessage: true } );\n\t\t} else {\n\t\t\tthis.toggleSheet();\n\t\t\tthis.setState( { sendFallbackMessage: true } );\n\t\t}\n\t}\n\n\trenderSheet( blockTitle, blockName ) {\n\t\tconst { block, clientId, createSuccessNotice, replaceBlocks } =\n\t\t\tthis.props;\n\t\tconst { showHelp } = this.state;\n\n\t\t/* translators: Missing block alert title. %s: The localized block name */\n\t\tconst titleFormat = __( \"'%s' is not fully-supported\" );\n\t\tconst title = sprintf( titleFormat, blockTitle );\n\t\tlet description = applyFilters(\n\t\t\t'native.missing_block_detail',\n\t\t\t__( 'We are working hard to add more blocks with each release.' ),\n\t\t\tblockName\n\t\t);\n\t\tlet customActions = EMPTY_ARRAY;\n\n\t\t// For Classic blocks, we offer the alternative to convert the content to blocks.\n\t\tif ( blockName === 'core/freeform' ) {\n\t\t\tdescription +=\n\t\t\t\t' ' +\n\t\t\t\t__( 'Alternatively, you can convert the content to blocks.' );\n\t\t\t/* translators: displayed right after the classic block is converted to blocks. %s: The localized classic block name */\n\t\t\tconst successNotice = __( \"'%s' block converted to blocks\" );\n\t\t\tcustomActions = [\n\t\t\t\t{\n\t\t\t\t\tlabel: __( 'Convert to blocks' ),\n\t\t\t\t\tonPress: () => {\n\t\t\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t\t\tsprintf( successNotice, blockTitle )\n\t\t\t\t\t\t);\n\t\t\t\t\t\treplaceBlocks( block );\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\n\t\treturn (\n\t\t\t<UnsupportedBlockDetails\n\t\t\t\tclientId={ clientId }\n\t\t\t\tshowSheet={ showHelp }\n\t\t\t\tonCloseSheet={ this.closeSheet }\n\t\t\t\tcustomBlockTitle={ blockTitle }\n\t\t\t\ttitle={ title }\n\t\t\t\tdescription={ description }\n\t\t\t\tcustomActions={ customActions }\n\t\t\t/>\n\t\t);\n\t}\n\n\trender() {\n\t\tconst { originalName } = this.props.attributes;\n\t\tconst { getStylesFromColorScheme, preferredColorScheme } = this.props;\n\t\tconst blockType = coreBlocks[ originalName ];\n\n\t\tconst title = this.getTitle();\n\t\tconst titleStyle = getStylesFromColorScheme(\n\t\t\tstyles.unsupportedBlockMessage,\n\t\t\tstyles.unsupportedBlockMessageDark\n\t\t);\n\n\t\tconst subTitleStyle = getStylesFromColorScheme(\n\t\t\tstyles.unsupportedBlockSubtitle,\n\t\t\tstyles.unsupportedBlockSubtitleDark\n\t\t);\n\n\t\tconst subtitle = (\n\t\t\t<Text style={ subTitleStyle }>{ __( 'Unsupported' ) }</Text>\n\t\t);\n\n\t\tconst icon = blockType\n\t\t\t? normalizeIconObject( blockType.settings.icon )\n\t\t\t: plugins;\n\t\tconst iconStyle = getStylesFromColorScheme(\n\t\t\tstyles.unsupportedBlockIcon,\n\t\t\tstyles.unsupportedBlockIconDark\n\t\t);\n\t\tconst iconClassName = 'unsupported-icon' + '-' + preferredColorScheme;\n\t\treturn (\n\t\t\t<TouchableWithoutFeedback\n\t\t\t\tdisabled={ ! this.props.isSelected }\n\t\t\t\taccessibilityLabel={ __( 'Help button' ) }\n\t\t\t\taccessibilityRole=\"button\"\n\t\t\t\taccessibilityHint={ __( 'Tap here to show help' ) }\n\t\t\t\tonPress={ this.toggleSheet }\n\t\t\t>\n\t\t\t\t<View\n\t\t\t\t\tstyle={ getStylesFromColorScheme(\n\t\t\t\t\t\tstyles.unsupportedBlock,\n\t\t\t\t\t\tstyles.unsupportedBlockDark\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t{ this.renderHelpIcon() }\n\t\t\t\t\t<View style={ styles.unsupportedBlockHeader }>\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tclassName={ iconClassName }\n\t\t\t\t\t\t\ticon={ icon && icon.src ? icon.src : icon }\n\t\t\t\t\t\t\tfill={ iconStyle.color }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Text style={ titleStyle }>{ title }</Text>\n\t\t\t\t\t</View>\n\t\t\t\t\t{ subtitle }\n\t\t\t\t\t{ this.renderSheet( title, originalName ) }\n\t\t\t\t</View>\n\t\t\t</TouchableWithoutFeedback>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select, { attributes, clientId } ) => {\n\t\tconst { getBlock, getSettings } = select( blockEditorStore );\n\t\tconst { capabilities } = getSettings();\n\t\treturn {\n\t\t\tisUnsupportedBlockEditorSupported:\n\t\t\t\tcapabilities?.unsupportedBlockEditor === true,\n\t\t\tcanEnableUnsupportedBlockEditor:\n\t\t\t\tcapabilities?.canEnableUnsupportedBlockEditor === true,\n\t\t\tisEditableInUnsupportedBlockEditor:\n\t\t\t\t! UBE_INCOMPATIBLE_BLOCKS.includes( attributes.originalName ),\n\t\t\tblock: getBlock( clientId ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, ownProps ) => {\n\t\tconst { selectBlock, replaceBlocks } = dispatch( blockEditorStore );\n\t\tconst { createSuccessNotice } = dispatch( noticesStore );\n\t\treturn {\n\t\t\tselectBlock() {\n\t\t\t\tselectBlock( ownProps.clientId );\n\t\t\t},\n\t\t\treplaceBlocks( block ) {\n\t\t\t\treplaceBlocks(\n\t\t\t\t\townProps.clientId,\n\t\t\t\t\trawHandler( { HTML: serialize( block ) } )\n\t\t\t\t);\n\t\t\t},\n\t\t\tcreateSuccessNotice,\n\t\t};\n\t} ),\n\twithPreferredColorScheme,\n] )( UnsupportedBlockEdit );\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAUA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,KAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,YAAA,GAAAV,OAAA;AAIA,IAAAW,QAAA,GAAAX,OAAA;AAKA,IAAAY,MAAA,GAAAC,sBAAA,CAAAb,OAAA;AAAkC,IAAAc,WAAA,GAAAd,OAAA;AA/BlC;AACA;AACA;;AAQA;AACA;AACA;;AAgBA;AACA;AACA;;AAGA;AACA,MAAMe,uBAAuB,GAAG,CAAE,YAAY,CAAE;AAChD,MAAMC,uBAAuB,GAAG,aAAa;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a,CAAC,GAAGF,WAAW,CAAC,CAAC;EACtC,OAAO;IACNpD,iCAAiC,EAChCsD,YAAY,EAAEC,sBAAsB,KAAK,IAAI;IAC9CxD,+BAA+B,EAC9BuD,YAAY,EAAEvD,+BAA+B,KAAK,IAAI;IACvDyD,kCAAkC,EACjC,CAAE7G,uBAAuB,CAAC8G,QAAQ,CAAE1F,UAAU,CAACD,YAAa,CAAC;IAC9DwC,KAAK,EAAE6C,QAAQ,CAAE5C,QAAS;EAC3B,CAAC;AACF,CAAE,CAAC,EACH,IAAAmD,kBAAY,EAAE,CAAEC,QAAQ,EAAEC,QAAQ,KAAM;EACvC,MAAM;IAAE9D,WAAW;IAAEW;EAAc,CAAC,GAAGkD,QAAQ,CAAEN,kBAAiB,CAAC;EACnE,MAAM;IAAE7C;EAAoB,CAAC,GAAGmD,QAAQ,CAAEE,cAAa,CAAC;EACxD,OAAO;IACN/D,WAAWA,CAAA,EAAG;MACbA,WAAW,CAAE8D,QAAQ,CAACrD,QAAS,CAAC;IACjC,CAAC;IACDE,aAAaA,CAAEH,KAAK,EAAG;MACtBG,aAAa,CACZmD,QAAQ,CAACrD,QAAQ,EACjB,IAAAuD,kBAAU,EAAE;QAAEC,IAAI,EAAE,IAAAC,iBAAS,EAAE1D,KAAM;MAAE,CAAE,CAC1C,CAAC;IACF,CAAC;IACDE;EACD,CAAC;AACF,CAAE,CAAC,EACHyD,iCAAwB,CACvB,CAAC,CAAEnH,oBAAqB,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_components","_compose","_blockLibrary","_blocks","_element","_i18n","_icons","_data","_hooks","_blockEditor","_notices","_reactNativeBridge","_style","_interopRequireDefault","_jsxRuntime","UBE_INCOMPATIBLE_BLOCKS","I18N_BLOCK_SCHEMA_TITLE","EMPTY_ARRAY","UnsupportedBlockEdit","Component","constructor","props","state","showHelp","toggleSheet","bind","closeSheet","requestFallback","onHelpButtonPressed","attributes","block","clientId","originalName","title","getTitle","blockContent","serialize","canEditUnsupportedBlock","requestUnsupportedBlockFallback","setState","canEnableUnsupportedBlockEditor","isEditableInUnsupportedBlockEditor","isUnsupportedBlockEditorSupported","componentWillUnmount","timeout","clearTimeout","blockType","coreBlocks","metadata","textdomain","_x","renderHelpIcon","infoIconStyle","getStylesFromColorScheme","styles","infoIcon","infoIconDark","jsx","TouchableOpacity","onPress","style","helpIconContainer","accessibilityLabel","__","accessibilityRole","accessibilityHint","children","Icon","className","label","icon","help","fill","color","isSelected","selectBlock","sendButtonPressMessage","sendFallbackMessage","renderSheet","blockTitle","blockName","createSuccessNotice","replaceBlocks","titleFormat","sprintf","description","applyFilters","customActions","successNotice","UnsupportedBlockDetails","showSheet","onCloseSheet","customBlockTitle","render","preferredColorScheme","titleStyle","unsupportedBlockMessage","unsupportedBlockMessageDark","subTitleStyle","unsupportedBlockSubtitle","unsupportedBlockSubtitleDark","subtitle","Text","normalizeIconObject","settings","plugins","iconStyle","unsupportedBlockIcon","unsupportedBlockIconDark","iconClassName","disabled","activeOpacity","jsxs","View","unsupportedBlock","unsupportedBlockDark","unsupportedBlockHeader","src","exports","_default","default","compose","withSelect","select","getBlock","getSettings","blockEditorStore","capabilities","unsupportedBlockEditor","includes","withDispatch","dispatch","ownProps","noticesStore","rawHandler","HTML","withPreferredColorScheme"],"sources":["@wordpress/block-library/src/missing/edit.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View, Text, TouchableOpacity } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { Icon } from '@wordpress/components';\nimport { compose, withPreferredColorScheme } from '@wordpress/compose';\nimport { coreBlocks } from '@wordpress/block-library';\nimport { normalizeIconObject, rawHandler, serialize } from '@wordpress/blocks';\nimport { Component } from '@wordpress/element';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { help, plugins } from '@wordpress/icons';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { applyFilters } from '@wordpress/hooks';\nimport {\n\tUnsupportedBlockDetails,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { requestUnsupportedBlockFallback } from '@wordpress/react-native-bridge';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\n// Blocks that can't be edited through the Unsupported block editor identified by their name.\nconst UBE_INCOMPATIBLE_BLOCKS = [ 'core/block' ];\nconst I18N_BLOCK_SCHEMA_TITLE = 'block title';\n\nconst EMPTY_ARRAY = [];\n\nexport class UnsupportedBlockEdit extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\t\tthis.state = { showHelp: false };\n\t\tthis.toggleSheet = this.toggleSheet.bind( this );\n\t\tthis.closeSheet = this.closeSheet.bind( this );\n\t\tthis.requestFallback = this.requestFallback.bind( this );\n\t\tthis.onHelpButtonPressed = this.onHelpButtonPressed.bind( this );\n\t}\n\n\ttoggleSheet() {\n\t\tconst { attributes, block, clientId } = this.props;\n\t\tconst { originalName } = attributes;\n\t\tconst title = this.getTitle();\n\t\tconst blockContent = serialize( block ? [ block ] : [] );\n\n\t\tif ( this.canEditUnsupportedBlock() ) {\n\t\t\trequestUnsupportedBlockFallback(\n\t\t\t\tblockContent,\n\t\t\t\tclientId,\n\t\t\t\toriginalName,\n\t\t\t\ttitle\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tthis.setState( {\n\t\t\tshowHelp: ! this.state.showHelp,\n\t\t} );\n\t}\n\n\tcanEditUnsupportedBlock() {\n\t\tconst {\n\t\t\tcanEnableUnsupportedBlockEditor,\n\t\t\tisEditableInUnsupportedBlockEditor,\n\t\t\tisUnsupportedBlockEditorSupported,\n\t\t} = this.props;\n\n\t\treturn (\n\t\t\t! canEnableUnsupportedBlockEditor &&\n\t\t\tisUnsupportedBlockEditorSupported &&\n\t\t\tisEditableInUnsupportedBlockEditor\n\t\t);\n\t}\n\n\tcloseSheet() {\n\t\tthis.setState( {\n\t\t\tshowHelp: false,\n\t\t} );\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif ( this.timeout ) {\n\t\t\tclearTimeout( this.timeout );\n\t\t}\n\t}\n\n\tgetTitle() {\n\t\tconst { originalName } = this.props.attributes;\n\t\tconst blockType = coreBlocks[ originalName ];\n\t\tconst title = blockType?.metadata.title;\n\t\tconst textdomain = blockType?.metadata.textdomain;\n\n\t\treturn title && textdomain\n\t\t\t? // eslint-disable-next-line @wordpress/i18n-no-variables, @wordpress/i18n-text-domain\n\t\t\t _x( title, I18N_BLOCK_SCHEMA_TITLE, textdomain )\n\t\t\t: originalName;\n\t}\n\n\trenderHelpIcon() {\n\t\tconst infoIconStyle = this.props.getStylesFromColorScheme(\n\t\t\tstyles.infoIcon,\n\t\t\tstyles.infoIconDark\n\t\t);\n\n\t\treturn (\n\t\t\t<TouchableOpacity\n\t\t\t\tonPress={ this.onHelpButtonPressed }\n\t\t\t\tstyle={ styles.helpIconContainer }\n\t\t\t\taccessibilityLabel={ __( 'Help button' ) }\n\t\t\t\taccessibilityRole=\"button\"\n\t\t\t\taccessibilityHint={ __( 'Tap here to show help' ) }\n\t\t\t>\n\t\t\t\t<Icon\n\t\t\t\t\tclassName=\"unsupported-icon-help\"\n\t\t\t\t\tlabel={ __( 'Help icon' ) }\n\t\t\t\t\ticon={ help }\n\t\t\t\t\tfill={ infoIconStyle.color }\n\t\t\t\t/>\n\t\t\t</TouchableOpacity>\n\t\t);\n\t}\n\n\tonHelpButtonPressed() {\n\t\tif ( ! this.props.isSelected ) {\n\t\t\tthis.props.selectBlock();\n\t\t}\n\t\tthis.toggleSheet();\n\t}\n\n\trequestFallback() {\n\t\tif (\n\t\t\tthis.props.canEnableUnsupportedBlockEditor &&\n\t\t\tthis.props.isUnsupportedBlockEditorSupported === false\n\t\t) {\n\t\t\tthis.toggleSheet();\n\t\t\tthis.setState( { sendButtonPressMessage: true } );\n\t\t} else {\n\t\t\tthis.toggleSheet();\n\t\t\tthis.setState( { sendFallbackMessage: true } );\n\t\t}\n\t}\n\n\trenderSheet( blockTitle, blockName ) {\n\t\tconst { block, clientId, createSuccessNotice, replaceBlocks } =\n\t\t\tthis.props;\n\t\tconst { showHelp } = this.state;\n\n\t\t/* translators: Missing block alert title. %s: The localized block name */\n\t\tconst titleFormat = __( \"'%s' is not fully-supported\" );\n\t\tconst title = sprintf( titleFormat, blockTitle );\n\t\tlet description = applyFilters(\n\t\t\t'native.missing_block_detail',\n\t\t\t__( 'We are working hard to add more blocks with each release.' ),\n\t\t\tblockName\n\t\t);\n\t\tlet customActions = EMPTY_ARRAY;\n\n\t\t// For Classic blocks, we offer the alternative to convert the content to blocks.\n\t\tif ( blockName === 'core/freeform' ) {\n\t\t\tdescription +=\n\t\t\t\t' ' +\n\t\t\t\t__( 'Alternatively, you can convert the content to blocks.' );\n\t\t\t/* translators: displayed right after the classic block is converted to blocks. %s: The localized classic block name */\n\t\t\tconst successNotice = __( \"'%s' block converted to blocks\" );\n\t\t\tcustomActions = [\n\t\t\t\t{\n\t\t\t\t\tlabel: __( 'Convert to blocks' ),\n\t\t\t\t\tonPress: () => {\n\t\t\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t\t\tsprintf( successNotice, blockTitle )\n\t\t\t\t\t\t);\n\t\t\t\t\t\treplaceBlocks( block );\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\n\t\treturn (\n\t\t\t<UnsupportedBlockDetails\n\t\t\t\tclientId={ clientId }\n\t\t\t\tshowSheet={ showHelp }\n\t\t\t\tonCloseSheet={ this.closeSheet }\n\t\t\t\tcustomBlockTitle={ blockTitle }\n\t\t\t\ttitle={ title }\n\t\t\t\tdescription={ description }\n\t\t\t\tcustomActions={ customActions }\n\t\t\t/>\n\t\t);\n\t}\n\n\trender() {\n\t\tconst { originalName } = this.props.attributes;\n\t\tconst { isSelected, getStylesFromColorScheme, preferredColorScheme } =\n\t\t\tthis.props;\n\t\tconst blockType = coreBlocks[ originalName ];\n\n\t\tconst title = this.getTitle();\n\t\tconst titleStyle = getStylesFromColorScheme(\n\t\t\tstyles.unsupportedBlockMessage,\n\t\t\tstyles.unsupportedBlockMessageDark\n\t\t);\n\n\t\tconst subTitleStyle = getStylesFromColorScheme(\n\t\t\tstyles.unsupportedBlockSubtitle,\n\t\t\tstyles.unsupportedBlockSubtitleDark\n\t\t);\n\n\t\tconst subtitle = (\n\t\t\t<Text style={ subTitleStyle }>\n\t\t\t\t{ this.canEditUnsupportedBlock()\n\t\t\t\t\t? __( 'Tap to edit' )\n\t\t\t\t\t: __( 'Unsupported' ) }\n\t\t\t</Text>\n\t\t);\n\n\t\tconst icon = blockType\n\t\t\t? normalizeIconObject( blockType.settings.icon )\n\t\t\t: plugins;\n\t\tconst iconStyle = getStylesFromColorScheme(\n\t\t\tstyles.unsupportedBlockIcon,\n\t\t\tstyles.unsupportedBlockIconDark\n\t\t);\n\t\tconst iconClassName = 'unsupported-icon' + '-' + preferredColorScheme;\n\t\treturn (\n\t\t\t<TouchableOpacity\n\t\t\t\tdisabled={ ! isSelected }\n\t\t\t\tactiveOpacity={ 0.5 }\n\t\t\t\taccessibilityLabel={ __( 'Help button' ) }\n\t\t\t\taccessibilityRole=\"button\"\n\t\t\t\taccessibilityHint={ __( 'Tap here to show help' ) }\n\t\t\t\tonPress={ this.toggleSheet }\n\t\t\t>\n\t\t\t\t<View\n\t\t\t\t\tstyle={ getStylesFromColorScheme(\n\t\t\t\t\t\tstyles.unsupportedBlock,\n\t\t\t\t\t\tstyles.unsupportedBlockDark\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t{ ! this.canEditUnsupportedBlock() &&\n\t\t\t\t\t\tthis.renderHelpIcon() }\n\t\t\t\t\t<View style={ styles.unsupportedBlockHeader }>\n\t\t\t\t\t\t<Icon\n\t\t\t\t\t\t\tclassName={ iconClassName }\n\t\t\t\t\t\t\ticon={ icon && icon.src ? icon.src : icon }\n\t\t\t\t\t\t\tfill={ iconStyle.color }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Text style={ titleStyle }>{ title }</Text>\n\t\t\t\t\t</View>\n\t\t\t\t\t{ subtitle }\n\t\t\t\t\t{ this.renderSheet( title, originalName ) }\n\t\t\t\t</View>\n\t\t\t</TouchableOpacity>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select, { attributes, clientId } ) => {\n\t\tconst { getBlock, getSettings } = select( blockEditorStore );\n\t\tconst { capabilities } = getSettings();\n\t\treturn {\n\t\t\tisUnsupportedBlockEditorSupported:\n\t\t\t\tcapabilities?.unsupportedBlockEditor === true,\n\t\t\tcanEnableUnsupportedBlockEditor:\n\t\t\t\tcapabilities?.canEnableUnsupportedBlockEditor === true,\n\t\t\tisEditableInUnsupportedBlockEditor:\n\t\t\t\t! UBE_INCOMPATIBLE_BLOCKS.includes( attributes.originalName ),\n\t\t\tblock: getBlock( clientId ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, ownProps ) => {\n\t\tconst { selectBlock, replaceBlocks } = dispatch( blockEditorStore );\n\t\tconst { createSuccessNotice } = dispatch( noticesStore );\n\t\treturn {\n\t\t\tselectBlock() {\n\t\t\t\tselectBlock( ownProps.clientId );\n\t\t\t},\n\t\t\treplaceBlocks( block ) {\n\t\t\t\treplaceBlocks(\n\t\t\t\t\townProps.clientId,\n\t\t\t\t\trawHandler( { HTML: serialize( block ) } )\n\t\t\t\t);\n\t\t\t},\n\t\t\tcreateSuccessNotice,\n\t\t};\n\t} ),\n\twithPreferredColorScheme,\n] )( UnsupportedBlockEdit );\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,KAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,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,kCAAkC,EACjC,CAAE1B,uBAAuB,CAACkH,QAAQ,CAAEpG,UAAU,CAACG,YAAa,CAAC;IAC9DF,KAAK,EAAE8F,QAAQ,CAAE7F,QAAS;EAC3B,CAAC;AACF,CAAE,CAAC,EACH,IAAAmG,kBAAY,EAAE,CAAEC,QAAQ,EAAEC,QAAQ,KAAM;EACvC,MAAM;IAAEzD,WAAW;IAAEO;EAAc,CAAC,GAAGiD,QAAQ,CAAEL,kBAAiB,CAAC;EACnE,MAAM;IAAE7C;EAAoB,CAAC,GAAGkD,QAAQ,CAAEE,cAAa,CAAC;EACxD,OAAO;IACN1D,WAAWA,CAAA,EAAG;MACbA,WAAW,CAAEyD,QAAQ,CAACrG,QAAS,CAAC;IACjC,CAAC;IACDmD,aAAaA,CAAEpD,KAAK,EAAG;MACtBoD,aAAa,CACZkD,QAAQ,CAACrG,QAAQ,EACjB,IAAAuG,kBAAU,EAAE;QAAEC,IAAI,EAAE,IAAAnG,iBAAS,EAAEN,KAAM;MAAE,CAAE,CAC1C,CAAC;IACF,CAAC;IACDmD;EACD,CAAC;AACF,CAAE,CAAC,EACHuD,iCAAwB,CACvB,CAAC,CAAEtH,oBAAqB,CAAC","ignoreList":[]}
|
|
@@ -27,11 +27,23 @@ const metadata = exports.metadata = {
|
|
|
27
27
|
align: ["wide", "full"],
|
|
28
28
|
html: false,
|
|
29
29
|
layout: true,
|
|
30
|
+
background: {
|
|
31
|
+
backgroundImage: true,
|
|
32
|
+
backgroundSize: true,
|
|
33
|
+
__experimentalDefaultControls: {
|
|
34
|
+
backgroundImage: true
|
|
35
|
+
}
|
|
36
|
+
},
|
|
30
37
|
dimensions: {
|
|
31
38
|
minHeight: true
|
|
32
39
|
},
|
|
33
40
|
spacing: {
|
|
34
|
-
blockGap: true
|
|
41
|
+
blockGap: true,
|
|
42
|
+
padding: true,
|
|
43
|
+
__experimentalDefaultControls: {
|
|
44
|
+
margin: false,
|
|
45
|
+
padding: false
|
|
46
|
+
}
|
|
35
47
|
},
|
|
36
48
|
color: {
|
|
37
49
|
gradients: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_icons","require","_initBlock","_interopRequireDefault","_edit","metadata","exports","$schema","apiVersion","name","title","category","description","textdomain","usesContext","supports","align","html","layout","dimensions","minHeight","spacing","blockGap","
|
|
1
|
+
{"version":3,"names":["_icons","require","_initBlock","_interopRequireDefault","_edit","metadata","exports","$schema","apiVersion","name","title","category","description","textdomain","usesContext","supports","align","html","layout","background","backgroundImage","backgroundSize","__experimentalDefaultControls","dimensions","minHeight","spacing","blockGap","padding","margin","color","gradients","link","text","typography","fontSize","lineHeight","__experimentalFontFamily","__experimentalFontWeight","__experimentalFontStyle","__experimentalTextTransform","__experimentalTextDecoration","__experimentalLetterSpacing","editorStyle","settings","icon","edit","init","initBlock"],"sources":["@wordpress/block-library/src/post-content/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { postContent as icon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport initBlock from '../utils/init-block';\nimport metadata from './block.json';\nimport edit from './edit';\n\nconst { name } = metadata;\nexport { metadata, name };\n\nexport const settings = {\n\ticon,\n\tedit,\n};\n\nexport const init = () => initBlock( { name, metadata, settings } );\n"],"mappings":";;;;;;;AAGA,IAAAA,MAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAD,sBAAA,CAAAF,OAAA;AAVA;AACA;AACA;AAGA;AACA;AACA;AAFA,MAAAI,QAAA,GAAAC,OAAA,CAAAD,QAAA;EAAAE,OAAA;EAAAC,UAAA;EAAAC,IAAA;EAAAC,KAAA;EAAAC,QAAA;EAAAC,WAAA;EAAAC,UAAA;EAAAC,WAAA;EAAAC,QAAA;IAAAC,KAAA;IAAAC,IAAA;IAAAC,MAAA;IAAAC,UAAA;MAAAC,eAAA;MAAAC,cAAA;MAAAC,6BAAA;QAAAF,eAAA;MAAA;IAAA;IAAAG,UAAA;MAAAC,SAAA;IAAA;IAAAC,OAAA;MAAAC,QAAA;MAAAC,OAAA;MAAAL,6BAAA;QAAAM,MAAA;QAAAD,OAAA;MAAA;IAAA;IAAAE,KAAA;MAAAC,SAAA;MAAAC,IAAA;MAAAT,6BAAA;QAAAH,UAAA;QAAAa,IAAA;MAAA;IAAA;IAAAC,UAAA;MAAAC,QAAA;MAAAC,UAAA;MAAAC,wBAAA;MAAAC,wBAAA;MAAAC,uBAAA;MAAAC,2BAAA;MAAAC,4BAAA;MAAAC,2BAAA;MAAAnB,6BAAA;QAAAY,QAAA;MAAA;IAAA;EAAA;EAAAQ,WAAA;AAAA;AAOA,MAAM;EAAEjC;AAAK,CAAC,GAAGJ,QAAQ;AAACC,OAAA,CAAAG,IAAA,GAAAA,IAAA;AAGnB,MAAMkC,QAAQ,GAAArC,OAAA,CAAAqC,QAAA,GAAG;EACvBC,IAAI,EAAJA,kBAAI;EACJC,IAAI,EAAJA;AACD,CAAC;AAEM,MAAMC,IAAI,GAAGA,CAAA,KAAM,IAAAC,kBAAS,EAAE;EAAEtC,IAAI;EAAEJ,QAAQ;EAAEsC;AAAS,CAAE,CAAC;AAACrC,OAAA,CAAAwC,IAAA,GAAAA,IAAA","ignoreList":[]}
|
package/build/post-date/edit.js
CHANGED
|
@@ -63,7 +63,7 @@ function PostDateEdit({
|
|
|
63
63
|
let postDate = date ? /*#__PURE__*/(0, _jsxRuntime.jsx)("time", {
|
|
64
64
|
dateTime: (0, _date.dateI18n)('c', date),
|
|
65
65
|
ref: setPopoverAnchor,
|
|
66
|
-
children: (0, _date.dateI18n)(format || siteFormat, date)
|
|
66
|
+
children: format === 'human-diff' ? (0, _date.humanTimeDiff)(date) : (0, _date.dateI18n)(format || siteFormat, date)
|
|
67
67
|
}) : dateLabel;
|
|
68
68
|
if (isLink && date) {
|
|
69
69
|
postDate = /*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
|