wp/wp-includes/js/dist/keyboard-shortcuts.js
changeset 22 8c2e4d02f4ef
parent 21 48c4eec2b7e6
equal deleted inserted replaced
21:48c4eec2b7e6 22:8c2e4d02f4ef
    64   getShortcutDescription: () => (getShortcutDescription),
    64   getShortcutDescription: () => (getShortcutDescription),
    65   getShortcutKeyCombination: () => (getShortcutKeyCombination),
    65   getShortcutKeyCombination: () => (getShortcutKeyCombination),
    66   getShortcutRepresentation: () => (getShortcutRepresentation)
    66   getShortcutRepresentation: () => (getShortcutRepresentation)
    67 });
    67 });
    68 
    68 
    69 ;// CONCATENATED MODULE: external ["wp","data"]
    69 ;// external ["wp","data"]
    70 const external_wp_data_namespaceObject = window["wp"]["data"];
    70 const external_wp_data_namespaceObject = window["wp"]["data"];
    71 ;// CONCATENATED MODULE: ./node_modules/@wordpress/keyboard-shortcuts/build-module/store/reducer.js
    71 ;// ./node_modules/@wordpress/keyboard-shortcuts/build-module/store/reducer.js
    72 /**
    72 /**
    73  * Reducer returning the registered shortcuts
    73  * Reducer returning the registered shortcuts
    74  *
    74  *
    75  * @param {Object} state  Current state.
    75  * @param {Object} state  Current state.
    76  * @param {Object} action Dispatched action.
    76  * @param {Object} action Dispatched action.
    98   }
    98   }
    99   return state;
    99   return state;
   100 }
   100 }
   101 /* harmony default export */ const store_reducer = (reducer);
   101 /* harmony default export */ const store_reducer = (reducer);
   102 
   102 
   103 ;// CONCATENATED MODULE: ./node_modules/@wordpress/keyboard-shortcuts/build-module/store/actions.js
   103 ;// ./node_modules/@wordpress/keyboard-shortcuts/build-module/store/actions.js
   104 /** @typedef {import('@wordpress/keycodes').WPKeycodeModifier} WPKeycodeModifier */
   104 /** @typedef {import('@wordpress/keycodes').WPKeycodeModifier} WPKeycodeModifier */
   105 
   105 
   106 /**
   106 /**
   107  * Keyboard key combination.
   107  * Keyboard key combination.
   108  *
   108  *
   228     type: 'UNREGISTER_SHORTCUT',
   228     type: 'UNREGISTER_SHORTCUT',
   229     name
   229     name
   230   };
   230   };
   231 }
   231 }
   232 
   232 
   233 ;// CONCATENATED MODULE: external ["wp","keycodes"]
   233 ;// external ["wp","keycodes"]
   234 const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"];
   234 const external_wp_keycodes_namespaceObject = window["wp"]["keycodes"];
   235 ;// CONCATENATED MODULE: ./node_modules/@wordpress/keyboard-shortcuts/build-module/store/selectors.js
   235 ;// ./node_modules/@wordpress/keyboard-shortcuts/build-module/store/selectors.js
   236 /**
   236 /**
   237  * WordPress dependencies
   237  * WordPress dependencies
   238  */
   238  */
   239 
   239 
   240 
   240 
   269  *
   269  *
   270  * @param {?WPShortcutKeyCombination} shortcut       Key combination.
   270  * @param {?WPShortcutKeyCombination} shortcut       Key combination.
   271  * @param {keyof FORMATTING_METHODS}  representation Type of representation
   271  * @param {keyof FORMATTING_METHODS}  representation Type of representation
   272  *                                                   (display, raw, ariaLabel).
   272  *                                                   (display, raw, ariaLabel).
   273  *
   273  *
   274  * @return {string?} Shortcut representation.
   274  * @return {?string} Shortcut representation.
   275  */
   275  */
   276 function getKeyCombinationRepresentation(shortcut, representation) {
   276 function getKeyCombinationRepresentation(shortcut, representation) {
   277   if (!shortcut) {
   277   if (!shortcut) {
   278     return null;
   278     return null;
   279   }
   279   }
   359  *         </ul>
   359  *         </ul>
   360  *     );
   360  *     );
   361  * };
   361  * };
   362  *```
   362  *```
   363  *
   363  *
   364  * @return {string?} Shortcut representation.
   364  * @return {?string} Shortcut representation.
   365  */
   365  */
   366 function getShortcutRepresentation(state, name, representation = 'display') {
   366 function getShortcutRepresentation(state, name, representation = 'display') {
   367   const shortcut = getShortcutKeyCombination(state, name);
   367   const shortcut = getShortcutKeyCombination(state, name);
   368   return getKeyCombinationRepresentation(shortcut, representation);
   368   return getKeyCombinationRepresentation(shortcut, representation);
   369 }
   369 }
   392  *     ) : (
   392  *     ) : (
   393  *         <div>{ __( 'No description.' ) }</div>
   393  *         <div>{ __( 'No description.' ) }</div>
   394  *     );
   394  *     );
   395  * };
   395  * };
   396  *```
   396  *```
   397  * @return {string?} Shortcut description.
   397  * @return {?string} Shortcut description.
   398  */
   398  */
   399 function getShortcutDescription(state, name) {
   399 function getShortcutDescription(state, name) {
   400   return state[name] ? state[name].description : null;
   400   return state[name] ? state[name].description : null;
   401 }
   401 }
   402 
   402 
   591  */
   591  */
   592 const getCategoryShortcuts = (0,external_wp_data_namespaceObject.createSelector)((state, categoryName) => {
   592 const getCategoryShortcuts = (0,external_wp_data_namespaceObject.createSelector)((state, categoryName) => {
   593   return Object.entries(state).filter(([, shortcut]) => shortcut.category === categoryName).map(([name]) => name);
   593   return Object.entries(state).filter(([, shortcut]) => shortcut.category === categoryName).map(([name]) => name);
   594 }, state => [state]);
   594 }, state => [state]);
   595 
   595 
   596 ;// CONCATENATED MODULE: ./node_modules/@wordpress/keyboard-shortcuts/build-module/store/index.js
   596 ;// ./node_modules/@wordpress/keyboard-shortcuts/build-module/store/index.js
   597 /**
   597 /**
   598  * WordPress dependencies
   598  * WordPress dependencies
   599  */
   599  */
   600 
   600 
   601 
   601 
   619   actions: actions_namespaceObject,
   619   actions: actions_namespaceObject,
   620   selectors: selectors_namespaceObject
   620   selectors: selectors_namespaceObject
   621 });
   621 });
   622 (0,external_wp_data_namespaceObject.register)(store);
   622 (0,external_wp_data_namespaceObject.register)(store);
   623 
   623 
   624 ;// CONCATENATED MODULE: external ["wp","element"]
   624 ;// external ["wp","element"]
   625 const external_wp_element_namespaceObject = window["wp"]["element"];
   625 const external_wp_element_namespaceObject = window["wp"]["element"];
   626 ;// CONCATENATED MODULE: ./node_modules/@wordpress/keyboard-shortcuts/build-module/hooks/use-shortcut-event-match.js
   626 ;// ./node_modules/@wordpress/keyboard-shortcuts/build-module/hooks/use-shortcut-event-match.js
   627 /**
   627 /**
   628  * WordPress dependencies
   628  * WordPress dependencies
   629  */
   629  */
   630 
   630 
   631 
   631 
   664     });
   664     });
   665   }
   665   }
   666   return isMatch;
   666   return isMatch;
   667 }
   667 }
   668 
   668 
   669 ;// CONCATENATED MODULE: ./node_modules/@wordpress/keyboard-shortcuts/build-module/context.js
   669 ;// ./node_modules/@wordpress/keyboard-shortcuts/build-module/context.js
   670 /**
   670 /**
   671  * WordPress dependencies
   671  * WordPress dependencies
   672  */
   672  */
   673 
   673 
   674 const globalShortcuts = new Set();
   674 const globalShortcuts = new Set();
   690       document.removeEventListener('keydown', globalListener);
   690       document.removeEventListener('keydown', globalListener);
   691     }
   691     }
   692   }
   692   }
   693 });
   693 });
   694 
   694 
   695 ;// CONCATENATED MODULE: ./node_modules/@wordpress/keyboard-shortcuts/build-module/hooks/use-shortcut.js
   695 ;// ./node_modules/@wordpress/keyboard-shortcuts/build-module/hooks/use-shortcut.js
   696 /**
   696 /**
   697  * WordPress dependencies
   697  * WordPress dependencies
   698  */
   698  */
   699 
   699 
   700 
   700 
   735       shortcuts.delete(_callback);
   735       shortcuts.delete(_callback);
   736     };
   736     };
   737   }, [name, isDisabled, shortcuts]);
   737   }, [name, isDisabled, shortcuts]);
   738 }
   738 }
   739 
   739 
   740 ;// CONCATENATED MODULE: external "ReactJSXRuntime"
   740 ;// external "ReactJSXRuntime"
   741 const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
   741 const external_ReactJSXRuntime_namespaceObject = window["ReactJSXRuntime"];
   742 ;// CONCATENATED MODULE: ./node_modules/@wordpress/keyboard-shortcuts/build-module/components/shortcut-provider.js
   742 ;// ./node_modules/@wordpress/keyboard-shortcuts/build-module/components/shortcut-provider.js
   743 /**
   743 /**
   744  * WordPress dependencies
   744  * WordPress dependencies
   745  */
   745  */
   746 
   746 
   747 
   747 
   783     })
   783     })
   784   });
   784   });
   785   /* eslint-enable jsx-a11y/no-static-element-interactions */
   785   /* eslint-enable jsx-a11y/no-static-element-interactions */
   786 }
   786 }
   787 
   787 
   788 ;// CONCATENATED MODULE: ./node_modules/@wordpress/keyboard-shortcuts/build-module/index.js
   788 ;// ./node_modules/@wordpress/keyboard-shortcuts/build-module/index.js
   789 
   789 
   790 
   790 
   791 
   791 
   792 
   792 
   793 
   793