@wordpress/editor 12.1.0 → 12.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 +14 -0
- package/README.md +7 -1
- package/build/components/deprecated.js +1 -3
- package/build/components/deprecated.js.map +1 -1
- package/build/components/index.js +18 -0
- package/build/components/index.js.map +1 -1
- package/build/components/post-format/index.js +6 -4
- package/build/components/post-format/index.js.map +1 -1
- package/build/components/post-taxonomies/most-used-terms.js +3 -3
- package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build/components/post-title/index.native.js +1 -0
- package/build/components/post-title/index.native.js.map +1 -1
- package/build/components/post-visibility/index.js +30 -14
- package/build/components/post-visibility/index.js.map +1 -1
- package/build/store/actions.js +19 -14
- package/build/store/actions.js.map +1 -1
- package/build/store/selectors.js +2 -32
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/deprecated.js +1 -2
- package/build-module/components/deprecated.js.map +1 -1
- package/build-module/components/index.js +2 -0
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/post-format/index.js +7 -5
- package/build-module/components/post-format/index.js.map +1 -1
- package/build-module/components/post-taxonomies/most-used-terms.js +3 -3
- package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build-module/components/post-title/index.native.js +1 -0
- package/build-module/components/post-title/index.native.js.map +1 -1
- package/build-module/components/post-visibility/index.js +31 -15
- package/build-module/components/post-visibility/index.js.map +1 -1
- package/build-module/store/actions.js +19 -14
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/selectors.js +0 -28
- package/build-module/store/selectors.js.map +1 -1
- package/package.json +27 -30
- package/src/components/deprecated.js +0 -5
- package/src/components/index.js +2 -0
- package/src/components/post-format/index.js +9 -10
- package/src/components/post-taxonomies/README.md +25 -1
- package/src/components/post-taxonomies/most-used-terms.js +3 -3
- package/src/components/post-title/index.native.js +1 -0
- package/src/components/post-visibility/index.js +25 -11
- package/src/store/actions.js +17 -23
- package/src/store/selectors.js +0 -35
- package/src/store/test/actions.js +0 -40
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 12.2.0 (2022-02-10)
|
|
6
|
+
|
|
7
|
+
### Enhancement
|
|
8
|
+
|
|
9
|
+
- Export `PostTaxonomiesFlatTermSelector` and `PostTaxonomiesHierarchicalTermSelector` components to allow using them to customize the default term selector for a taxonomy.
|
|
10
|
+
|
|
11
|
+
### Bug Fix
|
|
12
|
+
|
|
13
|
+
- Removed unused `@wordpress/autop`, `@wordpress/blob` and `@wordpress/is-shallow-equal` dependencies ([#38388](https://github.com/WordPress/gutenberg/pull/38388)).
|
|
14
|
+
|
|
15
|
+
### Deprecations
|
|
16
|
+
|
|
17
|
+
- the `createUndoLevel` and `refreshPost` actions were marked as deprecated. They were already defunct and acting as noops.
|
|
18
|
+
|
|
5
19
|
## 12.1.0 (2022-01-27)
|
|
6
20
|
|
|
7
21
|
## 12.0.0 (2021-10-12)
|
package/README.md
CHANGED
|
@@ -119,4 +119,10 @@ Example:
|
|
|
119
119
|
} )( window.wp.editor, window.wp.element );
|
|
120
120
|
```
|
|
121
121
|
|
|
122
|
-
|
|
122
|
+
## Contributing to this package
|
|
123
|
+
|
|
124
|
+
This is an individual package that's part of the Gutenberg project. The project is organized as a monorepo. It's made up of multiple self-contained software packages, each with a specific purpose. The packages in this monorepo are published to [npm](https://www.npmjs.com/) and used by [WordPress](https://make.wordpress.org/core/) as well as other software projects.
|
|
125
|
+
|
|
126
|
+
To find out more about contributing to this package or Gutenberg as a whole, please read the project's main [contributor guide](https://github.com/WordPress/gutenberg/tree/HEAD/CONTRIBUTING.md).
|
|
127
|
+
|
|
128
|
+
<br /><br /><p align="center"><img src="https://s.w.org/style/images/codeispoetry.png?1" alt="Code is Poetry." /></p>
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.RichTextToolbarButton = exports.RichTextShortcut = exports.RichText = exports.
|
|
8
|
+
exports.RichTextToolbarButton = exports.RichTextShortcut = exports.RichText = exports.PlainText = exports.PanelColorSettings = exports.ObserveTyping = exports.NavigableToolbar = exports.MultiSelectScrollIntoView = exports.MediaUploadCheck = exports.MediaUpload = exports.MediaPlaceholder = exports.InspectorControls = exports.InspectorAdvancedControls = exports.Inserter = exports.InnerBlocks = exports.FontSizePicker = exports.DefaultBlockAppender = exports.CopyHandler = exports.ContrastChecker = exports.ColorPalette = exports.BlockToolbar = exports.BlockTitle = exports.BlockSettingsMenu = exports.BlockSelectionClearer = exports.BlockNavigationDropdown = exports.BlockMover = exports.BlockList = exports.BlockInspector = exports.BlockIcon = exports.BlockFormatControls = exports.BlockEditorKeyboardShortcuts = exports.BlockEdit = exports.BlockControls = exports.BlockAlignmentToolbar = exports.Autocomplete = exports.AlignmentToolbar = void 0;
|
|
9
9
|
Object.defineProperty(exports, "ServerSideRender", {
|
|
10
10
|
enumerable: true,
|
|
11
11
|
get: function () {
|
|
@@ -135,8 +135,6 @@ const NavigableToolbar = deprecateComponent('NavigableToolbar', _blockEditor.Nav
|
|
|
135
135
|
exports.NavigableToolbar = NavigableToolbar;
|
|
136
136
|
const ObserveTyping = deprecateComponent('ObserveTyping', _blockEditor.ObserveTyping);
|
|
137
137
|
exports.ObserveTyping = ObserveTyping;
|
|
138
|
-
const PreserveScrollInReorder = deprecateComponent('PreserveScrollInReorder', _blockEditor.PreserveScrollInReorder);
|
|
139
|
-
exports.PreserveScrollInReorder = PreserveScrollInReorder;
|
|
140
138
|
const SkipToSelectedBlock = deprecateComponent('SkipToSelectedBlock', _blockEditor.SkipToSelectedBlock);
|
|
141
139
|
exports.SkipToSelectedBlock = SkipToSelectedBlock;
|
|
142
140
|
const URLInput = deprecateComponent('URLInput', _blockEditor.URLInput);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/deprecated.js"],"names":["deprecateComponent","name","Wrapped","staticsToHoist","Component","props","ref","since","alternative","version","forEach","staticName","deprecateFunction","func","RichText","RootRichText","isEmpty","Autocomplete","RootAutocomplete","AlignmentToolbar","RootAlignmentToolbar","BlockAlignmentToolbar","RootBlockAlignmentToolbar","BlockControls","RootBlockControls","BlockEdit","RootBlockEdit","BlockEditorKeyboardShortcuts","RootBlockEditorKeyboardShortcuts","BlockFormatControls","RootBlockFormatControls","BlockIcon","RootBlockIcon","BlockInspector","RootBlockInspector","BlockList","RootBlockList","BlockMover","RootBlockMover","BlockNavigationDropdown","RootBlockNavigationDropdown","BlockSelectionClearer","RootBlockSelectionClearer","BlockSettingsMenu","RootBlockSettingsMenu","BlockTitle","RootBlockTitle","BlockToolbar","RootBlockToolbar","ColorPalette","RootColorPalette","ContrastChecker","RootContrastChecker","CopyHandler","RootCopyHandler","DefaultBlockAppender","RootDefaultBlockAppender","FontSizePicker","RootFontSizePicker","Inserter","RootInserter","InnerBlocks","RootInnerBlocks","InspectorAdvancedControls","RootInspectorAdvancedControls","InspectorControls","RootInspectorControls","PanelColorSettings","RootPanelColorSettings","PlainText","RootPlainText","RichTextShortcut","RootRichTextShortcut","RichTextToolbarButton","RootRichTextToolbarButton","__unstableRichTextInputEvent","__unstableRootRichTextInputEvent","MediaPlaceholder","RootMediaPlaceholder","MediaUpload","RootMediaUpload","MediaUploadCheck","RootMediaUploadCheck","MultiSelectScrollIntoView","RootMultiSelectScrollIntoView","NavigableToolbar","RootNavigableToolbar","ObserveTyping","RootObserveTyping","PreserveScrollInReorder","RootPreserveScrollInReorder","SkipToSelectedBlock","RootSkipToSelectedBlock","URLInput","RootURLInput","URLInputButton","RootURLInputButton","URLPopover","RootURLPopover","Warning","RootWarning","WritingFlow","RootWritingFlow","createCustomColorsHOC","rootCreateCustomColorsHOC","getColorClassName","rootGetColorClassName","getColorObjectByAttributeValues","rootGetColorObjectByAttributeValues","getColorObjectByColorValue","rootGetColorObjectByColorValue","getFontSize","rootGetFontSize","getFontSizeClass","rootGetFontSizeClass","withColorContext","rootWithColorContext","withColors","rootWithColors","withFontSizes","rootWithFontSizes"],"mappings":";;;;;;;;;;;;;;;;AAKA;;;;AADA;;AAEA;;AAwDA;;AA9DA;;AACA;AACA;AACA;AA6DA,SAASA,kBAAT,CAA6BC,IAA7B,EAAmCC,OAAnC,EAAkE;AAAA,MAAtBC,cAAsB,uEAAL,EAAK;AACjE,QAAMC,SAAS,GAAG,yBAAY,CAAEC,KAAF,EAASC,GAAT,KAAkB;AAC/C,6BAAY,eAAeL,IAA3B,EAAiC;AAChCM,MAAAA,KAAK,EAAE,KADyB;AAEhCC,MAAAA,WAAW,EAAE,oBAAoBP,IAFD;AAGhCQ,MAAAA,OAAO,EAAE;AAHuB,KAAjC;AAMA,WAAO,4BAAC,OAAD;AAAS,MAAA,GAAG,EAAGH;AAAf,OAA0BD,KAA1B,EAAP;AACA,GARiB,CAAlB;AAUAF,EAAAA,cAAc,CAACO,OAAf,CAA0BC,UAAF,IAAkB;AACzCP,IAAAA,SAAS,CAAEO,UAAF,CAAT,GAA0BX,kBAAkB,CAC3CC,IAAI,GAAG,GAAP,GAAaU,UAD8B,EAE3CT,OAAO,CAAES,UAAF,CAFoC,CAA5C;AAIA,GALD;AAOA,SAAOP,SAAP;AACA;;AAED,SAASQ,iBAAT,CAA4BX,IAA5B,EAAkCY,IAAlC,EAAyC;AACxC,SAAO,YAAe;AACrB,6BAAY,eAAeZ,IAA3B,EAAiC;AAChCM,MAAAA,KAAK,EAAE,KADyB;AAEhCC,MAAAA,WAAW,EAAE,oBAAoBP,IAFD;AAGhCQ,MAAAA,OAAO,EAAE;AAHuB,KAAjC;AAMA,WAAOI,IAAI,CAAE,YAAF,CAAX;AACA,GARD;AASA;;AAED,MAAMC,QAAQ,GAAGd,kBAAkB,CAAE,UAAF,EAAce,qBAAd,EAA4B,CAAE,SAAF,CAA5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MC,+BAA+B,GAAG/F,iBAAiB,CAC/D,iCAD+D,EAE/DgG,4CAF+D,CAAzD;;AAIA,MAAMC,0BAA0B,GAAGjG,iBAAiB,CAC1D,4BAD0D,EAE1DkG,uCAF0D,CAApD;;AAIA,MAAMC,WAAW,GAAGnG,iBAAiB,CAAE,aAAF,EAAiBoG,wBAAjB,CAArC;;AACA,MAAMC,gBAAgB,GAAGrG,iBAAiB,CAChD,kBADgD,EAEhDsG,6BAFgD,CAA1C;;AAIA,MAAMC,gBAAgB,GAAGvG,iBAAiB,CAChD,kBADgD,EAEhDwG,6BAFgD,CAA1C;;AAIA,MAAMC,UAAU,GAAGzG,iBAAiB,CAAE,YAAF,EAAgB0G,uBAAhB,CAApC;;AACA,MAAMC,aAAa,GAAG3G,iBAAiB,CAC7C,eAD6C,EAE7C4G,0BAF6C,CAAvC","sourcesContent":["// Block Creation Components\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { forwardRef } from '@wordpress/element';\nimport {\n\tAutocomplete as RootAutocomplete,\n\tAlignmentToolbar as RootAlignmentToolbar,\n\tBlockAlignmentToolbar as RootBlockAlignmentToolbar,\n\tBlockControls as RootBlockControls,\n\tBlockEdit as RootBlockEdit,\n\tBlockEditorKeyboardShortcuts as RootBlockEditorKeyboardShortcuts,\n\tBlockFormatControls as RootBlockFormatControls,\n\tBlockIcon as RootBlockIcon,\n\tBlockInspector as RootBlockInspector,\n\tBlockList as RootBlockList,\n\tBlockMover as RootBlockMover,\n\tBlockNavigationDropdown as RootBlockNavigationDropdown,\n\tBlockSelectionClearer as RootBlockSelectionClearer,\n\tBlockSettingsMenu as RootBlockSettingsMenu,\n\tBlockTitle as RootBlockTitle,\n\tBlockToolbar as RootBlockToolbar,\n\tColorPalette as RootColorPalette,\n\tContrastChecker as RootContrastChecker,\n\tCopyHandler as RootCopyHandler,\n\tcreateCustomColorsHOC as rootCreateCustomColorsHOC,\n\tDefaultBlockAppender as RootDefaultBlockAppender,\n\tFontSizePicker as RootFontSizePicker,\n\tgetColorClassName as rootGetColorClassName,\n\tgetColorObjectByAttributeValues as rootGetColorObjectByAttributeValues,\n\tgetColorObjectByColorValue as rootGetColorObjectByColorValue,\n\tgetFontSize as rootGetFontSize,\n\tgetFontSizeClass as rootGetFontSizeClass,\n\tInserter as RootInserter,\n\tInnerBlocks as RootInnerBlocks,\n\tInspectorAdvancedControls as RootInspectorAdvancedControls,\n\tInspectorControls as RootInspectorControls,\n\tPanelColorSettings as RootPanelColorSettings,\n\tPlainText as RootPlainText,\n\tRichText as RootRichText,\n\tRichTextShortcut as RootRichTextShortcut,\n\tRichTextToolbarButton as RootRichTextToolbarButton,\n\t__unstableRichTextInputEvent as __unstableRootRichTextInputEvent,\n\tMediaPlaceholder as RootMediaPlaceholder,\n\tMediaUpload as RootMediaUpload,\n\tMediaUploadCheck as RootMediaUploadCheck,\n\tMultiSelectScrollIntoView as RootMultiSelectScrollIntoView,\n\tNavigableToolbar as RootNavigableToolbar,\n\tObserveTyping as RootObserveTyping,\n\tPreserveScrollInReorder as RootPreserveScrollInReorder,\n\tSkipToSelectedBlock as RootSkipToSelectedBlock,\n\tURLInput as RootURLInput,\n\tURLInputButton as RootURLInputButton,\n\tURLPopover as RootURLPopover,\n\tWarning as RootWarning,\n\tWritingFlow as RootWritingFlow,\n\twithColorContext as rootWithColorContext,\n\twithColors as rootWithColors,\n\twithFontSizes as rootWithFontSizes,\n} from '@wordpress/block-editor';\n\nexport { default as ServerSideRender } from '@wordpress/server-side-render';\n\nfunction deprecateComponent( name, Wrapped, staticsToHoist = [] ) {\n\tconst Component = forwardRef( ( props, ref ) => {\n\t\tdeprecated( 'wp.editor.' + name, {\n\t\t\tsince: '5.3',\n\t\t\talternative: 'wp.blockEditor.' + name,\n\t\t\tversion: '6.2',\n\t\t} );\n\n\t\treturn <Wrapped ref={ ref } { ...props } />;\n\t} );\n\n\tstaticsToHoist.forEach( ( staticName ) => {\n\t\tComponent[ staticName ] = deprecateComponent(\n\t\t\tname + '.' + staticName,\n\t\t\tWrapped[ staticName ]\n\t\t);\n\t} );\n\n\treturn Component;\n}\n\nfunction deprecateFunction( name, func ) {\n\treturn ( ...args ) => {\n\t\tdeprecated( 'wp.editor.' + name, {\n\t\t\tsince: '5.3',\n\t\t\talternative: 'wp.blockEditor.' + name,\n\t\t\tversion: '6.2',\n\t\t} );\n\n\t\treturn func( ...args );\n\t};\n}\n\nconst RichText = deprecateComponent( 'RichText', RootRichText, [ 'Content' ] );\nRichText.isEmpty = deprecateFunction(\n\t'RichText.isEmpty',\n\tRootRichText.isEmpty\n);\n\nexport { RichText };\nexport const Autocomplete = deprecateComponent(\n\t'Autocomplete',\n\tRootAutocomplete\n);\nexport const AlignmentToolbar = deprecateComponent(\n\t'AlignmentToolbar',\n\tRootAlignmentToolbar\n);\nexport const BlockAlignmentToolbar = deprecateComponent(\n\t'BlockAlignmentToolbar',\n\tRootBlockAlignmentToolbar\n);\nexport const BlockControls = deprecateComponent(\n\t'BlockControls',\n\tRootBlockControls,\n\t[ 'Slot' ]\n);\nexport const BlockEdit = deprecateComponent( 'BlockEdit', RootBlockEdit );\nexport const BlockEditorKeyboardShortcuts = deprecateComponent(\n\t'BlockEditorKeyboardShortcuts',\n\tRootBlockEditorKeyboardShortcuts\n);\nexport const BlockFormatControls = deprecateComponent(\n\t'BlockFormatControls',\n\tRootBlockFormatControls,\n\t[ 'Slot' ]\n);\nexport const BlockIcon = deprecateComponent( 'BlockIcon', RootBlockIcon );\nexport const BlockInspector = deprecateComponent(\n\t'BlockInspector',\n\tRootBlockInspector\n);\nexport const BlockList = deprecateComponent( 'BlockList', RootBlockList );\nexport const BlockMover = deprecateComponent( 'BlockMover', RootBlockMover );\nexport const BlockNavigationDropdown = deprecateComponent(\n\t'BlockNavigationDropdown',\n\tRootBlockNavigationDropdown\n);\nexport const BlockSelectionClearer = deprecateComponent(\n\t'BlockSelectionClearer',\n\tRootBlockSelectionClearer\n);\nexport const BlockSettingsMenu = deprecateComponent(\n\t'BlockSettingsMenu',\n\tRootBlockSettingsMenu\n);\nexport const BlockTitle = deprecateComponent( 'BlockTitle', RootBlockTitle );\nexport const BlockToolbar = deprecateComponent(\n\t'BlockToolbar',\n\tRootBlockToolbar\n);\nexport const ColorPalette = deprecateComponent(\n\t'ColorPalette',\n\tRootColorPalette\n);\nexport const ContrastChecker = deprecateComponent(\n\t'ContrastChecker',\n\tRootContrastChecker\n);\nexport const CopyHandler = deprecateComponent( 'CopyHandler', RootCopyHandler );\nexport const DefaultBlockAppender = deprecateComponent(\n\t'DefaultBlockAppender',\n\tRootDefaultBlockAppender\n);\nexport const FontSizePicker = deprecateComponent(\n\t'FontSizePicker',\n\tRootFontSizePicker\n);\nexport const Inserter = deprecateComponent( 'Inserter', RootInserter );\nexport const InnerBlocks = deprecateComponent( 'InnerBlocks', RootInnerBlocks, [\n\t'ButtonBlockAppender',\n\t'DefaultBlockAppender',\n\t'Content',\n] );\nexport const InspectorAdvancedControls = deprecateComponent(\n\t'InspectorAdvancedControls',\n\tRootInspectorAdvancedControls,\n\t[ 'Slot' ]\n);\nexport const InspectorControls = deprecateComponent(\n\t'InspectorControls',\n\tRootInspectorControls,\n\t[ 'Slot' ]\n);\nexport const PanelColorSettings = deprecateComponent(\n\t'PanelColorSettings',\n\tRootPanelColorSettings\n);\nexport const PlainText = deprecateComponent( 'PlainText', RootPlainText );\nexport const RichTextShortcut = deprecateComponent(\n\t'RichTextShortcut',\n\tRootRichTextShortcut\n);\nexport const RichTextToolbarButton = deprecateComponent(\n\t'RichTextToolbarButton',\n\tRootRichTextToolbarButton\n);\nexport const __unstableRichTextInputEvent = deprecateComponent(\n\t'__unstableRichTextInputEvent',\n\t__unstableRootRichTextInputEvent\n);\nexport const MediaPlaceholder = deprecateComponent(\n\t'MediaPlaceholder',\n\tRootMediaPlaceholder\n);\nexport const MediaUpload = deprecateComponent( 'MediaUpload', RootMediaUpload );\nexport const MediaUploadCheck = deprecateComponent(\n\t'MediaUploadCheck',\n\tRootMediaUploadCheck\n);\nexport const MultiSelectScrollIntoView = deprecateComponent(\n\t'MultiSelectScrollIntoView',\n\tRootMultiSelectScrollIntoView\n);\nexport const NavigableToolbar = deprecateComponent(\n\t'NavigableToolbar',\n\tRootNavigableToolbar\n);\nexport const ObserveTyping = deprecateComponent(\n\t'ObserveTyping',\n\tRootObserveTyping\n);\nexport const PreserveScrollInReorder = deprecateComponent(\n\t'PreserveScrollInReorder',\n\tRootPreserveScrollInReorder\n);\nexport const SkipToSelectedBlock = deprecateComponent(\n\t'SkipToSelectedBlock',\n\tRootSkipToSelectedBlock\n);\nexport const URLInput = deprecateComponent( 'URLInput', RootURLInput );\nexport const URLInputButton = deprecateComponent(\n\t'URLInputButton',\n\tRootURLInputButton\n);\nexport const URLPopover = deprecateComponent( 'URLPopover', RootURLPopover );\nexport const Warning = deprecateComponent( 'Warning', RootWarning );\nexport const WritingFlow = deprecateComponent( 'WritingFlow', RootWritingFlow );\n\nexport const createCustomColorsHOC = deprecateFunction(\n\t'createCustomColorsHOC',\n\trootCreateCustomColorsHOC\n);\nexport const getColorClassName = deprecateFunction(\n\t'getColorClassName',\n\trootGetColorClassName\n);\nexport const getColorObjectByAttributeValues = deprecateFunction(\n\t'getColorObjectByAttributeValues',\n\trootGetColorObjectByAttributeValues\n);\nexport const getColorObjectByColorValue = deprecateFunction(\n\t'getColorObjectByColorValue',\n\trootGetColorObjectByColorValue\n);\nexport const getFontSize = deprecateFunction( 'getFontSize', rootGetFontSize );\nexport const getFontSizeClass = deprecateFunction(\n\t'getFontSizeClass',\n\trootGetFontSizeClass\n);\nexport const withColorContext = deprecateFunction(\n\t'withColorContext',\n\trootWithColorContext\n);\nexport const withColors = deprecateFunction( 'withColors', rootWithColors );\nexport const withFontSizes = deprecateFunction(\n\t'withFontSizes',\n\trootWithFontSizes\n);\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/deprecated.js"],"names":["deprecateComponent","name","Wrapped","staticsToHoist","Component","props","ref","since","alternative","version","forEach","staticName","deprecateFunction","func","RichText","RootRichText","isEmpty","Autocomplete","RootAutocomplete","AlignmentToolbar","RootAlignmentToolbar","BlockAlignmentToolbar","RootBlockAlignmentToolbar","BlockControls","RootBlockControls","BlockEdit","RootBlockEdit","BlockEditorKeyboardShortcuts","RootBlockEditorKeyboardShortcuts","BlockFormatControls","RootBlockFormatControls","BlockIcon","RootBlockIcon","BlockInspector","RootBlockInspector","BlockList","RootBlockList","BlockMover","RootBlockMover","BlockNavigationDropdown","RootBlockNavigationDropdown","BlockSelectionClearer","RootBlockSelectionClearer","BlockSettingsMenu","RootBlockSettingsMenu","BlockTitle","RootBlockTitle","BlockToolbar","RootBlockToolbar","ColorPalette","RootColorPalette","ContrastChecker","RootContrastChecker","CopyHandler","RootCopyHandler","DefaultBlockAppender","RootDefaultBlockAppender","FontSizePicker","RootFontSizePicker","Inserter","RootInserter","InnerBlocks","RootInnerBlocks","InspectorAdvancedControls","RootInspectorAdvancedControls","InspectorControls","RootInspectorControls","PanelColorSettings","RootPanelColorSettings","PlainText","RootPlainText","RichTextShortcut","RootRichTextShortcut","RichTextToolbarButton","RootRichTextToolbarButton","__unstableRichTextInputEvent","__unstableRootRichTextInputEvent","MediaPlaceholder","RootMediaPlaceholder","MediaUpload","RootMediaUpload","MediaUploadCheck","RootMediaUploadCheck","MultiSelectScrollIntoView","RootMultiSelectScrollIntoView","NavigableToolbar","RootNavigableToolbar","ObserveTyping","RootObserveTyping","SkipToSelectedBlock","RootSkipToSelectedBlock","URLInput","RootURLInput","URLInputButton","RootURLInputButton","URLPopover","RootURLPopover","Warning","RootWarning","WritingFlow","RootWritingFlow","createCustomColorsHOC","rootCreateCustomColorsHOC","getColorClassName","rootGetColorClassName","getColorObjectByAttributeValues","rootGetColorObjectByAttributeValues","getColorObjectByColorValue","rootGetColorObjectByColorValue","getFontSize","rootGetFontSize","getFontSizeClass","rootGetFontSizeClass","withColorContext","rootWithColorContext","withColors","rootWithColors","withFontSizes","rootWithFontSizes"],"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ACA,MAAMC,gBAAgB,GAAGnG,iBAAiB,CAChD,kBADgD,EAEhDoG,6BAFgD,CAA1C;;AAIA,MAAMC,gBAAgB,GAAGrG,iBAAiB,CAChD,kBADgD,EAEhDsG,6BAFgD,CAA1C;;AAIA,MAAMC,UAAU,GAAGvG,iBAAiB,CAAE,YAAF,EAAgBwG,uBAAhB,CAApC;;AACA,MAAMC,aAAa,GAAGzG,iBAAiB,CAC7C,eAD6C,EAE7C0G,0BAF6C,CAAvC","sourcesContent":["// Block Creation Components\n/**\n * WordPress dependencies\n */\nimport deprecated from '@wordpress/deprecated';\nimport { forwardRef } from '@wordpress/element';\nimport {\n\tAutocomplete as RootAutocomplete,\n\tAlignmentToolbar as RootAlignmentToolbar,\n\tBlockAlignmentToolbar as RootBlockAlignmentToolbar,\n\tBlockControls as RootBlockControls,\n\tBlockEdit as RootBlockEdit,\n\tBlockEditorKeyboardShortcuts as RootBlockEditorKeyboardShortcuts,\n\tBlockFormatControls as RootBlockFormatControls,\n\tBlockIcon as RootBlockIcon,\n\tBlockInspector as RootBlockInspector,\n\tBlockList as RootBlockList,\n\tBlockMover as RootBlockMover,\n\tBlockNavigationDropdown as RootBlockNavigationDropdown,\n\tBlockSelectionClearer as RootBlockSelectionClearer,\n\tBlockSettingsMenu as RootBlockSettingsMenu,\n\tBlockTitle as RootBlockTitle,\n\tBlockToolbar as RootBlockToolbar,\n\tColorPalette as RootColorPalette,\n\tContrastChecker as RootContrastChecker,\n\tCopyHandler as RootCopyHandler,\n\tcreateCustomColorsHOC as rootCreateCustomColorsHOC,\n\tDefaultBlockAppender as RootDefaultBlockAppender,\n\tFontSizePicker as RootFontSizePicker,\n\tgetColorClassName as rootGetColorClassName,\n\tgetColorObjectByAttributeValues as rootGetColorObjectByAttributeValues,\n\tgetColorObjectByColorValue as rootGetColorObjectByColorValue,\n\tgetFontSize as rootGetFontSize,\n\tgetFontSizeClass as rootGetFontSizeClass,\n\tInserter as RootInserter,\n\tInnerBlocks as RootInnerBlocks,\n\tInspectorAdvancedControls as RootInspectorAdvancedControls,\n\tInspectorControls as RootInspectorControls,\n\tPanelColorSettings as RootPanelColorSettings,\n\tPlainText as RootPlainText,\n\tRichText as RootRichText,\n\tRichTextShortcut as RootRichTextShortcut,\n\tRichTextToolbarButton as RootRichTextToolbarButton,\n\t__unstableRichTextInputEvent as __unstableRootRichTextInputEvent,\n\tMediaPlaceholder as RootMediaPlaceholder,\n\tMediaUpload as RootMediaUpload,\n\tMediaUploadCheck as RootMediaUploadCheck,\n\tMultiSelectScrollIntoView as RootMultiSelectScrollIntoView,\n\tNavigableToolbar as RootNavigableToolbar,\n\tObserveTyping as RootObserveTyping,\n\tSkipToSelectedBlock as RootSkipToSelectedBlock,\n\tURLInput as RootURLInput,\n\tURLInputButton as RootURLInputButton,\n\tURLPopover as RootURLPopover,\n\tWarning as RootWarning,\n\tWritingFlow as RootWritingFlow,\n\twithColorContext as rootWithColorContext,\n\twithColors as rootWithColors,\n\twithFontSizes as rootWithFontSizes,\n} from '@wordpress/block-editor';\n\nexport { default as ServerSideRender } from '@wordpress/server-side-render';\n\nfunction deprecateComponent( name, Wrapped, staticsToHoist = [] ) {\n\tconst Component = forwardRef( ( props, ref ) => {\n\t\tdeprecated( 'wp.editor.' + name, {\n\t\t\tsince: '5.3',\n\t\t\talternative: 'wp.blockEditor.' + name,\n\t\t\tversion: '6.2',\n\t\t} );\n\n\t\treturn <Wrapped ref={ ref } { ...props } />;\n\t} );\n\n\tstaticsToHoist.forEach( ( staticName ) => {\n\t\tComponent[ staticName ] = deprecateComponent(\n\t\t\tname + '.' + staticName,\n\t\t\tWrapped[ staticName ]\n\t\t);\n\t} );\n\n\treturn Component;\n}\n\nfunction deprecateFunction( name, func ) {\n\treturn ( ...args ) => {\n\t\tdeprecated( 'wp.editor.' + name, {\n\t\t\tsince: '5.3',\n\t\t\talternative: 'wp.blockEditor.' + name,\n\t\t\tversion: '6.2',\n\t\t} );\n\n\t\treturn func( ...args );\n\t};\n}\n\nconst RichText = deprecateComponent( 'RichText', RootRichText, [ 'Content' ] );\nRichText.isEmpty = deprecateFunction(\n\t'RichText.isEmpty',\n\tRootRichText.isEmpty\n);\n\nexport { RichText };\nexport const Autocomplete = deprecateComponent(\n\t'Autocomplete',\n\tRootAutocomplete\n);\nexport const AlignmentToolbar = deprecateComponent(\n\t'AlignmentToolbar',\n\tRootAlignmentToolbar\n);\nexport const BlockAlignmentToolbar = deprecateComponent(\n\t'BlockAlignmentToolbar',\n\tRootBlockAlignmentToolbar\n);\nexport const BlockControls = deprecateComponent(\n\t'BlockControls',\n\tRootBlockControls,\n\t[ 'Slot' ]\n);\nexport const BlockEdit = deprecateComponent( 'BlockEdit', RootBlockEdit );\nexport const BlockEditorKeyboardShortcuts = deprecateComponent(\n\t'BlockEditorKeyboardShortcuts',\n\tRootBlockEditorKeyboardShortcuts\n);\nexport const BlockFormatControls = deprecateComponent(\n\t'BlockFormatControls',\n\tRootBlockFormatControls,\n\t[ 'Slot' ]\n);\nexport const BlockIcon = deprecateComponent( 'BlockIcon', RootBlockIcon );\nexport const BlockInspector = deprecateComponent(\n\t'BlockInspector',\n\tRootBlockInspector\n);\nexport const BlockList = deprecateComponent( 'BlockList', RootBlockList );\nexport const BlockMover = deprecateComponent( 'BlockMover', RootBlockMover );\nexport const BlockNavigationDropdown = deprecateComponent(\n\t'BlockNavigationDropdown',\n\tRootBlockNavigationDropdown\n);\nexport const BlockSelectionClearer = deprecateComponent(\n\t'BlockSelectionClearer',\n\tRootBlockSelectionClearer\n);\nexport const BlockSettingsMenu = deprecateComponent(\n\t'BlockSettingsMenu',\n\tRootBlockSettingsMenu\n);\nexport const BlockTitle = deprecateComponent( 'BlockTitle', RootBlockTitle );\nexport const BlockToolbar = deprecateComponent(\n\t'BlockToolbar',\n\tRootBlockToolbar\n);\nexport const ColorPalette = deprecateComponent(\n\t'ColorPalette',\n\tRootColorPalette\n);\nexport const ContrastChecker = deprecateComponent(\n\t'ContrastChecker',\n\tRootContrastChecker\n);\nexport const CopyHandler = deprecateComponent( 'CopyHandler', RootCopyHandler );\nexport const DefaultBlockAppender = deprecateComponent(\n\t'DefaultBlockAppender',\n\tRootDefaultBlockAppender\n);\nexport const FontSizePicker = deprecateComponent(\n\t'FontSizePicker',\n\tRootFontSizePicker\n);\nexport const Inserter = deprecateComponent( 'Inserter', RootInserter );\nexport const InnerBlocks = deprecateComponent( 'InnerBlocks', RootInnerBlocks, [\n\t'ButtonBlockAppender',\n\t'DefaultBlockAppender',\n\t'Content',\n] );\nexport const InspectorAdvancedControls = deprecateComponent(\n\t'InspectorAdvancedControls',\n\tRootInspectorAdvancedControls,\n\t[ 'Slot' ]\n);\nexport const InspectorControls = deprecateComponent(\n\t'InspectorControls',\n\tRootInspectorControls,\n\t[ 'Slot' ]\n);\nexport const PanelColorSettings = deprecateComponent(\n\t'PanelColorSettings',\n\tRootPanelColorSettings\n);\nexport const PlainText = deprecateComponent( 'PlainText', RootPlainText );\nexport const RichTextShortcut = deprecateComponent(\n\t'RichTextShortcut',\n\tRootRichTextShortcut\n);\nexport const RichTextToolbarButton = deprecateComponent(\n\t'RichTextToolbarButton',\n\tRootRichTextToolbarButton\n);\nexport const __unstableRichTextInputEvent = deprecateComponent(\n\t'__unstableRichTextInputEvent',\n\t__unstableRootRichTextInputEvent\n);\nexport const MediaPlaceholder = deprecateComponent(\n\t'MediaPlaceholder',\n\tRootMediaPlaceholder\n);\nexport const MediaUpload = deprecateComponent( 'MediaUpload', RootMediaUpload );\nexport const MediaUploadCheck = deprecateComponent(\n\t'MediaUploadCheck',\n\tRootMediaUploadCheck\n);\nexport const MultiSelectScrollIntoView = deprecateComponent(\n\t'MultiSelectScrollIntoView',\n\tRootMultiSelectScrollIntoView\n);\nexport const NavigableToolbar = deprecateComponent(\n\t'NavigableToolbar',\n\tRootNavigableToolbar\n);\nexport const ObserveTyping = deprecateComponent(\n\t'ObserveTyping',\n\tRootObserveTyping\n);\nexport const SkipToSelectedBlock = deprecateComponent(\n\t'SkipToSelectedBlock',\n\tRootSkipToSelectedBlock\n);\nexport const URLInput = deprecateComponent( 'URLInput', RootURLInput );\nexport const URLInputButton = deprecateComponent(\n\t'URLInputButton',\n\tRootURLInputButton\n);\nexport const URLPopover = deprecateComponent( 'URLPopover', RootURLPopover );\nexport const Warning = deprecateComponent( 'Warning', RootWarning );\nexport const WritingFlow = deprecateComponent( 'WritingFlow', RootWritingFlow );\n\nexport const createCustomColorsHOC = deprecateFunction(\n\t'createCustomColorsHOC',\n\trootCreateCustomColorsHOC\n);\nexport const getColorClassName = deprecateFunction(\n\t'getColorClassName',\n\trootGetColorClassName\n);\nexport const getColorObjectByAttributeValues = deprecateFunction(\n\t'getColorObjectByAttributeValues',\n\trootGetColorObjectByAttributeValues\n);\nexport const getColorObjectByColorValue = deprecateFunction(\n\t'getColorObjectByColorValue',\n\trootGetColorObjectByColorValue\n);\nexport const getFontSize = deprecateFunction( 'getFontSize', rootGetFontSize );\nexport const getFontSizeClass = deprecateFunction(\n\t'getFontSizeClass',\n\trootGetFontSizeClass\n);\nexport const withColorContext = deprecateFunction(\n\t'withColorContext',\n\trootWithColorContext\n);\nexport const withColors = deprecateFunction( 'withColors', rootWithColors );\nexport const withFontSizes = deprecateFunction(\n\t'withFontSizes',\n\trootWithFontSizes\n);\n"]}
|
|
@@ -52,6 +52,8 @@ var _exportNames = {
|
|
|
52
52
|
PostStickyCheck: true,
|
|
53
53
|
PostSwitchToDraftButton: true,
|
|
54
54
|
PostTaxonomies: true,
|
|
55
|
+
PostTaxonomiesFlatTermSelector: true,
|
|
56
|
+
PostTaxonomiesHierarchicalTermSelector: true,
|
|
55
57
|
PostTaxonomiesCheck: true,
|
|
56
58
|
PostTextEditor: true,
|
|
57
59
|
PostTitle: true,
|
|
@@ -343,6 +345,18 @@ Object.defineProperty(exports, "PostTaxonomiesCheck", {
|
|
|
343
345
|
return _check12.default;
|
|
344
346
|
}
|
|
345
347
|
});
|
|
348
|
+
Object.defineProperty(exports, "PostTaxonomiesFlatTermSelector", {
|
|
349
|
+
enumerable: true,
|
|
350
|
+
get: function () {
|
|
351
|
+
return _flatTermSelector.default;
|
|
352
|
+
}
|
|
353
|
+
});
|
|
354
|
+
Object.defineProperty(exports, "PostTaxonomiesHierarchicalTermSelector", {
|
|
355
|
+
enumerable: true,
|
|
356
|
+
get: function () {
|
|
357
|
+
return _hierarchicalTermSelector.default;
|
|
358
|
+
}
|
|
359
|
+
});
|
|
346
360
|
Object.defineProperty(exports, "PostTextEditor", {
|
|
347
361
|
enumerable: true,
|
|
348
362
|
get: function () {
|
|
@@ -534,6 +548,10 @@ var _postSwitchToDraftButton = _interopRequireDefault(require("./post-switch-to-
|
|
|
534
548
|
|
|
535
549
|
var _postTaxonomies = _interopRequireDefault(require("./post-taxonomies"));
|
|
536
550
|
|
|
551
|
+
var _flatTermSelector = _interopRequireDefault(require("./post-taxonomies/flat-term-selector"));
|
|
552
|
+
|
|
553
|
+
var _hierarchicalTermSelector = _interopRequireDefault(require("./post-taxonomies/hierarchical-term-selector"));
|
|
554
|
+
|
|
537
555
|
var _check12 = _interopRequireDefault(require("./post-taxonomies/check"));
|
|
538
556
|
|
|
539
557
|
var _postTextEditor = _interopRequireDefault(require("./post-text-editor"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAGA;;AAEA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["// Block Creation Components\nexport * from './autocompleters';\n\n// Post Related Components\nexport { default as AutosaveMonitor } from './autosave-monitor';\nexport { default as DocumentOutline } from './document-outline';\nexport { default as DocumentOutlineCheck } from './document-outline/check';\nexport { default as VisualEditorGlobalKeyboardShortcuts } from './global-keyboard-shortcuts/visual-editor-shortcuts';\nexport { default as TextEditorGlobalKeyboardShortcuts } from './global-keyboard-shortcuts/text-editor-shortcuts';\nexport { default as EditorKeyboardShortcutsRegister } from './global-keyboard-shortcuts/register-shortcuts';\nexport { default as EditorHistoryRedo } from './editor-history/redo';\nexport { default as EditorHistoryUndo } from './editor-history/undo';\nexport { default as EditorNotices } from './editor-notices';\nexport { default as EditorSnackbars } from './editor-snackbars';\nexport { default as EntitiesSavedStates } from './entities-saved-states';\nexport { default as ErrorBoundary } from './error-boundary';\nexport { default as LocalAutosaveMonitor } from './local-autosave-monitor';\nexport { default as PageAttributesCheck } from './page-attributes/check';\nexport { default as PageAttributesOrder } from './page-attributes/order';\nexport { default as PageAttributesParent } from './page-attributes/parent';\nexport { default as PageTemplate } from './post-template';\nexport { default as PostAuthor } from './post-author';\nexport { default as PostAuthorCheck } from './post-author/check';\nexport { default as PostComments } from './post-comments';\nexport { default as PostExcerpt } from './post-excerpt';\nexport { default as PostExcerptCheck } from './post-excerpt/check';\nexport { default as PostFeaturedImage } from './post-featured-image';\nexport { default as PostFeaturedImageCheck } from './post-featured-image/check';\nexport { default as PostFormat } from './post-format';\nexport { default as PostFormatCheck } from './post-format/check';\nexport { default as PostLastRevision } from './post-last-revision';\nexport { default as PostLastRevisionCheck } from './post-last-revision/check';\nexport { default as PostLockedModal } from './post-locked-modal';\nexport { default as PostPendingStatus } from './post-pending-status';\nexport { default as PostPendingStatusCheck } from './post-pending-status/check';\nexport { default as PostPingbacks } from './post-pingbacks';\nexport { default as PostPreviewButton } from './post-preview-button';\nexport { default as PostPublishButton } from './post-publish-button';\nexport { default as PostPublishButtonLabel } from './post-publish-button/label';\nexport { default as PostPublishPanel } from './post-publish-panel';\nexport { default as PostSavedState } from './post-saved-state';\nexport { default as PostSchedule } from './post-schedule';\nexport { default as PostScheduleCheck } from './post-schedule/check';\nexport { default as PostScheduleLabel } from './post-schedule/label';\nexport { default as PostSlug } from './post-slug';\nexport { default as PostSlugCheck } from './post-slug/check';\nexport { default as PostSticky } from './post-sticky';\nexport { default as PostStickyCheck } from './post-sticky/check';\nexport { default as PostSwitchToDraftButton } from './post-switch-to-draft-button';\nexport { default as PostTaxonomies } from './post-taxonomies';\nexport { default as PostTaxonomiesFlatTermSelector } from './post-taxonomies/flat-term-selector';\nexport { default as PostTaxonomiesHierarchicalTermSelector } from './post-taxonomies/hierarchical-term-selector';\nexport { default as PostTaxonomiesCheck } from './post-taxonomies/check';\nexport { default as PostTextEditor } from './post-text-editor';\nexport { default as PostTitle } from './post-title';\nexport { default as PostTrash } from './post-trash';\nexport { default as PostTrashCheck } from './post-trash/check';\nexport { default as PostTypeSupportCheck } from './post-type-support-check';\nexport { default as PostVisibility } from './post-visibility';\nexport { default as PostVisibilityLabel } from './post-visibility/label';\nexport { default as PostVisibilityCheck } from './post-visibility/check';\nexport { default as TableOfContents } from './table-of-contents';\nexport { default as ThemeSupportCheck } from './theme-support-check';\nexport { default as UnsavedChangesWarning } from './unsaved-changes-warning';\nexport { default as WordCount } from './word-count';\n\n// State Related Components\nexport { default as EditorProvider } from './provider';\n\nexport * from './deprecated';\n"]}
|
|
@@ -103,12 +103,14 @@ function PostFormat() {
|
|
|
103
103
|
return {
|
|
104
104
|
postFormat: _postFormat !== null && _postFormat !== void 0 ? _postFormat : 'standard',
|
|
105
105
|
suggestedFormat: getSuggestedPostFormat(),
|
|
106
|
-
|
|
107
|
-
// The current format may not be a format supported by the theme.
|
|
108
|
-
supportedFormats: (0, _lodash.union)([_postFormat], (0, _lodash.get)(themeSupports, ['formats'], []))
|
|
106
|
+
supportedFormats: themeSupports.formats
|
|
109
107
|
};
|
|
110
108
|
}, []);
|
|
111
|
-
const formats = POST_FORMATS.filter(format =>
|
|
109
|
+
const formats = POST_FORMATS.filter(format => {
|
|
110
|
+
// Ensure current format is always in the set.
|
|
111
|
+
// The current format may not be a format supported by the theme.
|
|
112
|
+
return (0, _lodash.includes)(supportedFormats, format.id) || postFormat === format.id;
|
|
113
|
+
});
|
|
112
114
|
const suggestion = (0, _lodash.find)(formats, format => format.id === suggestedFormat);
|
|
113
115
|
const {
|
|
114
116
|
editPost
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/post-format/index.js"],"names":["POST_FORMATS","id","caption","sort","a","b","normalizedA","toUpperCase","normalizedB","PostFormat","instanceId","postFormatSelectorId","postFormat","suggestedFormat","supportedFormats","select","getEditedPostAttribute","getSuggestedPostFormat","editorStore","_postFormat","themeSupports","coreStore","getThemeSupports","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UK,WAAV,EAApB;AACA,QAAMC,WAAW,GAAGH,CAAC,CAACH,OAAF,CAAUK,WAAV,EAApB;;AAEA,MAAKD,WAAW,GAAGE,WAAnB,EAAiC;AAChC,WAAO,CAAC,CAAR;AACA;;AACD,MAAKF,WAAW,GAAGE,WAAnB,EAAiC;AAChC,WAAO,CAAP;AACA;;AACD,SAAO,CAAP;AACA,CAtB2B,CAArB;;;AAwBQ,SAASC,UAAT,GAAsB;AACpC,QAAMC,UAAU,GAAG,4BAAeD,UAAf,CAAnB;AACA,QAAME,oBAAoB,GAAI,wBAAwBD,UAAY,EAAlE;AAEA,QAAM;AAAEE,IAAAA,UAAF;AAAcC,IAAAA,eAAd;AAA+BC,IAAAA;AAA/B,MAAoD,qBACvDC,MAAF,IAAc;AACb,UAAM;AAAEC,MAAAA,sBAAF;AAA0BC,MAAAA;AAA1B,QAAqDF,MAAM,CAChEG,YADgE,CAAjE;;AAGA,UAAMC,WAAW,GAAGH,sBAAsB,CAAE,QAAF,CAA1C;;AACA,UAAMI,aAAa,GAAGL,MAAM,CAAEM,eAAF,CAAN,CAAoBC,gBAApB,EAAtB;AACA,WAAO;AACNV,MAAAA,UAAU,EAAEO,WAAF,aAAEA,WAAF,cAAEA,WAAF,GAAiB,UADrB;AAENN,MAAAA,eAAe,EAAEI,sBAAsB,EAFjC;
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/post-format/index.js"],"names":["POST_FORMATS","id","caption","sort","a","b","normalizedA","toUpperCase","normalizedB","PostFormat","instanceId","postFormatSelectorId","postFormat","suggestedFormat","supportedFormats","select","getEditedPostAttribute","getSuggestedPostFormat","editorStore","_postFormat","themeSupports","coreStore","getThemeSupports","formats","filter","format","suggestion","editPost","onUpdatePostFormat","map","label","value"],"mappings":";;;;;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AAlBA;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;AAIA;AACO,MAAMA,YAA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ACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AAAO,IAAA,OAAO,EAAGd;AAAjB,KACG,cAAI,aAAJ,CADH,CADD,EAIC,4BAAC,yBAAD;AACC,IAAA,KAAK,EAAGC,UADT;AAEC,IAAA,QAAQ,EAAKa,MAAF,IAAcG,kBAAkB,CAAEH,MAAF,CAF5C;AAGC,IAAA,EAAE,EAAGd,oBAHN;AAIC,IAAA,OAAO,EAAGY,OAAO,CAACM,GAAR,CAAeJ,MAAF,KAAgB;AACtCK,MAAAA,KAAK,EAAEL,MAAM,CAACvB,OADwB;AAEtC6B,MAAAA,KAAK,EAAEN,MAAM,CAACxB;AAFwB,KAAhB,CAAb;AAJX,IAJD,CADD,EAgBGyB,UAAU,IAAIA,UAAU,CAACzB,EAAX,KAAkBW,UAAhC,IACD;AAAK,IAAA,SAAS,EAAC;AAAf,KACG,cAAI,aAAJ,CADH,EAC0B,GAD1B,EAEC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAC,MADT;AAEC,IAAA,OAAO,EAAG,MACTgB,kBAAkB,CAAEF,UAAU,CAACzB,EAAb;AAHpB,KAMG;AACD;AACA,gBAAI,kBAAJ,CAFC,EAGDyB,UAAU,CAACxB,OAHV,CANH,CAFD,CAjBF,CADD,CADD;AAsCA","sourcesContent":["/**\n * External dependencies\n */\nimport { find, includes } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button, SelectControl } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useInstanceId } from '@wordpress/compose';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport PostFormatCheck from './check';\nimport { store as editorStore } from '../../store';\n\n// All WP post formats, sorted alphabetically by translated name.\nexport const POST_FORMATS = [\n\t{ id: 'aside', caption: __( 'Aside' ) },\n\t{ id: 'audio', caption: __( 'Audio' ) },\n\t{ id: 'chat', caption: __( 'Chat' ) },\n\t{ id: 'gallery', caption: __( 'Gallery' ) },\n\t{ id: 'image', caption: __( 'Image' ) },\n\t{ id: 'link', caption: __( 'Link' ) },\n\t{ id: 'quote', caption: __( 'Quote' ) },\n\t{ id: 'standard', caption: __( 'Standard' ) },\n\t{ id: 'status', caption: __( 'Status' ) },\n\t{ id: 'video', caption: __( 'Video' ) },\n].sort( ( a, b ) => {\n\tconst normalizedA = a.caption.toUpperCase();\n\tconst normalizedB = b.caption.toUpperCase();\n\n\tif ( normalizedA < normalizedB ) {\n\t\treturn -1;\n\t}\n\tif ( normalizedA > normalizedB ) {\n\t\treturn 1;\n\t}\n\treturn 0;\n} );\n\nexport default function PostFormat() {\n\tconst instanceId = useInstanceId( PostFormat );\n\tconst postFormatSelectorId = `post-format-selector-${ instanceId }`;\n\n\tconst { postFormat, suggestedFormat, supportedFormats } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedPostAttribute, getSuggestedPostFormat } = select(\n\t\t\t\teditorStore\n\t\t\t);\n\t\t\tconst _postFormat = getEditedPostAttribute( 'format' );\n\t\t\tconst themeSupports = select( coreStore ).getThemeSupports();\n\t\t\treturn {\n\t\t\t\tpostFormat: _postFormat ?? 'standard',\n\t\t\t\tsuggestedFormat: getSuggestedPostFormat(),\n\t\t\t\tsupportedFormats: themeSupports.formats,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst formats = POST_FORMATS.filter( ( format ) => {\n\t\t// Ensure current format is always in the set.\n\t\t// The current format may not be a format supported by the theme.\n\t\treturn (\n\t\t\tincludes( supportedFormats, format.id ) || postFormat === format.id\n\t\t);\n\t} );\n\tconst suggestion = find(\n\t\tformats,\n\t\t( format ) => format.id === suggestedFormat\n\t);\n\n\tconst { editPost } = useDispatch( editorStore );\n\n\tconst onUpdatePostFormat = ( format ) => editPost( { format } );\n\n\treturn (\n\t\t<PostFormatCheck>\n\t\t\t<div className=\"editor-post-format\">\n\t\t\t\t<div className=\"editor-post-format__content\">\n\t\t\t\t\t<label htmlFor={ postFormatSelectorId }>\n\t\t\t\t\t\t{ __( 'Post Format' ) }\n\t\t\t\t\t</label>\n\t\t\t\t\t<SelectControl\n\t\t\t\t\t\tvalue={ postFormat }\n\t\t\t\t\t\tonChange={ ( format ) => onUpdatePostFormat( format ) }\n\t\t\t\t\t\tid={ postFormatSelectorId }\n\t\t\t\t\t\toptions={ formats.map( ( format ) => ( {\n\t\t\t\t\t\t\tlabel: format.caption,\n\t\t\t\t\t\t\tvalue: format.id,\n\t\t\t\t\t\t} ) ) }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\n\t\t\t\t{ suggestion && suggestion.id !== postFormat && (\n\t\t\t\t\t<div className=\"editor-post-format__suggestion\">\n\t\t\t\t\t\t{ __( 'Suggestion:' ) }{ ' ' }\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\tonUpdatePostFormat( suggestion.id )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: post format */\n\t\t\t\t\t\t\t\t__( 'Apply format: %s' ),\n\t\t\t\t\t\t\t\tsuggestion.caption\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</PostFormatCheck>\n\t);\n}\n"]}
|
|
@@ -28,9 +28,9 @@ var _terms2 = require("../../utils/terms");
|
|
|
28
28
|
/**
|
|
29
29
|
* Internal dependencies
|
|
30
30
|
*/
|
|
31
|
-
const
|
|
31
|
+
const MIN_MOST_USED_TERMS = 3;
|
|
32
32
|
const DEFAULT_QUERY = {
|
|
33
|
-
per_page:
|
|
33
|
+
per_page: 10,
|
|
34
34
|
orderby: 'count',
|
|
35
35
|
order: 'desc',
|
|
36
36
|
hide_empty: true,
|
|
@@ -50,7 +50,7 @@ function MostUsedTerms(_ref) {
|
|
|
50
50
|
const mostUsedTerms = select(_coreData.store).getEntityRecords('taxonomy', taxonomy.slug, DEFAULT_QUERY);
|
|
51
51
|
return {
|
|
52
52
|
_terms: mostUsedTerms,
|
|
53
|
-
showTerms: (mostUsedTerms === null || mostUsedTerms === void 0 ? void 0 : mostUsedTerms.length)
|
|
53
|
+
showTerms: (mostUsedTerms === null || mostUsedTerms === void 0 ? void 0 : mostUsedTerms.length) >= MIN_MOST_USED_TERMS
|
|
54
54
|
};
|
|
55
55
|
}, []);
|
|
56
56
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/post-taxonomies/most-used-terms.js"],"names":["
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/post-taxonomies/most-used-terms.js"],"names":["MIN_MOST_USED_TERMS","DEFAULT_QUERY","per_page","orderby","order","hide_empty","_fields","context","MostUsedTerms","onSelect","taxonomy","_terms","showTerms","select","mostUsedTerms","coreStore","getEntityRecords","slug","length","terms","label","map","term","id","name"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAKA;;AAfA;AACA;AACA;;AAGA;AACA;AACA;;AAKA;AACA;AACA;AAGA,MAAMA,mBAAmB,GAAG,CAA5B;AACA,MAAMC,aAAa,GAAG;AACrBC,EAAAA,QAAQ,EAAE,EADW;AAErBC,EAAAA,OAAO,EAAE,OAFY;AAGrBC,EAAAA,KAAK,EAAE,MAHc;AAIrBC,EAAAA,UAAU,EAAE,IAJS;AAKrBC,EAAAA,OAAO,EAAE,eALY;AAMrBC,EAAAA,OAAO,EAAE;AANY,CAAtB;;AASe,SAASC,aAAT,OAAiD;AAAA,MAAzB;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,GAAyB;AAC/D,QAAM;AAAEC,IAAAA,MAAF;AAAUC,IAAAA;AAAV,MAAwB,qBAAaC,MAAF,IAAc;AACtD,UAAMC,aAAa,GAAGD,MAAM,CAAEE,eAAF,CAAN,CAAoBC,gBAApB,CACrB,UADqB,EAErBN,QAAQ,CAACO,IAFY,EAGrBhB,aAHqB,CAAtB;AAKA,WAAO;AACNU,MAAAA,MAAM,EAAEG,aADF;AAENF,MAAAA,SAAS,EAAE,CAAAE,aAAa,SAAb,IAAAA,aAAa,WAAb,YAAAA,aAAa,CAAEI,MAAf,KAAyBlB;AAF9B,KAAP;AAIA,GAV6B,EAU3B,EAV2B,CAA9B;;AAYA,MAAK,CAAEY,SAAP,EAAmB;AAClB,WAAO,IAAP;AACA;;AAED,QAAMO,KAAK,GAAG,2BAAeR,MAAf,CAAd;AACA,QAAMS,KAAK,GAAG,iBAAKV,QAAL,EAAe,CAAE,QAAF,EAAY,WAAZ,CAAf,CAAd;AAEA,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AAAI,IAAA,SAAS,EAAC;AAAd,KACGU,KADH,CADD,EASC;AACC,IAAA,IAAI,EAAC,MADN;AAEC,IAAA,SAAS,EAAC;AAFX,KAIGD,KAAK,CAACE,GAAN,CAAaC,IAAF,IACZ;AAAI,IAAA,GAAG,EAAGA,IAAI,CAACC;AAAf,KACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAC,MADT;AAEC,IAAA,OAAO,EAAG,MAAMd,QAAQ,CAAEa,IAAF;AAFzB,KAIGA,IAAI,CAACE,IAJR,CADD,CADC,CAJH,CATD,CADD;AA4BA","sourcesContent":["/**\n * External dependencies\n */\nimport { get } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { unescapeTerms } from '../../utils/terms';\n\nconst MIN_MOST_USED_TERMS = 3;\nconst DEFAULT_QUERY = {\n\tper_page: 10,\n\torderby: 'count',\n\torder: 'desc',\n\thide_empty: true,\n\t_fields: 'id,name,count',\n\tcontext: 'view',\n};\n\nexport default function MostUsedTerms( { onSelect, taxonomy } ) {\n\tconst { _terms, showTerms } = useSelect( ( select ) => {\n\t\tconst mostUsedTerms = select( coreStore ).getEntityRecords(\n\t\t\t'taxonomy',\n\t\t\ttaxonomy.slug,\n\t\t\tDEFAULT_QUERY\n\t\t);\n\t\treturn {\n\t\t\t_terms: mostUsedTerms,\n\t\t\tshowTerms: mostUsedTerms?.length >= MIN_MOST_USED_TERMS,\n\t\t};\n\t}, [] );\n\n\tif ( ! showTerms ) {\n\t\treturn null;\n\t}\n\n\tconst terms = unescapeTerms( _terms );\n\tconst label = get( taxonomy, [ 'labels', 'most_used' ] );\n\n\treturn (\n\t\t<div className=\"editor-post-taxonomies__flat-term-most-used\">\n\t\t\t<h3 className=\"editor-post-taxonomies__flat-term-most-used-label\">\n\t\t\t\t{ label }\n\t\t\t</h3>\n\t\t\t{ /*\n\t\t\t * Disable reason: The `list` ARIA role is redundant but\n\t\t\t * Safari+VoiceOver won't announce the list otherwise.\n\t\t\t */\n\t\t\t/* eslint-disable jsx-a11y/no-redundant-roles */ }\n\t\t\t<ul\n\t\t\t\trole=\"list\"\n\t\t\t\tclassName=\"editor-post-taxonomies__flat-term-most-used-list\"\n\t\t\t>\n\t\t\t\t{ terms.map( ( term ) => (\n\t\t\t\t\t<li key={ term.id }>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\t\tonClick={ () => onSelect( term ) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ term.name }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</li>\n\t\t\t\t) ) }\n\t\t\t</ul>\n\t\t\t{ /* eslint-enable jsx-a11y/no-redundant-roles */ }\n\t\t</div>\n\t);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/post-title/index.native.js"],"names":["PostTitle","Component","constructor","props","setRef","bind","componentDidUpdate","prevProps","isSelected","isAnyBlockSelected","richTextRef","blur","onUnselect","componentDidMount","innerRef","handleFocusOutside","focus","onSelect","onPaste","value","onChange","plainText","content","mode","tagName","valueToInsert","html","richText","getTitle","title","postType","render","placeholder","style","focusedBorderColor","borderStyle","isDimmed","globalStyles","decodedPlaceholder","borderColor","titleStyles","text","color","placeholderColor","styles","titleContainer","dimmed","onBlur","onUpdate","onEnterPress","select","isPostTitleSelected","getEditedPostAttribute","editorStore","getSelectedBlockClientId","getBlockRootClientId","getSettings","blockEditorStore","selectedId","selectionIsNested","__experimentalGlobalStylesBaseStyles","dispatch","undo","redo","togglePostTitleSelection","clearSelectedBlock","insertDefaultBlock","undefined","onUndo","onRedo","withInstanceId","withFocusOutside"],"mappings":";;;;;;;;;AASA;;AANA;;AACA;;AAMA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AA3BA;AACA;AACA;;AAIA;AACA;AACA;;AAgBA;AACA;AACA;AAGA,MAAMA,SAAN,SAAwBC,kBAAxB,CAAkC;AACjCC,EAAAA,WAAW,CAAEC,KAAF,EAAU;AACpB,UAAOA,KAAP;AAEA,SAAKC,MAAL,GAAc,KAAKA,MAAL,CAAYC,IAAZ,CAAkB,IAAlB,CAAd;AACA;;AACDC,EAAAA,kBAAkB,CAAEC,SAAF,EAAc;AAC/B;AACA,QACC,KAAKJ,KAAL,CAAWK,UAAX,IACA,CAAED,SAAS,CAACE,kBADZ,IAEA,KAAKN,KAAL,CAAWM,kBAHZ,EAIE;AACD,UAAK,KAAKC,WAAV,EAAwB;AACvB,aAAKA,WAAL,CAAiBC,IAAjB;AACA;;AACD,WAAKR,KAAL,CAAWS,UAAX;AACA;AACD;;AAEDC,EAAAA,iBAAiB,GAAG;AACnB,QAAK,KAAKV,KAAL,CAAWW,QAAhB,EAA2B;AAC1B,WAAKX,KAAL,CAAWW,QAAX,CAAqB,IAArB;AACA;AACD;;AAEDC,EAAAA,kBAAkB,GAAG;AACpB,SAAKZ,KAAL,CAAWS,UAAX;AACA;;AAEDI,EAAAA,KAAK,GAAG;AACP,SAAKb,KAAL,CAAWc,QAAX;AACA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AAQ,CAC1DJ,kBAD0D,CAA3D;AAIA,SAAO;AACNR,IAAAA,YAAY,GAAG;AACdiB,MAAAA,kBAAkB,CAAEC,SAAF,EAAaA,SAAb,EAAwB,CAAxB,CAAlB;AACA,KAHK;;AAINC,IAAAA,MAAM,EAAEN,IAJF;AAKNO,IAAAA,MAAM,EAAEN,IALF;;AAMN9C,IAAAA,QAAQ,GAAG;AACV+C,MAAAA,wBAAwB,CAAE,IAAF,CAAxB;AACAC,MAAAA,kBAAkB;AAClB,KATK;;AAUNrD,IAAAA,UAAU,GAAG;AACZoD,MAAAA,wBAAwB,CAAE,KAAF,CAAxB;AACA;;AAZK,GAAP;AAcA,CAvBD,CAxBc,EAgDdM,uBAhDc,EAiDdC,4BAjDc,EAkDZvE,SAlDY,C","sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\nimport { isEmpty } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport {\n\t__experimentalRichText as RichText,\n\tcreate,\n\tinsert,\n} from '@wordpress/rich-text';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { withFocusOutside } from '@wordpress/components';\nimport { withInstanceId, compose } from '@wordpress/compose';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { pasteHandler } from '@wordpress/blocks';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nclass PostTitle extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\n\t\tthis.setRef = this.setRef.bind( this );\n\t}\n\tcomponentDidUpdate( prevProps ) {\n\t\t// Unselect if any other block is selected and blur the RichText\n\t\tif (\n\t\t\tthis.props.isSelected &&\n\t\t\t! prevProps.isAnyBlockSelected &&\n\t\t\tthis.props.isAnyBlockSelected\n\t\t) {\n\t\t\tif ( this.richTextRef ) {\n\t\t\t\tthis.richTextRef.blur();\n\t\t\t}\n\t\t\tthis.props.onUnselect();\n\t\t}\n\t}\n\n\tcomponentDidMount() {\n\t\tif ( this.props.innerRef ) {\n\t\t\tthis.props.innerRef( this );\n\t\t}\n\t}\n\n\thandleFocusOutside() {\n\t\tthis.props.onUnselect();\n\t}\n\n\tfocus() {\n\t\tthis.props.onSelect();\n\t}\n\n\tonPaste( { value, onChange, plainText } ) {\n\t\tconst content = pasteHandler( {\n\t\t\tplainText,\n\t\t\tmode: 'INLINE',\n\t\t\ttagName: 'p',\n\t\t} );\n\n\t\tif ( typeof content === 'string' ) {\n\t\t\tconst valueToInsert = create( { html: content } );\n\t\t\tonChange( insert( value, valueToInsert ) );\n\t\t}\n\t}\n\n\tsetRef( richText ) {\n\t\tthis.richTextRef = richText;\n\t}\n\n\tgetTitle( title, postType ) {\n\t\tif ( 'page' === postType ) {\n\t\t\treturn isEmpty( title )\n\t\t\t\t? /* translators: accessibility text. empty page title. */\n\t\t\t\t __( 'Page title. Empty' )\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: accessibility text. %s: text content of the page title. */\n\t\t\t\t\t\t__( 'Page title. %s' ),\n\t\t\t\t\t\ttitle\n\t\t\t\t );\n\t\t}\n\n\t\treturn isEmpty( title )\n\t\t\t? /* translators: accessibility text. empty post title. */\n\t\t\t __( 'Post title. Empty' )\n\t\t\t: sprintf(\n\t\t\t\t\t/* translators: accessibility text. %s: text content of the post title. */\n\t\t\t\t\t__( 'Post title. %s' ),\n\t\t\t\t\ttitle\n\t\t\t );\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tplaceholder,\n\t\t\tstyle,\n\t\t\ttitle,\n\t\t\tfocusedBorderColor,\n\t\t\tborderStyle,\n\t\t\tisDimmed,\n\t\t\tpostType,\n\t\t\tglobalStyles,\n\t\t} = this.props;\n\n\t\tconst decodedPlaceholder = decodeEntities( placeholder );\n\t\tconst borderColor = this.props.isSelected\n\t\t\t? focusedBorderColor\n\t\t\t: 'transparent';\n\t\tconst titleStyles = {\n\t\t\t...style,\n\t\t\t...( globalStyles?.text && {\n\t\t\t\tcolor: globalStyles.text,\n\t\t\t\tplaceholderColor: globalStyles.text,\n\t\t\t} ),\n\t\t};\n\n\t\treturn (\n\t\t\t<View\n\t\t\t\tstyle={ [\n\t\t\t\t\tstyles.titleContainer,\n\t\t\t\t\tborderStyle,\n\t\t\t\t\t{ borderColor },\n\t\t\t\t\tisDimmed && styles.dimmed,\n\t\t\t\t] }\n\t\t\t\taccessible={ ! this.props.isSelected }\n\t\t\t\taccessibilityLabel={ this.getTitle( title, postType ) }\n\t\t\t\taccessibilityHint={ __( 'Updates the title.' ) }\n\t\t\t>\n\t\t\t\t<RichText\n\t\t\t\t\tsetRef={ this.setRef }\n\t\t\t\t\taccessibilityLabel={ this.getTitle( title, postType ) }\n\t\t\t\t\ttagName={ 'p' }\n\t\t\t\t\ttagsToEliminate={ [ 'strong' ] }\n\t\t\t\t\tunstableOnFocus={ this.props.onSelect }\n\t\t\t\t\tonBlur={ this.props.onBlur } // always assign onBlur as a props\n\t\t\t\t\tmultiline={ false }\n\t\t\t\t\tstyle={ titleStyles }\n\t\t\t\t\tstyles={ styles }\n\t\t\t\t\tfontSize={ 24 }\n\t\t\t\t\tfontWeight={ 'bold' }\n\t\t\t\t\tdeleteEnter={ true }\n\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\tthis.props.onUpdate( value );\n\t\t\t\t\t} }\n\t\t\t\t\tonPaste={ this.onPaste }\n\t\t\t\t\tplaceholder={ decodedPlaceholder }\n\t\t\t\t\tvalue={ title }\n\t\t\t\t\tonSelectionChange={ () => {} }\n\t\t\t\t\tonEnter={ this.props.onEnterPress }\n\t\t\t\t\tdisableEditingMenu={ true }\n\t\t\t\t\t__unstableIsSelected={ this.props.isSelected }\n\t\t\t\t\t__unstableOnCreateUndoLevel={ () => {} }\n\t\t\t\t></RichText>\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nexport default compose(\n\twithSelect( ( select ) => {\n\t\tconst { isPostTitleSelected, getEditedPostAttribute } = select(\n\t\t\teditorStore\n\t\t);\n\t\tconst {\n\t\t\tgetSelectedBlockClientId,\n\t\t\tgetBlockRootClientId,\n\t\t\tgetSettings,\n\t\t} = select( blockEditorStore );\n\n\t\tconst selectedId = getSelectedBlockClientId();\n\t\tconst selectionIsNested = !! getBlockRootClientId( selectedId );\n\t\tconst globalStyles = getSettings()?.__experimentalGlobalStylesBaseStyles\n\t\t\t?.color;\n\n\t\treturn {\n\t\t\tpostType: getEditedPostAttribute( 'type' ),\n\t\t\tisAnyBlockSelected: !! selectedId,\n\t\t\tisSelected: isPostTitleSelected(),\n\t\t\tisDimmed: selectionIsNested,\n\t\t\tglobalStyles,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { undo, redo, togglePostTitleSelection } = dispatch(\n\t\t\teditorStore\n\t\t);\n\n\t\tconst { clearSelectedBlock, insertDefaultBlock } = dispatch(\n\t\t\tblockEditorStore\n\t\t);\n\n\t\treturn {\n\t\t\tonEnterPress() {\n\t\t\t\tinsertDefaultBlock( undefined, undefined, 0 );\n\t\t\t},\n\t\t\tonUndo: undo,\n\t\t\tonRedo: redo,\n\t\t\tonSelect() {\n\t\t\t\ttogglePostTitleSelection( true );\n\t\t\t\tclearSelectedBlock();\n\t\t\t},\n\t\t\tonUnselect() {\n\t\t\t\ttogglePostTitleSelection( false );\n\t\t\t},\n\t\t};\n\t} ),\n\twithInstanceId,\n\twithFocusOutside\n)( PostTitle );\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/post-title/index.native.js"],"names":["PostTitle","Component","constructor","props","setRef","bind","componentDidUpdate","prevProps","isSelected","isAnyBlockSelected","richTextRef","blur","onUnselect","componentDidMount","innerRef","handleFocusOutside","focus","onSelect","onPaste","value","onChange","plainText","content","mode","tagName","valueToInsert","html","richText","getTitle","title","postType","render","placeholder","style","focusedBorderColor","borderStyle","isDimmed","globalStyles","decodedPlaceholder","borderColor","titleStyles","text","color","placeholderColor","styles","titleContainer","dimmed","onBlur","onUpdate","onEnterPress","select","isPostTitleSelected","getEditedPostAttribute","editorStore","getSelectedBlockClientId","getBlockRootClientId","getSettings","blockEditorStore","selectedId","selectionIsNested","__experimentalGlobalStylesBaseStyles","dispatch","undo","redo","togglePostTitleSelection","clearSelectedBlock","insertDefaultBlock","undefined","onUndo","onRedo","withInstanceId","withFocusOutside"],"mappings":";;;;;;;;;AASA;;AANA;;AACA;;AAMA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AA3BA;AACA;AACA;;AAIA;AACA;AACA;;AAgBA;AACA;AACA;AAGA,MAAMA,SAAN,SAAwBC,kBAAxB,CAAkC;AACjCC,EAAAA,WAAW,CAAEC,KAAF,EAAU;AACpB,UAAOA,KAAP;AAEA,SAAKC,MAAL,GAAc,KAAKA,MAAL,CAAYC,IAAZ,CAAkB,IAAlB,CAAd;AACA;;AACDC,EAAAA,kBAAkB,CAAEC,SAAF,EAAc;AAC/B;AACA,QACC,KAAKJ,KAAL,CAAWK,UAAX,IACA,CAAED,SAAS,CAACE,kBADZ,IAEA,KAAKN,KAAL,CAAWM,kBAHZ,EAIE;AACD,UAAK,KAAKC,WAAV,EAAwB;AACvB,aAAKA,WAAL,CAAiBC,IAAjB;AACA;;AACD,WAAKR,KAAL,CAAWS,UAAX;AACA;AACD;;AAEDC,EAAAA,iBAAiB,GAAG;AACnB,QAAK,KAAKV,KAAL,CAAWW,QAAhB,EAA2B;AAC1B,WAAKX,KAAL,CAAWW,QAAX,CAAqB,IAArB;AACA;AACD;;AAEDC,EAAAA,kBAAkB,GAAG;AACpB,SAAKZ,KAAL,CAAWS,UAAX;AACA;;AAEDI,EAAAA,KAAK,GAAG;AACP,SAAKb,KAAL,CAAWc,QAAX;AACA;;AAEDC,EAAAA,OAAO,OAAmC;AAAA,QAAjC;AAAEC,MAAAA,KAAF;AAASC,MAAAA,QAAT;AAAmBC,MAAAA;AAAnB,KAAi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AA,kBAAkB,CAAEC,SAAF,EAAaA,SAAb,EAAwB,CAAxB,CAAlB;AACA,KAHK;;AAINC,IAAAA,MAAM,EAAEN,IAJF;AAKNO,IAAAA,MAAM,EAAEN,IALF;;AAMN9C,IAAAA,QAAQ,GAAG;AACV+C,MAAAA,wBAAwB,CAAE,IAAF,CAAxB;AACAC,MAAAA,kBAAkB;AAClB,KATK;;AAUNrD,IAAAA,UAAU,GAAG;AACZoD,MAAAA,wBAAwB,CAAE,KAAF,CAAxB;AACA;;AAZK,GAAP;AAcA,CAvBD,CAxBc,EAgDdM,uBAhDc,EAiDdC,4BAjDc,EAkDZvE,SAlDY,C","sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\nimport { isEmpty } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport {\n\t__experimentalRichText as RichText,\n\tcreate,\n\tinsert,\n} from '@wordpress/rich-text';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { withFocusOutside } from '@wordpress/components';\nimport { withInstanceId, compose } from '@wordpress/compose';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { pasteHandler } from '@wordpress/blocks';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nclass PostTitle extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\n\t\tthis.setRef = this.setRef.bind( this );\n\t}\n\tcomponentDidUpdate( prevProps ) {\n\t\t// Unselect if any other block is selected and blur the RichText\n\t\tif (\n\t\t\tthis.props.isSelected &&\n\t\t\t! prevProps.isAnyBlockSelected &&\n\t\t\tthis.props.isAnyBlockSelected\n\t\t) {\n\t\t\tif ( this.richTextRef ) {\n\t\t\t\tthis.richTextRef.blur();\n\t\t\t}\n\t\t\tthis.props.onUnselect();\n\t\t}\n\t}\n\n\tcomponentDidMount() {\n\t\tif ( this.props.innerRef ) {\n\t\t\tthis.props.innerRef( this );\n\t\t}\n\t}\n\n\thandleFocusOutside() {\n\t\tthis.props.onUnselect();\n\t}\n\n\tfocus() {\n\t\tthis.props.onSelect();\n\t}\n\n\tonPaste( { value, onChange, plainText } ) {\n\t\tconst content = pasteHandler( {\n\t\t\tplainText,\n\t\t\tmode: 'INLINE',\n\t\t\ttagName: 'p',\n\t\t} );\n\n\t\tif ( typeof content === 'string' ) {\n\t\t\tconst valueToInsert = create( { html: content } );\n\t\t\tonChange( insert( value, valueToInsert ) );\n\t\t}\n\t}\n\n\tsetRef( richText ) {\n\t\tthis.richTextRef = richText;\n\t}\n\n\tgetTitle( title, postType ) {\n\t\tif ( 'page' === postType ) {\n\t\t\treturn isEmpty( title )\n\t\t\t\t? /* translators: accessibility text. empty page title. */\n\t\t\t\t __( 'Page title. Empty' )\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t/* translators: accessibility text. %s: text content of the page title. */\n\t\t\t\t\t\t__( 'Page title. %s' ),\n\t\t\t\t\t\ttitle\n\t\t\t\t );\n\t\t}\n\n\t\treturn isEmpty( title )\n\t\t\t? /* translators: accessibility text. empty post title. */\n\t\t\t __( 'Post title. Empty' )\n\t\t\t: sprintf(\n\t\t\t\t\t/* translators: accessibility text. %s: text content of the post title. */\n\t\t\t\t\t__( 'Post title. %s' ),\n\t\t\t\t\ttitle\n\t\t\t );\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tplaceholder,\n\t\t\tstyle,\n\t\t\ttitle,\n\t\t\tfocusedBorderColor,\n\t\t\tborderStyle,\n\t\t\tisDimmed,\n\t\t\tpostType,\n\t\t\tglobalStyles,\n\t\t} = this.props;\n\n\t\tconst decodedPlaceholder = decodeEntities( placeholder );\n\t\tconst borderColor = this.props.isSelected\n\t\t\t? focusedBorderColor\n\t\t\t: 'transparent';\n\t\tconst titleStyles = {\n\t\t\t...style,\n\t\t\t...( globalStyles?.text && {\n\t\t\t\tcolor: globalStyles.text,\n\t\t\t\tplaceholderColor: globalStyles.text,\n\t\t\t} ),\n\t\t};\n\n\t\treturn (\n\t\t\t<View\n\t\t\t\tstyle={ [\n\t\t\t\t\tstyles.titleContainer,\n\t\t\t\t\tborderStyle,\n\t\t\t\t\t{ borderColor },\n\t\t\t\t\tisDimmed && styles.dimmed,\n\t\t\t\t] }\n\t\t\t\taccessible={ ! this.props.isSelected }\n\t\t\t\taccessibilityLabel={ this.getTitle( title, postType ) }\n\t\t\t\taccessibilityHint={ __( 'Updates the title.' ) }\n\t\t\t>\n\t\t\t\t<RichText\n\t\t\t\t\tsetRef={ this.setRef }\n\t\t\t\t\taccessibilityLabel={ this.getTitle( title, postType ) }\n\t\t\t\t\ttagName={ 'p' }\n\t\t\t\t\ttagsToEliminate={ [ 'strong' ] }\n\t\t\t\t\tunstableOnFocus={ this.props.onSelect }\n\t\t\t\t\tonBlur={ this.props.onBlur } // always assign onBlur as a props\n\t\t\t\t\tmultiline={ false }\n\t\t\t\t\tstyle={ titleStyles }\n\t\t\t\t\tstyles={ styles }\n\t\t\t\t\tfontSize={ 24 }\n\t\t\t\t\tlineHeight={ 1 }\n\t\t\t\t\tfontWeight={ 'bold' }\n\t\t\t\t\tdeleteEnter={ true }\n\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\tthis.props.onUpdate( value );\n\t\t\t\t\t} }\n\t\t\t\t\tonPaste={ this.onPaste }\n\t\t\t\t\tplaceholder={ decodedPlaceholder }\n\t\t\t\t\tvalue={ title }\n\t\t\t\t\tonSelectionChange={ () => {} }\n\t\t\t\t\tonEnter={ this.props.onEnterPress }\n\t\t\t\t\tdisableEditingMenu={ true }\n\t\t\t\t\t__unstableIsSelected={ this.props.isSelected }\n\t\t\t\t\t__unstableOnCreateUndoLevel={ () => {} }\n\t\t\t\t></RichText>\n\t\t\t</View>\n\t\t);\n\t}\n}\n\nexport default compose(\n\twithSelect( ( select ) => {\n\t\tconst { isPostTitleSelected, getEditedPostAttribute } = select(\n\t\t\teditorStore\n\t\t);\n\t\tconst {\n\t\t\tgetSelectedBlockClientId,\n\t\t\tgetBlockRootClientId,\n\t\t\tgetSettings,\n\t\t} = select( blockEditorStore );\n\n\t\tconst selectedId = getSelectedBlockClientId();\n\t\tconst selectionIsNested = !! getBlockRootClientId( selectedId );\n\t\tconst globalStyles = getSettings()?.__experimentalGlobalStylesBaseStyles\n\t\t\t?.color;\n\n\t\treturn {\n\t\t\tpostType: getEditedPostAttribute( 'type' ),\n\t\t\tisAnyBlockSelected: !! selectedId,\n\t\t\tisSelected: isPostTitleSelected(),\n\t\t\tisDimmed: selectionIsNested,\n\t\t\tglobalStyles,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { undo, redo, togglePostTitleSelection } = dispatch(\n\t\t\teditorStore\n\t\t);\n\n\t\tconst { clearSelectedBlock, insertDefaultBlock } = dispatch(\n\t\t\tblockEditorStore\n\t\t);\n\n\t\treturn {\n\t\t\tonEnterPress() {\n\t\t\t\tinsertDefaultBlock( undefined, undefined, 0 );\n\t\t\t},\n\t\t\tonUndo: undo,\n\t\t\tonRedo: redo,\n\t\t\tonSelect() {\n\t\t\t\ttogglePostTitleSelection( true );\n\t\t\t\tclearSelectedBlock();\n\t\t\t},\n\t\t\tonUnselect() {\n\t\t\t\ttogglePostTitleSelection( false );\n\t\t\t},\n\t\t};\n\t} ),\n\twithInstanceId,\n\twithFocusOutside\n)( PostTitle );\n"]}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
@@ -7,6 +9,8 @@ exports.default = exports.PostVisibility = void 0;
|
|
|
7
9
|
|
|
8
10
|
var _element = require("@wordpress/element");
|
|
9
11
|
|
|
12
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
+
|
|
10
14
|
var _i18n = require("@wordpress/i18n");
|
|
11
15
|
|
|
12
16
|
var _components = require("@wordpress/components");
|
|
@@ -29,12 +33,30 @@ var _store = require("../../store");
|
|
|
29
33
|
class PostVisibility extends _element.Component {
|
|
30
34
|
constructor(props) {
|
|
31
35
|
super(...arguments);
|
|
36
|
+
(0, _defineProperty2.default)(this, "confirmPrivate", () => {
|
|
37
|
+
const {
|
|
38
|
+
onUpdateVisibility,
|
|
39
|
+
onSave
|
|
40
|
+
} = this.props;
|
|
41
|
+
onUpdateVisibility('private');
|
|
42
|
+
this.setState({
|
|
43
|
+
hasPassword: false,
|
|
44
|
+
showPrivateConfirmDialog: false
|
|
45
|
+
});
|
|
46
|
+
onSave();
|
|
47
|
+
});
|
|
48
|
+
(0, _defineProperty2.default)(this, "handleDialogCancel", () => {
|
|
49
|
+
this.setState({
|
|
50
|
+
showPrivateConfirmDialog: false
|
|
51
|
+
});
|
|
52
|
+
});
|
|
32
53
|
this.setPublic = this.setPublic.bind(this);
|
|
33
54
|
this.setPrivate = this.setPrivate.bind(this);
|
|
34
55
|
this.setPasswordProtected = this.setPasswordProtected.bind(this);
|
|
35
56
|
this.updatePassword = this.updatePassword.bind(this);
|
|
36
57
|
this.state = {
|
|
37
|
-
hasPassword: !!props.password
|
|
58
|
+
hasPassword: !!props.password,
|
|
59
|
+
showPrivateConfirmDialog: false
|
|
38
60
|
};
|
|
39
61
|
}
|
|
40
62
|
|
|
@@ -51,20 +73,9 @@ class PostVisibility extends _element.Component {
|
|
|
51
73
|
}
|
|
52
74
|
|
|
53
75
|
setPrivate() {
|
|
54
|
-
if ( // eslint-disable-next-line no-alert
|
|
55
|
-
!window.confirm((0, _i18n.__)('Would you like to privately publish this post now?'))) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const {
|
|
60
|
-
onUpdateVisibility,
|
|
61
|
-
onSave
|
|
62
|
-
} = this.props;
|
|
63
|
-
onUpdateVisibility('private');
|
|
64
76
|
this.setState({
|
|
65
|
-
|
|
77
|
+
showPrivateConfirmDialog: true
|
|
66
78
|
});
|
|
67
|
-
onSave();
|
|
68
79
|
}
|
|
69
80
|
|
|
70
81
|
setPasswordProtected() {
|
|
@@ -151,7 +162,12 @@ class PostVisibility extends _element.Component {
|
|
|
151
162
|
onChange: this.updatePassword,
|
|
152
163
|
value: password,
|
|
153
164
|
placeholder: (0, _i18n.__)('Use a secure password')
|
|
154
|
-
}))
|
|
165
|
+
})), (0, _element.createElement)(_components.__experimentalConfirmDialog, {
|
|
166
|
+
key: "private-publish-confirmation",
|
|
167
|
+
isOpen: this.state.showPrivateConfirmDialog,
|
|
168
|
+
onConfirm: this.confirmPrivate,
|
|
169
|
+
onCancel: this.handleDialogCancel
|
|
170
|
+
}, (0, _i18n.__)('Would you like to privately publish this post now?'))];
|
|
155
171
|
}
|
|
156
172
|
|
|
157
173
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/components/post-visibility/index.js"],"names":["PostVisibility","Component","constructor","props","arguments","setPublic","bind","setPrivate","setPasswordProtected","updatePassword","state","hasPassword","password","visibility","onUpdateVisibility","status","setState","window","confirm","onSave","event","target","value","render","instanceId","visibilityHandlers","public","onSelect","checked","private","visibilityOptions","map","label","info","select","getEditedPostAttribute","getEditedPostVisibility","editorStore","dispatch","savePost","editPost","withInstanceId"],"mappings":";;;;;;;AAIA;;AADA;;AAEA;;AACA;;AACA;;AAKA;;AACA;;AAbA;AACA;AACA;;AAOA;AACA;AACA;AAIO,MAAMA,cAAN,SAA6BC,kBAA7B,CAAuC;AAC7CC,EAAAA,WAAW,CAAEC,KAAF,EAAU;AACpB,UAAO,GAAGC,SAAV;AAEA,SAAKC,SAAL,GAAiB,KAAKA,SAAL,CAAeC,IAAf,CAAqB,IAArB,CAAjB;AACA,SAAKC,UAAL,GAAkB,KAAKA,UAAL,CAAgBD,IAAhB,CAAsB,IAAtB,CAAl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AAEuB,sBAAsB,CAAE,UAAF;AAH1B,GAAP;AAKA,CATD,CADuB,EAWvB,wBAAgBG,QAAF,IAAgB;AAC7B,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,MAAyBF,QAAQ,CAAED,YAAF,CAAvC;AACA,SAAO;AACNlB,IAAAA,MAAM,EAAEoB,QADF;;AAENzB,IAAAA,kBAAkB,CAAEC,MAAF,EAA0B;AAAA,UAAhBH,QAAgB,uEAAL,EAAK;AAC3C4B,MAAAA,QAAQ,CAAE;AAAEzB,QAAAA,MAAF;AAAUH,QAAAA;AAAV,OAAF,CAAR;AACA;;AAJK,GAAP;AAMA,CARD,CAXuB,EAoBvB6B,uBApBuB,CAAT,EAqBVzC,cArBU,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Component } from '@wordpress/element';\nimport { VisuallyHidden } from '@wordpress/components';\nimport { withInstanceId, compose } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { visibilityOptions } from './utils';\nimport { store as editorStore } from '../../store';\n\nexport class PostVisibility extends Component {\n\tconstructor( props ) {\n\t\tsuper( ...arguments );\n\n\t\tthis.setPublic = this.setPublic.bind( this );\n\t\tthis.setPrivate = this.setPrivate.bind( this );\n\t\tthis.setPasswordProtected = this.setPasswordProtected.bind( this );\n\t\tthis.updatePassword = this.updatePassword.bind( this );\n\n\t\tthis.state = {\n\t\t\thasPassword: !! props.password,\n\t\t};\n\t}\n\n\tsetPublic() {\n\t\tconst { visibility, onUpdateVisibility, status } = this.props;\n\n\t\tonUpdateVisibility( visibility === 'private' ? 'draft' : status );\n\t\tthis.setState( { hasPassword: false } );\n\t}\n\n\tsetPrivate() {\n\t\tif (\n\t\t\t// eslint-disable-next-line no-alert\n\t\t\t! window.confirm(\n\t\t\t\t__( 'Would you like to privately publish this post now?' )\n\t\t\t)\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { onUpdateVisibility, onSave } = this.props;\n\n\t\tonUpdateVisibility( 'private' );\n\t\tthis.setState( { hasPassword: false } );\n\t\tonSave();\n\t}\n\n\tsetPasswordProtected() {\n\t\tconst { visibility, onUpdateVisibility, status, password } = this.props;\n\n\t\tonUpdateVisibility(\n\t\t\tvisibility === 'private' ? 'draft' : status,\n\t\t\tpassword || ''\n\t\t);\n\t\tthis.setState( { hasPassword: true } );\n\t}\n\n\tupdatePassword( event ) {\n\t\tconst { status, onUpdateVisibility } = this.props;\n\t\tonUpdateVisibility( status, event.target.value );\n\t}\n\n\trender() {\n\t\tconst { visibility, password, instanceId } = this.props;\n\n\t\tconst visibilityHandlers = {\n\t\t\tpublic: {\n\t\t\t\tonSelect: this.setPublic,\n\t\t\t\tchecked: visibility === 'public' && ! this.state.hasPassword,\n\t\t\t},\n\t\t\tprivate: {\n\t\t\t\tonSelect: this.setPrivate,\n\t\t\t\tchecked: visibility === 'private',\n\t\t\t},\n\t\t\tpassword: {\n\t\t\t\tonSelect: this.setPasswordProtected,\n\t\t\t\tchecked: this.state.hasPassword,\n\t\t\t},\n\t\t};\n\n\t\treturn [\n\t\t\t<fieldset\n\t\t\t\tkey=\"visibility-selector\"\n\t\t\t\tclassName=\"editor-post-visibility__dialog-fieldset\"\n\t\t\t>\n\t\t\t\t<legend className=\"editor-post-visibility__dialog-legend\">\n\t\t\t\t\t{ __( 'Post Visibility' ) }\n\t\t\t\t</legend>\n\t\t\t\t{ visibilityOptions.map( ( { value, label, info } ) => (\n\t\t\t\t\t<div\n\t\t\t\t\t\tkey={ value }\n\t\t\t\t\t\tclassName=\"editor-post-visibility__choice\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\t\tname={ `editor-post-visibility__setting-${ instanceId }` }\n\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\tonChange={ visibilityHandlers[ value ].onSelect }\n\t\t\t\t\t\t\tchecked={ visibilityHandlers[ value ].checked }\n\t\t\t\t\t\t\tid={ `editor-post-${ value }-${ instanceId }` }\n\t\t\t\t\t\t\taria-describedby={ `editor-post-${ value }-${ instanceId }-description` }\n\t\t\t\t\t\t\tclassName=\"editor-post-visibility__dialog-radio\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<label\n\t\t\t\t\t\t\thtmlFor={ `editor-post-${ value }-${ instanceId }` }\n\t\t\t\t\t\t\tclassName=\"editor-post-visibility__dialog-label\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</label>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t<p\n\t\t\t\t\t\t\t\tid={ `editor-post-${ value }-${ instanceId }-description` }\n\t\t\t\t\t\t\t\tclassName=\"editor-post-visibility__dialog-info\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ info }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>\n\t\t\t\t) ) }\n\t\t\t</fieldset>,\n\t\t\tthis.state.hasPassword && (\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"editor-post-visibility__dialog-password\"\n\t\t\t\t\tkey=\"password-selector\"\n\t\t\t\t>\n\t\t\t\t\t<VisuallyHidden\n\t\t\t\t\t\tas=\"label\"\n\t\t\t\t\t\thtmlFor={ `editor-post-visibility__dialog-password-input-${ instanceId }` }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Create password' ) }\n\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t<input\n\t\t\t\t\t\tclassName=\"editor-post-visibility__dialog-password-input\"\n\t\t\t\t\t\tid={ `editor-post-visibility__dialog-password-input-${ instanceId }` }\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tonChange={ this.updatePassword }\n\t\t\t\t\t\tvalue={ password }\n\t\t\t\t\t\tplaceholder={ __( 'Use a secure password' ) }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t),\n\t\t];\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute, getEditedPostVisibility } = select(\n\t\t\teditorStore\n\t\t);\n\t\treturn {\n\t\t\tstatus: getEditedPostAttribute( 'status' ),\n\t\t\tvisibility: getEditedPostVisibility(),\n\t\t\tpassword: getEditedPostAttribute( 'password' ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { savePost, editPost } = dispatch( editorStore );\n\t\treturn {\n\t\t\tonSave: savePost,\n\t\t\tonUpdateVisibility( status, password = '' ) {\n\t\t\t\teditPost( { status, password } );\n\t\t\t},\n\t\t};\n\t} ),\n\twithInstanceId,\n] )( PostVisibility );\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/components/post-visibility/index.js"],"names":["PostVisibility","Component","constructor","props","arguments","onUpdateVisibility","onSave","setState","hasPassword","showPrivateConfirmDialog","setPublic","bind","setPrivate","setPasswordProtected","updatePassword","state","password","visibility","status","event","target","value","render","instanceId","visibilityHandlers","public","onSelect","checked","private","visibilityOptions","map","label","info","confirmPrivate","handleDialogCancel","select","getEditedPostAttribute","getEditedPostVisibility","editorStore","dispatch","savePost","editPost","withInstanceId"],"mappings":";;;;;;;;;AAIA;;;;AADA;;AAEA;;AAIA;;AACA;;AAKA;;AACA;;AAhBA;AACA;AACA;;AAUA;AACA;AACA;AAIO,MAAMA,cAAN,SAA6BC,kBAA7B,CAAuC;AAC7CC,EAAAA,WAAW,CAAEC,KAAF,EAAU;AACpB,UAAO,GAAGC,SAAV;AADoB,0DAyBJ,MAAM;AACtB,YAAM;AAAEC,QAAAA,kBAAF;AAAsBC,QAAAA;AAAtB,UAAiC,KAAKH,KAA5C;AAEAE,MAAAA,kBAAkB,CAAE,SAAF,CAAlB;AACA,WAAKE,QAAL,CAAe;AACdC,QAAAA,WAAW,EAAE,KADC;AAEdC,QAAAA,wBAAwB,EAAE;AAFZ,OAAf;AAIAH,MAAAA,MAAM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EA;;AAhJ4C;;;;eAmJ/B,sBAAS,CACvB,sBAAcC,MAAF,IAAc;AACzB,QAAM;AAAEC,IAAAA,sBAAF;AAA0BC,IAAAA;AAA1B,MAAsDF,MAAM,CACjEG,YADiE,CAAlE;AAGA,SAAO;AACNpB,IAAAA,MAAM,EAAEkB,sBAAsB,CAAE,QAAF,CADxB;AAENnB,IAAAA,UAAU,EAAEoB,uBAAuB,EAF7B;AAGNrB,IAAAA,QAAQ,EAAEoB,sBAAsB,CAAE,UAAF;AAH1B,GAAP;AAKA,CATD,CADuB,EAWvB,wBAAgBG,QAAF,IAAgB;AAC7B,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,MAAyBF,QAAQ,CAAED,YAAF,CAAvC;AACA,SAAO;AACNhC,IAAAA,MAAM,EAAEkC,QADF;;AAENnC,IAAAA,kBAAkB,CAAEa,MAAF,EAA0B;AAAA,UAAhBF,QAAgB,uEAAL,EAAK;AAC3CyB,MAAAA,QAAQ,CAAE;AAAEvB,QAAAA,MAAF;AAAUF,QAAAA;AAAV,OAAF,CAAR;AACA;;AAJK,GAAP;AAMA,CARD,CAXuB,EAoBvB0B,uBApBuB,CAAT,EAqBV1C,cArBU,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Component } from '@wordpress/element';\nimport {\n\tVisuallyHidden,\n\t__experimentalConfirmDialog as ConfirmDialog,\n} from '@wordpress/components';\nimport { withInstanceId, compose } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { visibilityOptions } from './utils';\nimport { store as editorStore } from '../../store';\n\nexport class PostVisibility extends Component {\n\tconstructor( props ) {\n\t\tsuper( ...arguments );\n\n\t\tthis.setPublic = this.setPublic.bind( this );\n\t\tthis.setPrivate = this.setPrivate.bind( this );\n\t\tthis.setPasswordProtected = this.setPasswordProtected.bind( this );\n\t\tthis.updatePassword = this.updatePassword.bind( this );\n\n\t\tthis.state = {\n\t\t\thasPassword: !! props.password,\n\t\t\tshowPrivateConfirmDialog: false,\n\t\t};\n\t}\n\n\tsetPublic() {\n\t\tconst { visibility, onUpdateVisibility, status } = this.props;\n\n\t\tonUpdateVisibility( visibility === 'private' ? 'draft' : status );\n\t\tthis.setState( { hasPassword: false } );\n\t}\n\n\tsetPrivate() {\n\t\tthis.setState( { showPrivateConfirmDialog: true } );\n\t}\n\n\tconfirmPrivate = () => {\n\t\tconst { onUpdateVisibility, onSave } = this.props;\n\n\t\tonUpdateVisibility( 'private' );\n\t\tthis.setState( {\n\t\t\thasPassword: false,\n\t\t\tshowPrivateConfirmDialog: false,\n\t\t} );\n\t\tonSave();\n\t};\n\n\thandleDialogCancel = () => {\n\t\tthis.setState( { showPrivateConfirmDialog: false } );\n\t};\n\n\tsetPasswordProtected() {\n\t\tconst { visibility, onUpdateVisibility, status, password } = this.props;\n\n\t\tonUpdateVisibility(\n\t\t\tvisibility === 'private' ? 'draft' : status,\n\t\t\tpassword || ''\n\t\t);\n\t\tthis.setState( { hasPassword: true } );\n\t}\n\n\tupdatePassword( event ) {\n\t\tconst { status, onUpdateVisibility } = this.props;\n\t\tonUpdateVisibility( status, event.target.value );\n\t}\n\n\trender() {\n\t\tconst { visibility, password, instanceId } = this.props;\n\n\t\tconst visibilityHandlers = {\n\t\t\tpublic: {\n\t\t\t\tonSelect: this.setPublic,\n\t\t\t\tchecked: visibility === 'public' && ! this.state.hasPassword,\n\t\t\t},\n\t\t\tprivate: {\n\t\t\t\tonSelect: this.setPrivate,\n\t\t\t\tchecked: visibility === 'private',\n\t\t\t},\n\t\t\tpassword: {\n\t\t\t\tonSelect: this.setPasswordProtected,\n\t\t\t\tchecked: this.state.hasPassword,\n\t\t\t},\n\t\t};\n\n\t\treturn [\n\t\t\t<fieldset\n\t\t\t\tkey=\"visibility-selector\"\n\t\t\t\tclassName=\"editor-post-visibility__dialog-fieldset\"\n\t\t\t>\n\t\t\t\t<legend className=\"editor-post-visibility__dialog-legend\">\n\t\t\t\t\t{ __( 'Post Visibility' ) }\n\t\t\t\t</legend>\n\t\t\t\t{ visibilityOptions.map( ( { value, label, info } ) => (\n\t\t\t\t\t<div\n\t\t\t\t\t\tkey={ value }\n\t\t\t\t\t\tclassName=\"editor-post-visibility__choice\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<input\n\t\t\t\t\t\t\ttype=\"radio\"\n\t\t\t\t\t\t\tname={ `editor-post-visibility__setting-${ instanceId }` }\n\t\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\t\tonChange={ visibilityHandlers[ value ].onSelect }\n\t\t\t\t\t\t\tchecked={ visibilityHandlers[ value ].checked }\n\t\t\t\t\t\t\tid={ `editor-post-${ value }-${ instanceId }` }\n\t\t\t\t\t\t\taria-describedby={ `editor-post-${ value }-${ instanceId }-description` }\n\t\t\t\t\t\t\tclassName=\"editor-post-visibility__dialog-radio\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<label\n\t\t\t\t\t\t\thtmlFor={ `editor-post-${ value }-${ instanceId }` }\n\t\t\t\t\t\t\tclassName=\"editor-post-visibility__dialog-label\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t</label>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t<p\n\t\t\t\t\t\t\t\tid={ `editor-post-${ value }-${ instanceId }-description` }\n\t\t\t\t\t\t\t\tclassName=\"editor-post-visibility__dialog-info\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ info }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>\n\t\t\t\t) ) }\n\t\t\t</fieldset>,\n\t\t\tthis.state.hasPassword && (\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"editor-post-visibility__dialog-password\"\n\t\t\t\t\tkey=\"password-selector\"\n\t\t\t\t>\n\t\t\t\t\t<VisuallyHidden\n\t\t\t\t\t\tas=\"label\"\n\t\t\t\t\t\thtmlFor={ `editor-post-visibility__dialog-password-input-${ instanceId }` }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Create password' ) }\n\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t<input\n\t\t\t\t\t\tclassName=\"editor-post-visibility__dialog-password-input\"\n\t\t\t\t\t\tid={ `editor-post-visibility__dialog-password-input-${ instanceId }` }\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tonChange={ this.updatePassword }\n\t\t\t\t\t\tvalue={ password }\n\t\t\t\t\t\tplaceholder={ __( 'Use a secure password' ) }\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t),\n\t\t\t<ConfirmDialog\n\t\t\t\tkey=\"private-publish-confirmation\"\n\t\t\t\tisOpen={ this.state.showPrivateConfirmDialog }\n\t\t\t\tonConfirm={ this.confirmPrivate }\n\t\t\t\tonCancel={ this.handleDialogCancel }\n\t\t\t>\n\t\t\t\t{ __( 'Would you like to privately publish this post now?' ) }\n\t\t\t</ConfirmDialog>,\n\t\t];\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute, getEditedPostVisibility } = select(\n\t\t\teditorStore\n\t\t);\n\t\treturn {\n\t\t\tstatus: getEditedPostAttribute( 'status' ),\n\t\t\tvisibility: getEditedPostVisibility(),\n\t\t\tpassword: getEditedPostAttribute( 'password' ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { savePost, editPost } = dispatch( editorStore );\n\t\treturn {\n\t\t\tonSave: savePost,\n\t\t\tonUpdateVisibility( status, password = '' ) {\n\t\t\t\teditPost( { status, password } );\n\t\t\t},\n\t\t};\n\t} ),\n\twithInstanceId,\n] )( PostVisibility );\n"]}
|
package/build/store/actions.js
CHANGED
|
@@ -291,20 +291,21 @@ function* savePost() {
|
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
293
|
/**
|
|
294
|
-
* Action
|
|
294
|
+
* Action for refreshing the current post.
|
|
295
|
+
*
|
|
296
|
+
* @deprecated Since WordPress 6.0.
|
|
295
297
|
*/
|
|
296
298
|
|
|
297
299
|
|
|
298
|
-
function
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
// Timestamp arg allows caller to bypass browser caching, which is
|
|
304
|
-
// expected for this specific function.
|
|
305
|
-
path: `/wp/v2/${postType.rest_base}/${post.id}` + `?context=edit&_timestamp=${Date.now()}`
|
|
300
|
+
function refreshPost() {
|
|
301
|
+
(0, _deprecated.default)("wp.data.dispatch( 'core/editor' ).refreshPost", {
|
|
302
|
+
since: '6.0',
|
|
303
|
+
version: '6.3',
|
|
304
|
+
alternative: 'Use the core entities store instead'
|
|
306
305
|
});
|
|
307
|
-
|
|
306
|
+
return {
|
|
307
|
+
type: 'DO_NOTHING'
|
|
308
|
+
};
|
|
308
309
|
}
|
|
309
310
|
/**
|
|
310
311
|
* Action generator for trashing the current post in the editor.
|
|
@@ -388,16 +389,20 @@ function* undo() {
|
|
|
388
389
|
yield _data.controls.dispatch(_coreData.store, 'undo');
|
|
389
390
|
}
|
|
390
391
|
/**
|
|
391
|
-
*
|
|
392
|
-
* be created.
|
|
392
|
+
* Action that creates an undo history record.
|
|
393
393
|
*
|
|
394
|
-
* @
|
|
394
|
+
* @deprecated Since WordPress 6.0
|
|
395
395
|
*/
|
|
396
396
|
|
|
397
397
|
|
|
398
398
|
function createUndoLevel() {
|
|
399
|
+
(0, _deprecated.default)("wp.data.dispatch( 'core/editor' ).createUndoLevel", {
|
|
400
|
+
since: '6.0',
|
|
401
|
+
version: '6.3',
|
|
402
|
+
alternative: 'Use the core entities store instead'
|
|
403
|
+
});
|
|
399
404
|
return {
|
|
400
|
-
type: '
|
|
405
|
+
type: 'DO_NOTHING'
|
|
401
406
|
};
|
|
402
407
|
}
|
|
403
408
|
/**
|