@wordpress/editor 12.0.4 → 12.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/autocompleters/user.js +1 -1
- package/build/components/autosave-monitor/index.js +2 -1
- package/build/components/autosave-monitor/index.js.map +1 -1
- package/build/components/deprecated.js +6 -4
- package/build/components/deprecated.js.map +1 -1
- package/build/components/deprecated.native.js +26 -26
- package/build/components/document-outline/check.js +5 -4
- package/build/components/document-outline/check.js.map +1 -1
- package/build/components/document-outline/index.js +13 -9
- package/build/components/document-outline/index.js.map +1 -1
- package/build/components/document-outline/item.js +25 -22
- package/build/components/document-outline/item.js.map +1 -1
- package/build/components/editor-help/help-detail-navigation-screen.native.js +5 -4
- package/build/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
- package/build/components/editor-help/help-get-support-button.native.js +5 -4
- package/build/components/editor-help/help-get-support-button.native.js.map +1 -1
- package/build/components/editor-help/help-topic-row.native.js +6 -5
- package/build/components/editor-help/help-topic-row.native.js.map +1 -1
- package/build/components/editor-help/index.native.js +21 -16
- package/build/components/editor-help/index.native.js.map +1 -1
- package/build/components/editor-help/view-sections.native.js +16 -13
- package/build/components/editor-help/view-sections.native.js.map +1 -1
- package/build/components/editor-notices/index.js +5 -4
- package/build/components/editor-notices/index.js.map +1 -1
- package/build/components/entities-saved-states/entity-record-item.js +7 -6
- package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
- package/build/components/entities-saved-states/entity-type-list.js +7 -6
- package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build/components/entities-saved-states/index.js +31 -22
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/error-boundary/index.js +5 -4
- package/build/components/error-boundary/index.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/save-shortcut.js +4 -3
- package/build/components/global-keyboard-shortcuts/save-shortcut.js.map +1 -1
- package/build/components/index.js +22 -22
- package/build/components/index.native.js +4 -4
- package/build/components/page-attributes/check.js +4 -3
- package/build/components/page-attributes/check.js.map +1 -1
- package/build/components/page-attributes/order.js +5 -4
- package/build/components/page-attributes/order.js.map +1 -1
- package/build/components/page-attributes/parent.js +6 -3
- package/build/components/page-attributes/parent.js.map +1 -1
- package/build/components/post-author/check.js +4 -3
- package/build/components/post-author/check.js.map +1 -1
- package/build/components/post-author/combobox.js +6 -3
- package/build/components/post-author/combobox.js.map +1 -1
- package/build/components/post-comments/index.js +6 -4
- package/build/components/post-comments/index.js.map +1 -1
- package/build/components/post-excerpt/index.js +5 -4
- package/build/components/post-excerpt/index.js.map +1 -1
- package/build/components/post-featured-image/index.js +51 -41
- package/build/components/post-featured-image/index.js.map +1 -1
- package/build/components/post-format/check.js +5 -4
- package/build/components/post-format/check.js.map +1 -1
- package/build/components/post-format/index.js +1 -1
- package/build/components/post-last-revision/check.js +7 -5
- package/build/components/post-last-revision/check.js.map +1 -1
- package/build/components/post-last-revision/index.js +5 -4
- package/build/components/post-last-revision/index.js.map +1 -1
- package/build/components/post-pending-status/check.js +7 -5
- package/build/components/post-pending-status/check.js.map +1 -1
- package/build/components/post-pending-status/index.js +6 -4
- package/build/components/post-pending-status/index.js.map +1 -1
- package/build/components/post-pingbacks/index.js +6 -4
- package/build/components/post-pingbacks/index.js.map +1 -1
- package/build/components/post-preview-button/index.js +11 -7
- package/build/components/post-preview-button/index.js.map +1 -1
- package/build/components/post-publish-button/index.js +12 -4
- package/build/components/post-publish-button/index.js.map +1 -1
- package/build/components/post-publish-button/label.js +15 -12
- package/build/components/post-publish-button/label.js.map +1 -1
- package/build/components/post-publish-panel/index.js +4 -3
- package/build/components/post-publish-panel/index.js.map +1 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js +11 -8
- package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-tags-panel.js +7 -4
- package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
- package/build/components/post-publish-panel/postpublish.js +6 -5
- package/build/components/post-publish-panel/postpublish.js.map +1 -1
- package/build/components/post-publish-panel/prepublish.js +4 -3
- package/build/components/post-publish-panel/prepublish.js.map +1 -1
- package/build/components/post-saved-state/index.js +6 -5
- package/build/components/post-saved-state/index.js.map +1 -1
- package/build/components/post-schedule/check.js +6 -4
- package/build/components/post-schedule/check.js.map +1 -1
- package/build/components/post-schedule/index.js +15 -10
- package/build/components/post-schedule/index.js.map +1 -1
- package/build/components/post-schedule/label.js +5 -4
- package/build/components/post-schedule/label.js.map +1 -1
- package/build/components/post-slug/check.js +4 -3
- package/build/components/post-slug/check.js.map +1 -1
- package/build/components/post-slug/index.js +6 -5
- package/build/components/post-slug/index.js.map +1 -1
- package/build/components/post-sticky/check.js +7 -5
- package/build/components/post-sticky/check.js.map +1 -1
- package/build/components/post-sticky/index.js +5 -4
- package/build/components/post-sticky/index.js.map +1 -1
- package/build/components/post-switch-to-draft-button/index.js +7 -6
- package/build/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build/components/post-taxonomies/check.js +6 -5
- package/build/components/post-taxonomies/check.js.map +1 -1
- package/build/components/post-taxonomies/flat-term-selector.js +4 -3
- package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/hierarchical-term-selector.js +6 -5
- package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/index.js +6 -5
- package/build/components/post-taxonomies/index.js.map +1 -1
- package/build/components/post-taxonomies/most-used-terms.js +5 -4
- package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build/components/post-template/index.js +2 -1
- package/build/components/post-template/index.js.map +1 -1
- package/build/components/post-title/index.native.js +6 -5
- package/build/components/post-title/index.native.js.map +1 -1
- package/build/components/post-trash/check.js +8 -6
- package/build/components/post-trash/check.js.map +1 -1
- package/build/components/post-trash/index.js +8 -6
- package/build/components/post-trash/index.js.map +1 -1
- package/build/components/post-type-support-check/index.js +6 -5
- package/build/components/post-type-support-check/index.js.map +1 -1
- package/build/components/post-visibility/check.js +5 -4
- package/build/components/post-visibility/check.js.map +1 -1
- package/build/components/post-visibility/index.js +28 -24
- package/build/components/post-visibility/index.js.map +1 -1
- package/build/components/post-visibility/label.js +5 -3
- package/build/components/post-visibility/label.js.map +1 -1
- package/build/components/provider/index.js +9 -8
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/index.native.js +17 -11
- package/build/components/provider/index.native.js.map +1 -1
- package/build/components/table-of-contents/index.js +33 -26
- package/build/components/table-of-contents/index.js.map +1 -1
- package/build/components/table-of-contents/panel.js +5 -4
- package/build/components/table-of-contents/panel.js.map +1 -1
- package/build/components/template-validation-notice/index.js +6 -4
- package/build/components/template-validation-notice/index.js.map +1 -1
- package/build/components/theme-support-check/index.js +7 -6
- package/build/components/theme-support-check/index.js.map +1 -1
- package/build/hooks/custom-sources-backwards-compatibility.js +12 -8
- package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build/hooks/default-autocompleters.js +2 -1
- package/build/hooks/default-autocompleters.js.map +1 -1
- package/build/index.js +4 -4
- package/build/store/actions.js +51 -30
- package/build/store/actions.js.map +1 -1
- package/build/store/actions.native.js +3 -2
- package/build/store/actions.native.js.map +1 -1
- package/build/store/constants.js +1 -1
- package/build/store/controls.js +10 -9
- package/build/store/controls.js.map +1 -1
- package/build/store/defaults.js +1 -1
- package/build/store/index.js +5 -3
- package/build/store/index.js.map +1 -1
- package/build/store/reducer.js +52 -22
- package/build/store/reducer.js.map +1 -1
- package/build/store/reducer.native.js +14 -4
- package/build/store/reducer.native.js.map +1 -1
- package/build/store/selectors.js +56 -37
- package/build/store/selectors.js.map +1 -1
- package/build/store/selectors.native.js +1 -1
- package/build/store/utils/notice-builder.js +1 -1
- package/build/utils/index.js +6 -6
- package/build/utils/media-upload/index.js +15 -11
- package/build/utils/media-upload/index.js.map +1 -1
- package/build/utils/url.js +1 -1
- package/build-module/components/autosave-monitor/index.js +2 -1
- package/build-module/components/autosave-monitor/index.js.map +1 -1
- package/build-module/components/deprecated.js +4 -3
- package/build-module/components/deprecated.js.map +1 -1
- package/build-module/components/document-outline/check.js +5 -4
- package/build-module/components/document-outline/check.js.map +1 -1
- package/build-module/components/document-outline/index.js +13 -9
- package/build-module/components/document-outline/index.js.map +1 -1
- package/build-module/components/document-outline/item.js +25 -22
- package/build-module/components/document-outline/item.js.map +1 -1
- package/build-module/components/editor-help/help-detail-navigation-screen.native.js +5 -4
- package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
- package/build-module/components/editor-help/help-get-support-button.native.js +5 -4
- package/build-module/components/editor-help/help-get-support-button.native.js.map +1 -1
- package/build-module/components/editor-help/help-topic-row.native.js +6 -5
- package/build-module/components/editor-help/help-topic-row.native.js.map +1 -1
- package/build-module/components/editor-help/index.native.js +20 -16
- package/build-module/components/editor-help/index.native.js.map +1 -1
- package/build-module/components/editor-help/view-sections.native.js +15 -12
- package/build-module/components/editor-help/view-sections.native.js.map +1 -1
- package/build-module/components/editor-notices/index.js +5 -4
- package/build-module/components/editor-notices/index.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-record-item.js +7 -6
- package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-type-list.js +7 -6
- package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js +31 -22
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/error-boundary/index.js +5 -4
- package/build-module/components/error-boundary/index.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/save-shortcut.js +4 -3
- package/build-module/components/global-keyboard-shortcuts/save-shortcut.js.map +1 -1
- package/build-module/components/page-attributes/check.js +4 -3
- package/build-module/components/page-attributes/check.js.map +1 -1
- package/build-module/components/page-attributes/order.js +5 -4
- package/build-module/components/page-attributes/order.js.map +1 -1
- package/build-module/components/page-attributes/parent.js +5 -2
- package/build-module/components/page-attributes/parent.js.map +1 -1
- package/build-module/components/post-author/check.js +4 -3
- package/build-module/components/post-author/check.js.map +1 -1
- package/build-module/components/post-author/combobox.js +6 -3
- package/build-module/components/post-author/combobox.js.map +1 -1
- package/build-module/components/post-comments/index.js +6 -4
- package/build-module/components/post-comments/index.js.map +1 -1
- package/build-module/components/post-excerpt/index.js +5 -4
- package/build-module/components/post-excerpt/index.js.map +1 -1
- package/build-module/components/post-featured-image/index.js +51 -41
- package/build-module/components/post-featured-image/index.js.map +1 -1
- package/build-module/components/post-format/check.js +5 -4
- package/build-module/components/post-format/check.js.map +1 -1
- package/build-module/components/post-last-revision/check.js +7 -5
- package/build-module/components/post-last-revision/check.js.map +1 -1
- package/build-module/components/post-last-revision/index.js +5 -4
- package/build-module/components/post-last-revision/index.js.map +1 -1
- package/build-module/components/post-pending-status/check.js +7 -5
- package/build-module/components/post-pending-status/check.js.map +1 -1
- package/build-module/components/post-pending-status/index.js +6 -4
- package/build-module/components/post-pending-status/index.js.map +1 -1
- package/build-module/components/post-pingbacks/index.js +6 -4
- package/build-module/components/post-pingbacks/index.js.map +1 -1
- package/build-module/components/post-preview-button/index.js +11 -7
- package/build-module/components/post-preview-button/index.js.map +1 -1
- package/build-module/components/post-publish-button/index.js +12 -4
- package/build-module/components/post-publish-button/index.js.map +1 -1
- package/build-module/components/post-publish-button/label.js +15 -12
- package/build-module/components/post-publish-button/label.js.map +1 -1
- package/build-module/components/post-publish-panel/index.js +4 -3
- package/build-module/components/post-publish-panel/index.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js +11 -8
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-tags-panel.js +7 -4
- package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/postpublish.js +6 -5
- package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
- package/build-module/components/post-publish-panel/prepublish.js +4 -3
- package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
- package/build-module/components/post-saved-state/index.js +6 -5
- package/build-module/components/post-saved-state/index.js.map +1 -1
- package/build-module/components/post-schedule/check.js +6 -4
- package/build-module/components/post-schedule/check.js.map +1 -1
- package/build-module/components/post-schedule/index.js +15 -10
- package/build-module/components/post-schedule/index.js.map +1 -1
- package/build-module/components/post-schedule/label.js +6 -4
- package/build-module/components/post-schedule/label.js.map +1 -1
- package/build-module/components/post-slug/check.js +4 -3
- package/build-module/components/post-slug/check.js.map +1 -1
- package/build-module/components/post-slug/index.js +6 -5
- package/build-module/components/post-slug/index.js.map +1 -1
- package/build-module/components/post-sticky/check.js +7 -5
- package/build-module/components/post-sticky/check.js.map +1 -1
- package/build-module/components/post-sticky/index.js +5 -4
- package/build-module/components/post-sticky/index.js.map +1 -1
- package/build-module/components/post-switch-to-draft-button/index.js +7 -6
- package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build-module/components/post-taxonomies/check.js +6 -5
- package/build-module/components/post-taxonomies/check.js.map +1 -1
- package/build-module/components/post-taxonomies/flat-term-selector.js +4 -3
- package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js +4 -3
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/index.js +6 -5
- package/build-module/components/post-taxonomies/index.js.map +1 -1
- package/build-module/components/post-taxonomies/most-used-terms.js +5 -4
- package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
- package/build-module/components/post-template/index.js +2 -1
- package/build-module/components/post-template/index.js.map +1 -1
- package/build-module/components/post-title/index.native.js +6 -5
- package/build-module/components/post-title/index.native.js.map +1 -1
- package/build-module/components/post-trash/check.js +8 -6
- package/build-module/components/post-trash/check.js.map +1 -1
- package/build-module/components/post-trash/index.js +8 -6
- package/build-module/components/post-trash/index.js.map +1 -1
- package/build-module/components/post-type-support-check/index.js +6 -5
- package/build-module/components/post-type-support-check/index.js.map +1 -1
- package/build-module/components/post-visibility/check.js +5 -4
- package/build-module/components/post-visibility/check.js.map +1 -1
- package/build-module/components/post-visibility/index.js +28 -24
- package/build-module/components/post-visibility/index.js.map +1 -1
- package/build-module/components/post-visibility/label.js +5 -3
- package/build-module/components/post-visibility/label.js.map +1 -1
- package/build-module/components/provider/index.js +9 -8
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/index.native.js +13 -9
- package/build-module/components/provider/index.native.js.map +1 -1
- package/build-module/components/table-of-contents/index.js +33 -26
- package/build-module/components/table-of-contents/index.js.map +1 -1
- package/build-module/components/table-of-contents/panel.js +5 -4
- package/build-module/components/table-of-contents/panel.js.map +1 -1
- package/build-module/components/template-validation-notice/index.js +6 -4
- package/build-module/components/template-validation-notice/index.js.map +1 -1
- package/build-module/components/theme-support-check/index.js +7 -6
- package/build-module/components/theme-support-check/index.js.map +1 -1
- package/build-module/hooks/custom-sources-backwards-compatibility.js +12 -8
- package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
- package/build-module/hooks/default-autocompleters.js +2 -1
- package/build-module/hooks/default-autocompleters.js.map +1 -1
- package/build-module/store/actions.js +27 -12
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/actions.native.js +2 -1
- package/build-module/store/actions.native.js.map +1 -1
- package/build-module/store/controls.js +8 -7
- package/build-module/store/controls.js.map +1 -1
- package/build-module/store/reducer.js +44 -14
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/reducer.native.js +12 -3
- package/build-module/store/reducer.native.js.map +1 -1
- package/build-module/store/selectors.js +7 -4
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/media-upload/index.js +15 -11
- package/build-module/utils/media-upload/index.js.map +1 -1
- package/package.json +31 -31
- package/src/components/entities-saved-states/index.js +8 -1
package/build/store/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/store/index.js"],"names":["storeConfig","reducer","selectors","actions","controls","dataControls","store","STORE_NAME","persist"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/store/index.js"],"names":["storeConfig","reducer","selectors","actions","controls","dataControls","store","STORE_NAME","persist"],"mappings":";;;;;;;;;AAGA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;;;;;AAbA;AACA;AACA;;AAIA;AACA;AACA;;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,WAAW,GAAG;AAC1BC,EAAAA,OAAO,EAAPA,gBAD0B;AAE1BC,EAAAA,SAF0B;AAG1BC,EAAAA,OAH0B;AAI1BC,EAAAA,QAAQ,EAAE,EACT,GAAGC,sBADM;AAET,OAAGD;AAFM;AAJgB,CAApB;AAUP;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,MAAME,KAAK,GAAG,4BAAkBC,qBAAlB,EAA8B,EAClD,GAAGP,WAD+C;AAElDQ,EAAAA,OAAO,EAAE,CAAE,aAAF;AAFyC,CAA9B,CAAd,C,CAKP;AACA;;;AACA,yBAAeD,qBAAf,EAA2B,EAC1B,GAAGP,WADuB;AAE1BQ,EAAAA,OAAO,EAAE,CAAE,aAAF;AAFiB,CAA3B","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createReduxStore, registerStore } from '@wordpress/data';\nimport { controls as dataControls } from '@wordpress/data-controls';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as selectors from './selectors';\nimport * as actions from './actions';\nimport controls from './controls';\nimport { STORE_NAME } from './constants';\n\n/**\n * Post editor data store configuration.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore\n *\n * @type {Object}\n */\nexport const storeConfig = {\n\treducer,\n\tselectors,\n\tactions,\n\tcontrols: {\n\t\t...dataControls,\n\t\t...controls,\n\t},\n};\n\n/**\n * Store definition for the editor namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, {\n\t...storeConfig,\n\tpersist: [ 'preferences' ],\n} );\n\n// Once we build a more generic persistence plugin that works across types of stores\n// we'd be able to replace this with a register call.\nregisterStore( STORE_NAME, {\n\t...storeConfig,\n\tpersist: [ 'preferences' ],\n} );\n"]}
|
package/build/store/reducer.js
CHANGED
|
@@ -3,21 +3,21 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
exports.editorSettings = editorSettings;
|
|
6
8
|
exports.getPostRawValue = getPostRawValue;
|
|
7
9
|
exports.hasSameKeys = hasSameKeys;
|
|
10
|
+
exports.isReady = isReady;
|
|
8
11
|
exports.isUpdatingSamePostProperty = isUpdatingSamePostProperty;
|
|
9
|
-
exports.
|
|
12
|
+
exports.postAutosavingLock = postAutosavingLock;
|
|
10
13
|
exports.postId = postId;
|
|
14
|
+
exports.postLock = postLock;
|
|
15
|
+
exports.postSavingLock = postSavingLock;
|
|
11
16
|
exports.postType = postType;
|
|
12
|
-
exports.template = template;
|
|
13
17
|
exports.preferences = preferences;
|
|
14
18
|
exports.saving = saving;
|
|
15
|
-
exports.
|
|
16
|
-
exports.
|
|
17
|
-
exports.postAutosavingLock = postAutosavingLock;
|
|
18
|
-
exports.isReady = isReady;
|
|
19
|
-
exports.editorSettings = editorSettings;
|
|
20
|
-
exports.default = void 0;
|
|
19
|
+
exports.shouldOverwriteState = shouldOverwriteState;
|
|
20
|
+
exports.template = template;
|
|
21
21
|
|
|
22
22
|
var _lodash = require("lodash");
|
|
23
23
|
|
|
@@ -105,7 +105,10 @@ function shouldOverwriteState(action, previousAction) {
|
|
|
105
105
|
return isUpdatingSamePostProperty(action, previousAction);
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
function postId(
|
|
108
|
+
function postId() {
|
|
109
|
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
110
|
+
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
111
|
+
|
|
109
112
|
switch (action.type) {
|
|
110
113
|
case 'SETUP_EDITOR_STATE':
|
|
111
114
|
case 'RESET_POST':
|
|
@@ -115,7 +118,10 @@ function postId(state = null, action) {
|
|
|
115
118
|
return state;
|
|
116
119
|
}
|
|
117
120
|
|
|
118
|
-
function postType(
|
|
121
|
+
function postType() {
|
|
122
|
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
123
|
+
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
124
|
+
|
|
119
125
|
switch (action.type) {
|
|
120
126
|
case 'SETUP_EDITOR_STATE':
|
|
121
127
|
case 'RESET_POST':
|
|
@@ -134,9 +140,12 @@ function postType(state = null, action) {
|
|
|
134
140
|
*/
|
|
135
141
|
|
|
136
142
|
|
|
137
|
-
function template(
|
|
138
|
-
|
|
139
|
-
|
|
143
|
+
function template() {
|
|
144
|
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
145
|
+
isValid: true
|
|
146
|
+
};
|
|
147
|
+
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
148
|
+
|
|
140
149
|
switch (action.type) {
|
|
141
150
|
case 'SET_TEMPLATE_VALIDITY':
|
|
142
151
|
return { ...state,
|
|
@@ -156,7 +165,10 @@ function template(state = {
|
|
|
156
165
|
*/
|
|
157
166
|
|
|
158
167
|
|
|
159
|
-
function preferences(
|
|
168
|
+
function preferences() {
|
|
169
|
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _defaults.PREFERENCES_DEFAULTS;
|
|
170
|
+
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
171
|
+
|
|
160
172
|
switch (action.type) {
|
|
161
173
|
case 'ENABLE_PUBLISH_SIDEBAR':
|
|
162
174
|
return { ...state,
|
|
@@ -182,7 +194,10 @@ function preferences(state = _defaults.PREFERENCES_DEFAULTS, action) {
|
|
|
182
194
|
*/
|
|
183
195
|
|
|
184
196
|
|
|
185
|
-
function saving(
|
|
197
|
+
function saving() {
|
|
198
|
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
199
|
+
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
200
|
+
|
|
186
201
|
switch (action.type) {
|
|
187
202
|
case 'REQUEST_POST_UPDATE_START':
|
|
188
203
|
case 'REQUEST_POST_UPDATE_FINISH':
|
|
@@ -215,9 +230,12 @@ function saving(state = {}, action) {
|
|
|
215
230
|
*/
|
|
216
231
|
|
|
217
232
|
|
|
218
|
-
function postLock(
|
|
219
|
-
|
|
220
|
-
|
|
233
|
+
function postLock() {
|
|
234
|
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
235
|
+
isLocked: false
|
|
236
|
+
};
|
|
237
|
+
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
238
|
+
|
|
221
239
|
switch (action.type) {
|
|
222
240
|
case 'UPDATE_POST_LOCK':
|
|
223
241
|
return action.lock;
|
|
@@ -237,7 +255,10 @@ function postLock(state = {
|
|
|
237
255
|
*/
|
|
238
256
|
|
|
239
257
|
|
|
240
|
-
function postSavingLock(
|
|
258
|
+
function postSavingLock() {
|
|
259
|
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
260
|
+
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
261
|
+
|
|
241
262
|
switch (action.type) {
|
|
242
263
|
case 'LOCK_POST_SAVING':
|
|
243
264
|
return { ...state,
|
|
@@ -262,7 +283,10 @@ function postSavingLock(state = {}, action) {
|
|
|
262
283
|
*/
|
|
263
284
|
|
|
264
285
|
|
|
265
|
-
function postAutosavingLock(
|
|
286
|
+
function postAutosavingLock() {
|
|
287
|
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
288
|
+
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
289
|
+
|
|
266
290
|
switch (action.type) {
|
|
267
291
|
case 'LOCK_POST_AUTOSAVING':
|
|
268
292
|
return { ...state,
|
|
@@ -287,7 +311,10 @@ function postAutosavingLock(state = {}, action) {
|
|
|
287
311
|
*/
|
|
288
312
|
|
|
289
313
|
|
|
290
|
-
function isReady(
|
|
314
|
+
function isReady() {
|
|
315
|
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
316
|
+
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
317
|
+
|
|
291
318
|
switch (action.type) {
|
|
292
319
|
case 'SETUP_EDITOR_STATE':
|
|
293
320
|
return true;
|
|
@@ -308,7 +335,10 @@ function isReady(state = false, action) {
|
|
|
308
335
|
*/
|
|
309
336
|
|
|
310
337
|
|
|
311
|
-
function editorSettings(
|
|
338
|
+
function editorSettings() {
|
|
339
|
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _defaults.EDITOR_SETTINGS_DEFAULTS;
|
|
340
|
+
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
341
|
+
|
|
312
342
|
switch (action.type) {
|
|
313
343
|
case 'UPDATE_EDITOR_SETTINGS':
|
|
314
344
|
return { ...state,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/store/reducer.js"],"names":["getPostRawValue","value","raw","hasSameKeys","a","b","isUpdatingSamePostProperty","action","previousAction","type","edits","shouldOverwriteState","shouldCreateUndoLevel","postId","state","post","id","postType","template","isValid","preferences","PREFERENCES_DEFAULTS","isPublishSidebarEnabled","saving","pending","options","postLock","isLocked","lock","postSavingLock","lockName","postAutosavingLock","isReady","editorSettings","EDITOR_SETTINGS_DEFAULTS","settings"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAGA;;AAKA;;AAKA;;AAbA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,eAAT,CAA0BC,KAA1B,EAAkC;AACxC,MAAKA,KAAK,IAAI,aAAa,OAAOA,KAA7B,IAAsC,SAASA,KAApD,EAA4D;AAC3D,WAAOA,KAAK,CAACC,G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AAL;AACC,aAAO,EACN,GAAGK,KADG;AAEN,WAAGP,MAAM,CAAC4B;AAFJ,OAAP;AAFF;;AAQA,SAAOrB,KAAP;AACA;;eAEc,2BAAiB;AAC/BD,EAAAA,MAD+B;AAE/BI,EAAAA,QAF+B;AAG/BG,EAAAA,WAH+B;AAI/BG,EAAAA,MAJ+B;AAK/BG,EAAAA,QAL+B;AAM/BR,EAAAA,QAN+B;AAO/BW,EAAAA,cAP+B;AAQ/BG,EAAAA,OAR+B;AAS/BC,EAAAA,cAT+B;AAU/BF,EAAAA;AAV+B,CAAjB,C","sourcesContent":["/**\n * External dependencies\n */\nimport { omit, keys, isEqual } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { PREFERENCES_DEFAULTS, EDITOR_SETTINGS_DEFAULTS } from './defaults';\n\n/**\n * Returns a post attribute value, flattening nested rendered content using its\n * raw value in place of its original object form.\n *\n * @param {*} value Original value.\n *\n * @return {*} Raw value.\n */\nexport function getPostRawValue( value ) {\n\tif ( value && 'object' === typeof value && 'raw' in value ) {\n\t\treturn value.raw;\n\t}\n\n\treturn value;\n}\n\n/**\n * Returns true if the two object arguments have the same keys, or false\n * otherwise.\n *\n * @param {Object} a First object.\n * @param {Object} b Second object.\n *\n * @return {boolean} Whether the two objects have the same keys.\n */\nexport function hasSameKeys( a, b ) {\n\treturn isEqual( keys( a ), keys( b ) );\n}\n\n/**\n * Returns true if, given the currently dispatching action and the previously\n * dispatched action, the two actions are editing the same post property, or\n * false otherwise.\n *\n * @param {Object} action Currently dispatching action.\n * @param {Object} previousAction Previously dispatched action.\n *\n * @return {boolean} Whether actions are updating the same post property.\n */\nexport function isUpdatingSamePostProperty( action, previousAction ) {\n\treturn (\n\t\taction.type === 'EDIT_POST' &&\n\t\thasSameKeys( action.edits, previousAction.edits )\n\t);\n}\n\n/**\n * Returns true if, given the currently dispatching action and the previously\n * dispatched action, the two actions are modifying the same property such that\n * undo history should be batched.\n *\n * @param {Object} action Currently dispatching action.\n * @param {Object} previousAction Previously dispatched action.\n *\n * @return {boolean} Whether to overwrite present state.\n */\nexport function shouldOverwriteState( action, previousAction ) {\n\tif ( action.type === 'RESET_EDITOR_BLOCKS' ) {\n\t\treturn ! action.shouldCreateUndoLevel;\n\t}\n\n\tif ( ! previousAction || action.type !== previousAction.type ) {\n\t\treturn false;\n\t}\n\n\treturn isUpdatingSamePostProperty( action, previousAction );\n}\n\nexport function postId( state = null, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SETUP_EDITOR_STATE':\n\t\tcase 'RESET_POST':\n\t\t\treturn action.post.id;\n\t}\n\n\treturn state;\n}\n\nexport function postType( state = null, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SETUP_EDITOR_STATE':\n\t\tcase 'RESET_POST':\n\t\t\treturn action.post.type;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer returning whether the post blocks match the defined template or not.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {boolean} Updated state.\n */\nexport function template( state = { isValid: true }, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_TEMPLATE_VALIDITY':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tisValid: action.isValid,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer returning the user preferences.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {string} Updated state.\n */\nexport function preferences( state = PREFERENCES_DEFAULTS, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'ENABLE_PUBLISH_SIDEBAR':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tisPublishSidebarEnabled: true,\n\t\t\t};\n\n\t\tcase 'DISABLE_PUBLISH_SIDEBAR':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tisPublishSidebarEnabled: false,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer returning current network request state (whether a request to\n * the WP REST API is in progress, successful, or failed).\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function saving( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'REQUEST_POST_UPDATE_START':\n\t\tcase 'REQUEST_POST_UPDATE_FINISH':\n\t\t\treturn {\n\t\t\t\tpending: action.type === 'REQUEST_POST_UPDATE_START',\n\t\t\t\toptions: action.options || {},\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Post Lock State.\n *\n * @typedef {Object} PostLockState\n *\n * @property {boolean} isLocked Whether the post is locked.\n * @property {?boolean} isTakeover Whether the post editing has been taken over.\n * @property {?boolean} activePostLock Active post lock value.\n * @property {?Object} user User that took over the post.\n */\n\n/**\n * Reducer returning the post lock status.\n *\n * @param {PostLockState} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {PostLockState} Updated state.\n */\nexport function postLock( state = { isLocked: false }, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'UPDATE_POST_LOCK':\n\t\t\treturn action.lock;\n\t}\n\n\treturn state;\n}\n\n/**\n * Post saving lock.\n *\n * When post saving is locked, the post cannot be published or updated.\n *\n * @param {PostLockState} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {PostLockState} Updated state.\n */\nexport function postSavingLock( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'LOCK_POST_SAVING':\n\t\t\treturn { ...state, [ action.lockName ]: true };\n\n\t\tcase 'UNLOCK_POST_SAVING':\n\t\t\treturn omit( state, action.lockName );\n\t}\n\treturn state;\n}\n\n/**\n * Post autosaving lock.\n *\n * When post autosaving is locked, the post will not autosave.\n *\n * @param {PostLockState} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {PostLockState} Updated state.\n */\nexport function postAutosavingLock( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'LOCK_POST_AUTOSAVING':\n\t\t\treturn { ...state, [ action.lockName ]: true };\n\n\t\tcase 'UNLOCK_POST_AUTOSAVING':\n\t\t\treturn omit( state, action.lockName );\n\t}\n\treturn state;\n}\n\n/**\n * Reducer returning whether the editor is ready to be rendered.\n * The editor is considered ready to be rendered once\n * the post object is loaded properly and the initial blocks parsed.\n *\n * @param {boolean} state\n * @param {Object} action\n *\n * @return {boolean} Updated state.\n */\nexport function isReady( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SETUP_EDITOR_STATE':\n\t\t\treturn true;\n\n\t\tcase 'TEAR_DOWN_EDITOR':\n\t\t\treturn false;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer returning the post editor setting.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function editorSettings( state = EDITOR_SETTINGS_DEFAULTS, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'UPDATE_EDITOR_SETTINGS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t...action.settings,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\nexport default combineReducers( {\n\tpostId,\n\tpostType,\n\tpreferences,\n\tsaving,\n\tpostLock,\n\ttemplate,\n\tpostSavingLock,\n\tisReady,\n\teditorSettings,\n\tpostAutosavingLock,\n} );\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/store/reducer.js"],"names":["getPostRawValue","value","raw","hasSameKeys","a","b","isUpdatingSamePostProperty","action","previousAction","type","edits","shouldOverwriteState","shouldCreateUndoLevel","postId","state","post","id","postType","template","isValid","preferences","PREFERENCES_DEFAULTS","isPublishSidebarEnabled","saving","pending","options","postLock","isLocked","lock","postSavingLock","lockName","postAutosavingLock","isReady","editorSettings","EDITOR_SETTINGS_DEFAULTS","settings"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAGA;;AAKA;;AAKA;;AAbA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,eAAT,CA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AAED,SAAK,kBAAL;AACC,aAAO,KAAP;AALF;;AAQA,SAAOK,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASmB,cAAT,GAAoE;AAAA,MAA3CnB,KAA2C,uEAAnCoB,kCAAmC;AAAA,MAAT3B,MAAS;;AAC1E,UAASA,MAAM,CAACE,IAAhB;AACC,SAAK,wBAAL;AACC,aAAO,EACN,GAAGK,KADG;AAEN,WAAGP,MAAM,CAAC4B;AAFJ,OAAP;AAFF;;AAQA,SAAOrB,KAAP;AACA;;eAEc,2BAAiB;AAC/BD,EAAAA,MAD+B;AAE/BI,EAAAA,QAF+B;AAG/BG,EAAAA,WAH+B;AAI/BG,EAAAA,MAJ+B;AAK/BG,EAAAA,QAL+B;AAM/BR,EAAAA,QAN+B;AAO/BW,EAAAA,cAP+B;AAQ/BG,EAAAA,OAR+B;AAS/BC,EAAAA,cAT+B;AAU/BF,EAAAA;AAV+B,CAAjB,C","sourcesContent":["/**\n * External dependencies\n */\nimport { omit, keys, isEqual } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { PREFERENCES_DEFAULTS, EDITOR_SETTINGS_DEFAULTS } from './defaults';\n\n/**\n * Returns a post attribute value, flattening nested rendered content using its\n * raw value in place of its original object form.\n *\n * @param {*} value Original value.\n *\n * @return {*} Raw value.\n */\nexport function getPostRawValue( value ) {\n\tif ( value && 'object' === typeof value && 'raw' in value ) {\n\t\treturn value.raw;\n\t}\n\n\treturn value;\n}\n\n/**\n * Returns true if the two object arguments have the same keys, or false\n * otherwise.\n *\n * @param {Object} a First object.\n * @param {Object} b Second object.\n *\n * @return {boolean} Whether the two objects have the same keys.\n */\nexport function hasSameKeys( a, b ) {\n\treturn isEqual( keys( a ), keys( b ) );\n}\n\n/**\n * Returns true if, given the currently dispatching action and the previously\n * dispatched action, the two actions are editing the same post property, or\n * false otherwise.\n *\n * @param {Object} action Currently dispatching action.\n * @param {Object} previousAction Previously dispatched action.\n *\n * @return {boolean} Whether actions are updating the same post property.\n */\nexport function isUpdatingSamePostProperty( action, previousAction ) {\n\treturn (\n\t\taction.type === 'EDIT_POST' &&\n\t\thasSameKeys( action.edits, previousAction.edits )\n\t);\n}\n\n/**\n * Returns true if, given the currently dispatching action and the previously\n * dispatched action, the two actions are modifying the same property such that\n * undo history should be batched.\n *\n * @param {Object} action Currently dispatching action.\n * @param {Object} previousAction Previously dispatched action.\n *\n * @return {boolean} Whether to overwrite present state.\n */\nexport function shouldOverwriteState( action, previousAction ) {\n\tif ( action.type === 'RESET_EDITOR_BLOCKS' ) {\n\t\treturn ! action.shouldCreateUndoLevel;\n\t}\n\n\tif ( ! previousAction || action.type !== previousAction.type ) {\n\t\treturn false;\n\t}\n\n\treturn isUpdatingSamePostProperty( action, previousAction );\n}\n\nexport function postId( state = null, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SETUP_EDITOR_STATE':\n\t\tcase 'RESET_POST':\n\t\t\treturn action.post.id;\n\t}\n\n\treturn state;\n}\n\nexport function postType( state = null, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SETUP_EDITOR_STATE':\n\t\tcase 'RESET_POST':\n\t\t\treturn action.post.type;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer returning whether the post blocks match the defined template or not.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {boolean} Updated state.\n */\nexport function template( state = { isValid: true }, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_TEMPLATE_VALIDITY':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tisValid: action.isValid,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer returning the user preferences.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {string} Updated state.\n */\nexport function preferences( state = PREFERENCES_DEFAULTS, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'ENABLE_PUBLISH_SIDEBAR':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tisPublishSidebarEnabled: true,\n\t\t\t};\n\n\t\tcase 'DISABLE_PUBLISH_SIDEBAR':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tisPublishSidebarEnabled: false,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer returning current network request state (whether a request to\n * the WP REST API is in progress, successful, or failed).\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function saving( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'REQUEST_POST_UPDATE_START':\n\t\tcase 'REQUEST_POST_UPDATE_FINISH':\n\t\t\treturn {\n\t\t\t\tpending: action.type === 'REQUEST_POST_UPDATE_START',\n\t\t\t\toptions: action.options || {},\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Post Lock State.\n *\n * @typedef {Object} PostLockState\n *\n * @property {boolean} isLocked Whether the post is locked.\n * @property {?boolean} isTakeover Whether the post editing has been taken over.\n * @property {?boolean} activePostLock Active post lock value.\n * @property {?Object} user User that took over the post.\n */\n\n/**\n * Reducer returning the post lock status.\n *\n * @param {PostLockState} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {PostLockState} Updated state.\n */\nexport function postLock( state = { isLocked: false }, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'UPDATE_POST_LOCK':\n\t\t\treturn action.lock;\n\t}\n\n\treturn state;\n}\n\n/**\n * Post saving lock.\n *\n * When post saving is locked, the post cannot be published or updated.\n *\n * @param {PostLockState} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {PostLockState} Updated state.\n */\nexport function postSavingLock( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'LOCK_POST_SAVING':\n\t\t\treturn { ...state, [ action.lockName ]: true };\n\n\t\tcase 'UNLOCK_POST_SAVING':\n\t\t\treturn omit( state, action.lockName );\n\t}\n\treturn state;\n}\n\n/**\n * Post autosaving lock.\n *\n * When post autosaving is locked, the post will not autosave.\n *\n * @param {PostLockState} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {PostLockState} Updated state.\n */\nexport function postAutosavingLock( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'LOCK_POST_AUTOSAVING':\n\t\t\treturn { ...state, [ action.lockName ]: true };\n\n\t\tcase 'UNLOCK_POST_AUTOSAVING':\n\t\t\treturn omit( state, action.lockName );\n\t}\n\treturn state;\n}\n\n/**\n * Reducer returning whether the editor is ready to be rendered.\n * The editor is considered ready to be rendered once\n * the post object is loaded properly and the initial blocks parsed.\n *\n * @param {boolean} state\n * @param {Object} action\n *\n * @return {boolean} Updated state.\n */\nexport function isReady( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SETUP_EDITOR_STATE':\n\t\t\treturn true;\n\n\t\tcase 'TEAR_DOWN_EDITOR':\n\t\t\treturn false;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer returning the post editor setting.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function editorSettings( state = EDITOR_SETTINGS_DEFAULTS, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'UPDATE_EDITOR_SETTINGS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t...action.settings,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\nexport default combineReducers( {\n\tpostId,\n\tpostType,\n\tpreferences,\n\tsaving,\n\tpostLock,\n\ttemplate,\n\tpostSavingLock,\n\tisReady,\n\teditorSettings,\n\tpostAutosavingLock,\n} );\n"]}
|
|
@@ -9,8 +9,9 @@ var _exportNames = {
|
|
|
9
9
|
notices: true
|
|
10
10
|
};
|
|
11
11
|
exports.clipboard = clipboard;
|
|
12
|
+
exports.default = void 0;
|
|
12
13
|
exports.notices = notices;
|
|
13
|
-
exports.
|
|
14
|
+
exports.postTitle = void 0;
|
|
14
15
|
|
|
15
16
|
var _data = require("@wordpress/data");
|
|
16
17
|
|
|
@@ -48,7 +49,10 @@ _defaults.EDITOR_SETTINGS_DEFAULTS.autosaveInterval = 1; // This is a way to ove
|
|
|
48
49
|
* @return {Object} Updated state.
|
|
49
50
|
*/
|
|
50
51
|
const postTitle = (0, _data.combineReducers)({
|
|
51
|
-
isSelected(
|
|
52
|
+
isSelected() {
|
|
53
|
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
54
|
+
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
55
|
+
|
|
52
56
|
switch (action.type) {
|
|
53
57
|
case 'TOGGLE_POST_TITLE_SELECTION':
|
|
54
58
|
return action.isSelected;
|
|
@@ -69,7 +73,10 @@ const postTitle = (0, _data.combineReducers)({
|
|
|
69
73
|
|
|
70
74
|
exports.postTitle = postTitle;
|
|
71
75
|
|
|
72
|
-
function clipboard(
|
|
76
|
+
function clipboard() {
|
|
77
|
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
|
78
|
+
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
79
|
+
|
|
73
80
|
switch (action.type) {
|
|
74
81
|
case 'UPDATE_CLIPBOARD':
|
|
75
82
|
return action.clipboard;
|
|
@@ -87,7 +94,10 @@ function clipboard(state = null, action) {
|
|
|
87
94
|
*/
|
|
88
95
|
|
|
89
96
|
|
|
90
|
-
function notices(
|
|
97
|
+
function notices() {
|
|
98
|
+
let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
99
|
+
let action = arguments.length > 1 ? arguments[1] : undefined;
|
|
100
|
+
|
|
91
101
|
switch (action.type) {
|
|
92
102
|
case 'CREATE_NOTICE':
|
|
93
103
|
return [...state, action.notice];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/editor/src/store/reducer.native.js"],"names":["EDITOR_SETTINGS_DEFAULTS","autosaveInterval","postTitle","isSelected","state","action","type","clipboard","notices","notice","filter","id","postId","postType","preferences","saving","postLock","postSavingLock","template","isReady","editorSettings"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["@wordpress/editor/src/store/reducer.native.js"],"names":["EDITOR_SETTINGS_DEFAULTS","autosaveInterval","postTitle","isSelected","state","action","type","clipboard","notices","notice","filter","id","postId","postType","preferences","saving","postLock","postSavingLock","template","isReady","editorSettings"],"mappings":";;;;;;;;;;;;;;;AAGA;;AAKA;;AAgBA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAJA;;AApBA;AACA;AACA;;AAGA;AACA;AACA;AAeAA,mCAAyBC,gBAAzB,GAA4C,CAA5C,C,CAA+C;;AAI/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,SAAS,GAAG,2BAAiB;AACzCC,EAAAA,UAAU,GAA0B;AAAA,QAAxBC,KAAwB,uEAAhB,KAAgB;AAAA,QAATC,MAAS;;AACnC,YAASA,MAAM,CAACC,IAAhB;AACC,WAAK,6BAAL;AACC,eAAOD,MAAM,CAACF,UAAd;AAFF;;AAKA,WAAOC,KAAP;AACA;;AARwC,CAAjB,CAAlB;AAWP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AACO,SAASG,SAAT,GAA2C;AAAA,MAAvBH,KAAuB,uEAAf,IAAe;AAAA,MAATC,MAAS;;AACjD,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,kBAAL;AACC,aAAOD,MAAM,CAACE,SAAd;AAFF;;AAKA,SAAOH,KAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASI,OAAT,GAAuC;AAAA,MAArBJ,KAAqB,uEAAb,EAAa;AAAA,MAATC,MAAS;;AAC7C,UAASA,MAAM,CAACC,IAAhB;AACC,SAAK,eAAL;AACC,aAAO,CAAE,GAAGF,KAAL,EAAYC,MAAM,CAACI,MAAnB,CAAP;;AACD,SAAK,oBAAL;AACC,aAAO,EAAP;;AACD,SAAK,eAAL;AACC,aAAOL,KAAK,CAACM,MAAN,CAAgBD,MAAF,IAAcA,MAAM,CAACE,EAAP,KAAcN,MAAM,CAACM,EAAjD,CAAP;AANF;;AAQA,SAAOP,KAAP;AACA;;eAEc,2BAAiB;AAC/BQ,EAAAA,MAAM,EAANA,eAD+B;AAE/BC,EAAAA,QAAQ,EAARA,iBAF+B;AAG/BX,EAAAA,SAH+B;AAI/BY,EAAAA,WAAW,EAAXA,oBAJ+B;AAK/BC,EAAAA,MAAM,EAANA,eAL+B;AAM/BC,EAAAA,QAAQ,EAARA,iBAN+B;AAO/BC,EAAAA,cAAc,EAAdA,uBAP+B;AAQ/BC,EAAAA,QAAQ,EAARA,iBAR+B;AAS/BC,EAAAA,OAAO,EAAPA,gBAT+B;AAU/BC,EAAAA,cAAc,EAAdA,uBAV+B;AAW/Bb,EAAAA,SAX+B;AAY/BC,EAAAA;AAZ+B,CAAjB,C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport {\n\tpostId,\n\tpostType,\n\tpreferences,\n\tsaving,\n\tpostLock,\n\tpostSavingLock,\n\ttemplate,\n\tisReady,\n\teditorSettings,\n} from './reducer.js';\n\nimport { EDITOR_SETTINGS_DEFAULTS } from './defaults.js';\n\nEDITOR_SETTINGS_DEFAULTS.autosaveInterval = 1; // This is a way to override default behavior on mobile, and make it ping the native save every second as long as something changed\n\nexport * from './reducer.js';\n\n/**\n * Reducer returning the post title state.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport const postTitle = combineReducers( {\n\tisSelected( state = false, action ) {\n\t\tswitch ( action.type ) {\n\t\t\tcase 'TOGGLE_POST_TITLE_SELECTION':\n\t\t\t\treturn action.isSelected;\n\t\t}\n\n\t\treturn state;\n\t},\n} );\n\n/**\n * Reducer returning the clipboard state.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function clipboard( state = null, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'UPDATE_CLIPBOARD':\n\t\t\treturn action.clipboard;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer returning the notices state.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function notices( state = [], action ) {\n\tswitch ( action.type ) {\n\t\tcase 'CREATE_NOTICE':\n\t\t\treturn [ ...state, action.notice ];\n\t\tcase 'REMOVE_ALL_NOTICES':\n\t\t\treturn [];\n\t\tcase 'REMOVE_NOTICE':\n\t\t\treturn state.filter( ( notice ) => notice.id !== action.id );\n\t}\n\treturn state;\n}\n\nexport default combineReducers( {\n\tpostId,\n\tpostType,\n\tpostTitle,\n\tpreferences,\n\tsaving,\n\tpostLock,\n\tpostSavingLock,\n\ttemplate,\n\tisReady,\n\teditorSettings,\n\tclipboard,\n\tnotices,\n} );\n"]}
|
package/build/store/selectors.js
CHANGED
|
@@ -5,52 +5,68 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
9
|
-
exports.
|
|
10
|
-
exports.
|
|
11
|
-
exports.
|
|
8
|
+
exports.__experimentalGetDefaultTemplateType = exports.__experimentalGetDefaultTemplatePartAreas = void 0;
|
|
9
|
+
exports.__experimentalGetDefaultTemplateTypes = __experimentalGetDefaultTemplateTypes;
|
|
10
|
+
exports.__experimentalGetTemplateInfo = __experimentalGetTemplateInfo;
|
|
11
|
+
exports.__unstableIsEditorReady = __unstableIsEditorReady;
|
|
12
|
+
exports.canInsertBlockType = void 0;
|
|
13
|
+
exports.canUserUseUnfilteredHTML = canUserUseUnfilteredHTML;
|
|
14
|
+
exports.didPostSaveRequestSucceed = exports.didPostSaveRequestFail = void 0;
|
|
15
|
+
exports.getActivePostLock = getActivePostLock;
|
|
16
|
+
exports.getCurrentPost = exports.getClientIdsWithDescendants = exports.getClientIdsOfDescendants = exports.getBlocksByClientId = exports.getBlocks = exports.getBlockSelectionStart = exports.getBlockSelectionEnd = exports.getBlockRootClientId = exports.getBlockOrder = exports.getBlockName = exports.getBlockMode = exports.getBlockListSettings = exports.getBlockInsertionPoint = exports.getBlockIndex = exports.getBlockHierarchyRootClientId = exports.getBlockCount = exports.getBlockAttributes = exports.getBlock = exports.getAutosaveAttribute = exports.getAdjacentBlockClientId = void 0;
|
|
17
|
+
exports.getCurrentPostAttribute = getCurrentPostAttribute;
|
|
12
18
|
exports.getCurrentPostId = getCurrentPostId;
|
|
13
|
-
exports.getCurrentPostRevisionsCount = getCurrentPostRevisionsCount;
|
|
14
19
|
exports.getCurrentPostLastRevisionId = getCurrentPostLastRevisionId;
|
|
15
|
-
exports.
|
|
20
|
+
exports.getCurrentPostRevisionsCount = getCurrentPostRevisionsCount;
|
|
21
|
+
exports.getCurrentPostType = getCurrentPostType;
|
|
16
22
|
exports.getEditedPostAttribute = getEditedPostAttribute;
|
|
23
|
+
exports.getEditedPostContent = void 0;
|
|
24
|
+
exports.getEditedPostPreviewLink = getEditedPostPreviewLink;
|
|
25
|
+
exports.getEditedPostSlug = getEditedPostSlug;
|
|
17
26
|
exports.getEditedPostVisibility = getEditedPostVisibility;
|
|
27
|
+
exports.getEditorBlocks = getEditorBlocks;
|
|
28
|
+
exports.getEditorSelection = getEditorSelection;
|
|
29
|
+
exports.getEditorSelectionEnd = getEditorSelectionEnd;
|
|
30
|
+
exports.getEditorSelectionStart = getEditorSelectionStart;
|
|
31
|
+
exports.getEditorSettings = getEditorSettings;
|
|
32
|
+
exports.getNextBlockClientId = exports.getMultiSelectedBlocksStartClientId = exports.getMultiSelectedBlocksEndClientId = exports.getMultiSelectedBlocks = exports.getMultiSelectedBlockClientIds = exports.getLastMultiSelectedBlockClientId = exports.getInserterItems = exports.getGlobalBlockCount = exports.getFirstMultiSelectedBlockClientId = void 0;
|
|
33
|
+
exports.getPermalink = getPermalink;
|
|
34
|
+
exports.getPermalinkParts = getPermalinkParts;
|
|
35
|
+
exports.getPostEdits = void 0;
|
|
36
|
+
exports.getPostLockUser = getPostLockUser;
|
|
37
|
+
exports.getSelectedBlocksInitialCaretPosition = exports.getSelectedBlockCount = exports.getSelectedBlockClientId = exports.getSelectedBlock = exports.getReferenceByDistinctEdits = exports.getPreviousBlockClientId = exports.getPostTypeLabel = void 0;
|
|
38
|
+
exports.getStateBeforeOptimisticTransaction = getStateBeforeOptimisticTransaction;
|
|
39
|
+
exports.getSuggestedPostFormat = getSuggestedPostFormat;
|
|
40
|
+
exports.getTemplateLock = exports.getTemplate = void 0;
|
|
41
|
+
exports.hasChangedContent = hasChangedContent;
|
|
42
|
+
exports.hasSelectedInnerBlock = exports.hasSelectedBlock = exports.hasNonPostEntityChanges = exports.hasMultiSelection = exports.hasInserterItems = exports.hasEditorUndo = exports.hasEditorRedo = void 0;
|
|
43
|
+
exports.inSomeHistory = inSomeHistory;
|
|
44
|
+
exports.isAncestorMultiSelected = void 0;
|
|
45
|
+
exports.isAutosavingPost = isAutosavingPost;
|
|
46
|
+
exports.isCaretWithinFormattedText = exports.isBlockWithinSelection = exports.isBlockValid = exports.isBlockSelected = exports.isBlockMultiSelected = exports.isBlockInsertionPointVisible = void 0;
|
|
47
|
+
exports.isCleanNewPost = isCleanNewPost;
|
|
18
48
|
exports.isCurrentPostPending = isCurrentPostPending;
|
|
19
49
|
exports.isCurrentPostPublished = isCurrentPostPublished;
|
|
20
50
|
exports.isCurrentPostScheduled = isCurrentPostScheduled;
|
|
21
|
-
exports.
|
|
22
|
-
exports.isEditedPostSaveable = isEditedPostSaveable;
|
|
23
|
-
exports.isEditedPostEmpty = isEditedPostEmpty;
|
|
51
|
+
exports.isEditedPostAutosaveable = void 0;
|
|
24
52
|
exports.isEditedPostBeingScheduled = isEditedPostBeingScheduled;
|
|
25
53
|
exports.isEditedPostDateFloating = isEditedPostDateFloating;
|
|
26
|
-
exports.
|
|
27
|
-
exports.
|
|
28
|
-
exports.
|
|
29
|
-
exports.
|
|
30
|
-
exports.
|
|
54
|
+
exports.isEditedPostDirty = void 0;
|
|
55
|
+
exports.isEditedPostEmpty = isEditedPostEmpty;
|
|
56
|
+
exports.isEditedPostNew = isEditedPostNew;
|
|
57
|
+
exports.isEditedPostPublishable = isEditedPostPublishable;
|
|
58
|
+
exports.isEditedPostSaveable = isEditedPostSaveable;
|
|
59
|
+
exports.isMultiSelecting = exports.isFirstMultiSelectedBlock = void 0;
|
|
60
|
+
exports.isMultiSelecting = exports.isFirstMultiSelectedBlock = void 0;
|
|
31
61
|
exports.isPermalinkEditable = isPermalinkEditable;
|
|
32
|
-
exports.getPermalink = getPermalink;
|
|
33
|
-
exports.getEditedPostSlug = getEditedPostSlug;
|
|
34
|
-
exports.getPermalinkParts = getPermalinkParts;
|
|
35
|
-
exports.isPostLocked = isPostLocked;
|
|
36
|
-
exports.isPostSavingLocked = isPostSavingLocked;
|
|
37
62
|
exports.isPostAutosavingLocked = isPostAutosavingLocked;
|
|
38
63
|
exports.isPostLockTakeover = isPostLockTakeover;
|
|
39
|
-
exports.
|
|
40
|
-
exports.
|
|
41
|
-
exports.
|
|
64
|
+
exports.isPostLocked = isPostLocked;
|
|
65
|
+
exports.isPostSavingLocked = isPostSavingLocked;
|
|
66
|
+
exports.isPreviewingPost = isPreviewingPost;
|
|
42
67
|
exports.isPublishSidebarEnabled = isPublishSidebarEnabled;
|
|
43
|
-
exports.
|
|
44
|
-
exports.
|
|
45
|
-
exports.getEditorSelectionEnd = getEditorSelectionEnd;
|
|
46
|
-
exports.getEditorSelection = getEditorSelection;
|
|
47
|
-
exports.__unstableIsEditorReady = __unstableIsEditorReady;
|
|
48
|
-
exports.getEditorSettings = getEditorSettings;
|
|
49
|
-
exports.getStateBeforeOptimisticTransaction = getStateBeforeOptimisticTransaction;
|
|
50
|
-
exports.inSomeHistory = inSomeHistory;
|
|
51
|
-
exports.__experimentalGetDefaultTemplateTypes = __experimentalGetDefaultTemplateTypes;
|
|
52
|
-
exports.__experimentalGetTemplateInfo = __experimentalGetTemplateInfo;
|
|
53
|
-
exports.getPostTypeLabel = exports.__experimentalGetDefaultTemplateType = exports.__experimentalGetDefaultTemplatePartAreas = exports.getBlockListSettings = exports.hasInserterItems = exports.getInserterItems = exports.canInsertBlockType = exports.getTemplateLock = exports.getTemplate = exports.isValidTemplate = exports.isBlockInsertionPointVisible = exports.getBlockInsertionPoint = exports.isCaretWithinFormattedText = exports.isTyping = exports.getBlockMode = exports.isSelectionEnabled = exports.isMultiSelecting = exports.hasMultiSelection = exports.isBlockWithinSelection = exports.hasSelectedInnerBlock = exports.isBlockSelected = exports.getBlockIndex = exports.getBlockOrder = exports.getMultiSelectedBlocksEndClientId = exports.getMultiSelectedBlocksStartClientId = exports.isAncestorMultiSelected = exports.isBlockMultiSelected = exports.isFirstMultiSelectedBlock = exports.getLastMultiSelectedBlockClientId = exports.getFirstMultiSelectedBlockClientId = exports.getMultiSelectedBlocks = exports.getMultiSelectedBlockClientIds = exports.getSelectedBlocksInitialCaretPosition = exports.getNextBlockClientId = exports.getPreviousBlockClientId = exports.getAdjacentBlockClientId = exports.getBlockHierarchyRootClientId = exports.getBlockRootClientId = exports.getSelectedBlock = exports.getSelectedBlockClientId = exports.hasSelectedBlock = exports.getSelectedBlockCount = exports.getBlockSelectionEnd = exports.getBlockSelectionStart = exports.getBlockCount = exports.getBlocksByClientId = exports.getGlobalBlockCount = exports.getClientIdsWithDescendants = exports.getClientIdsOfDescendants = exports.getBlocks = exports.getBlock = exports.getBlockAttributes = exports.isBlockValid = exports.getBlockName = exports.getEditedPostContent = exports.didPostSaveRequestFail = exports.didPostSaveRequestSucceed = exports.isSavingNonPostEntityChanges = exports.isSavingPost = exports.isEditedPostAutosaveable = exports.getAutosaveAttribute = exports.getReferenceByDistinctEdits = exports.getPostEdits = exports.getCurrentPost = exports.hasNonPostEntityChanges = exports.isEditedPostDirty = exports.hasEditorRedo = exports.hasEditorUndo = void 0;
|
|
68
|
+
exports.isPublishingPost = isPublishingPost;
|
|
69
|
+
exports.isValidTemplate = exports.isTyping = exports.isSelectionEnabled = exports.isSavingPost = exports.isSavingNonPostEntityChanges = void 0;
|
|
54
70
|
|
|
55
71
|
var _lodash = require("lodash");
|
|
56
72
|
|
|
@@ -338,9 +354,7 @@ const getPostEdits = (0, _data.createRegistrySelector)(select => state => {
|
|
|
338
354
|
*/
|
|
339
355
|
|
|
340
356
|
exports.getPostEdits = getPostEdits;
|
|
341
|
-
const getReferenceByDistinctEdits = (0, _data.createRegistrySelector)(select => () =>
|
|
342
|
-
/* state */
|
|
343
|
-
{
|
|
357
|
+
const getReferenceByDistinctEdits = (0, _data.createRegistrySelector)(select => () => {
|
|
344
358
|
(0, _deprecated.default)("`wp.data.select( 'core/editor' ).getReferenceByDistinctEdits`", {
|
|
345
359
|
since: '5.4',
|
|
346
360
|
alternative: "`wp.data.select( 'core' ).getReferenceByDistinctEdits`"
|
|
@@ -1262,11 +1276,16 @@ function inSomeHistory() {
|
|
|
1262
1276
|
}
|
|
1263
1277
|
|
|
1264
1278
|
function getBlockEditorSelector(name) {
|
|
1265
|
-
return (0, _data.createRegistrySelector)(select => (state
|
|
1279
|
+
return (0, _data.createRegistrySelector)(select => function (state) {
|
|
1266
1280
|
(0, _deprecated.default)("`wp.data.select( 'core/editor' )." + name + '`', {
|
|
1267
1281
|
since: '5.3',
|
|
1268
1282
|
alternative: "`wp.data.select( 'core/block-editor' )." + name + '`'
|
|
1269
1283
|
});
|
|
1284
|
+
|
|
1285
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
1286
|
+
args[_key - 1] = arguments[_key];
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1270
1289
|
return select(_blockEditor.store)[name](...args);
|
|
1271
1290
|
});
|
|
1272
1291
|
}
|