PHP 8.2.31
Preview: keyboard-shortcuts.js Size: 9.68 KB
/home/nshryvcy/blissfulnepal.com/wp-includes/js/dist/keyboard-shortcuts.js

var wp;
(wp ||= {}).keyboardShortcuts = (() => {
  var __create = Object.create;
  var __defProp = Object.defineProperty;
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  var __getOwnPropNames = Object.getOwnPropertyNames;
  var __getProtoOf = Object.getPrototypeOf;
  var __hasOwnProp = Object.prototype.hasOwnProperty;
  var __commonJS = (cb, mod) => function __require() {
    return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
  };
  var __export = (target, all) => {
    for (var name in all)
      __defProp(target, name, { get: all[name], enumerable: true });
  };
  var __copyProps = (to, from, except, desc) => {
    if (from && typeof from === "object" || typeof from === "function") {
      for (let key of __getOwnPropNames(from))
        if (!__hasOwnProp.call(to, key) && key !== except)
          __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
    }
    return to;
  };
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
    // If the importer is in node compatibility mode or this is not an ESM
    // file that has been converted to a CommonJS file using a Babel-
    // compatible transform (i.e. "__esModule" has not been set), then set
    // "default" to the CommonJS "module.exports" for node compatibility.
    isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
    mod
  ));
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

  // package-external:@wordpress/data
  var require_data = __commonJS({
    "package-external:@wordpress/data"(exports, module) {
      module.exports = window.wp.data;
    }
  });

  // package-external:@wordpress/keycodes
  var require_keycodes = __commonJS({
    "package-external:@wordpress/keycodes"(exports, module) {
      module.exports = window.wp.keycodes;
    }
  });

  // package-external:@wordpress/element
  var require_element = __commonJS({
    "package-external:@wordpress/element"(exports, module) {
      module.exports = window.wp.element;
    }
  });

  // vendor-external:react/jsx-runtime
  var require_jsx_runtime = __commonJS({
    "vendor-external:react/jsx-runtime"(exports, module) {
      module.exports = window.ReactJSXRuntime;
    }
  });

  // packages/keyboard-shortcuts/build-module/index.mjs
  var index_exports = {};
  __export(index_exports, {
    ShortcutProvider: () => ShortcutProvider,
    __unstableUseShortcutEventMatch: () => useShortcutEventMatch,
    store: () => store,
    useShortcut: () => useShortcut
  });

  // packages/keyboard-shortcuts/build-module/store/index.mjs
  var import_data2 = __toESM(require_data(), 1);

  // packages/keyboard-shortcuts/build-module/store/reducer.mjs
  function reducer(state = {}, action) {
    switch (action.type) {
      case "REGISTER_SHORTCUT":
        return {
          ...state,
          [action.name]: {
            category: action.category,
            keyCombination: action.keyCombination,
            aliases: action.aliases,
            description: action.description
          }
        };
      case "UNREGISTER_SHORTCUT":
        const { [action.name]: actionName, ...remainingState } = state;
        return remainingState;
    }
    return state;
  }
  var reducer_default = reducer;

  // packages/keyboard-shortcuts/build-module/store/actions.mjs
  var actions_exports = {};
  __export(actions_exports, {
    registerShortcut: () => registerShortcut,
    unregisterShortcut: () => unregisterShortcut
  });
  function registerShortcut({
    name,
    category,
    description,
    keyCombination,
    aliases
  }) {
    return {
      type: "REGISTER_SHORTCUT",
      name,
      category,
      keyCombination,
      aliases,
      description
    };
  }
  function unregisterShortcut(name) {
    return {
      type: "UNREGISTER_SHORTCUT",
      name
    };
  }

  // packages/keyboard-shortcuts/build-module/store/selectors.mjs
  var selectors_exports = {};
  __export(selectors_exports, {
    getAllShortcutKeyCombinations: () => getAllShortcutKeyCombinations,
    getAllShortcutRawKeyCombinations: () => getAllShortcutRawKeyCombinations,
    getCategoryShortcuts: () => getCategoryShortcuts,
    getShortcutAliases: () => getShortcutAliases,
    getShortcutDescription: () => getShortcutDescription,
    getShortcutKeyCombination: () => getShortcutKeyCombination,
    getShortcutRepresentation: () => getShortcutRepresentation
  });
  var import_data = __toESM(require_data(), 1);
  var import_keycodes = __toESM(require_keycodes(), 1);
  var EMPTY_ARRAY = [];
  var FORMATTING_METHODS = {
    display: import_keycodes.displayShortcut,
    raw: import_keycodes.rawShortcut,
    ariaLabel: import_keycodes.shortcutAriaLabel
  };
  function getKeyCombinationRepresentation(shortcut, representation) {
    if (!shortcut) {
      return null;
    }
    return shortcut.modifier ? FORMATTING_METHODS[representation][shortcut.modifier](
      shortcut.character
    ) : shortcut.character;
  }
  function getShortcutKeyCombination(state, name) {
    return state[name] ? state[name].keyCombination : null;
  }
  function getShortcutRepresentation(state, name, representation = "display") {
    const shortcut = getShortcutKeyCombination(state, name);
    return getKeyCombinationRepresentation(shortcut, representation);
  }
  function getShortcutDescription(state, name) {
    return state[name] ? state[name].description : null;
  }
  function getShortcutAliases(state, name) {
    return state[name] && state[name].aliases ? state[name].aliases : EMPTY_ARRAY;
  }
  var getAllShortcutKeyCombinations = (0, import_data.createSelector)(
    (state, name) => {
      return [
        getShortcutKeyCombination(state, name),
        ...getShortcutAliases(state, name)
      ].filter(Boolean);
    },
    (state, name) => [state[name]]
  );
  var getAllShortcutRawKeyCombinations = (0, import_data.createSelector)(
    (state, name) => {
      return getAllShortcutKeyCombinations(state, name).map(
        (combination) => getKeyCombinationRepresentation(combination, "raw")
      );
    },
    (state, name) => [state[name]]
  );
  var getCategoryShortcuts = (0, import_data.createSelector)(
    (state, categoryName) => {
      return Object.entries(state).filter(([, shortcut]) => shortcut.category === categoryName).map(([name]) => name);
    },
    (state) => [state]
  );

  // packages/keyboard-shortcuts/build-module/store/index.mjs
  var STORE_NAME = "core/keyboard-shortcuts";
  var store = (0, import_data2.createReduxStore)(STORE_NAME, {
    reducer: reducer_default,
    actions: actions_exports,
    selectors: selectors_exports
  });
  (0, import_data2.register)(store);

  // packages/keyboard-shortcuts/build-module/hooks/use-shortcut.mjs
  var import_element2 = __toESM(require_element(), 1);

  // packages/keyboard-shortcuts/build-module/hooks/use-shortcut-event-match.mjs
  var import_data3 = __toESM(require_data(), 1);
  var import_keycodes2 = __toESM(require_keycodes(), 1);
  function useShortcutEventMatch() {
    const { getAllShortcutKeyCombinations: getAllShortcutKeyCombinations2 } = (0, import_data3.useSelect)(
      store
    );
    function isMatch(name, event) {
      return getAllShortcutKeyCombinations2(name).some(
        ({ modifier, character }) => {
          return import_keycodes2.isKeyboardEvent[modifier](event, character);
        }
      );
    }
    return isMatch;
  }

  // packages/keyboard-shortcuts/build-module/context.mjs
  var import_element = __toESM(require_element(), 1);
  var globalShortcuts = /* @__PURE__ */ new Set();
  var globalListener = (event) => {
    for (const keyboardShortcut of globalShortcuts) {
      keyboardShortcut(event);
    }
  };
  var context = (0, import_element.createContext)({
    add: (shortcut) => {
      if (globalShortcuts.size === 0) {
        document.addEventListener("keydown", globalListener);
      }
      globalShortcuts.add(shortcut);
    },
    delete: (shortcut) => {
      globalShortcuts.delete(shortcut);
      if (globalShortcuts.size === 0) {
        document.removeEventListener("keydown", globalListener);
      }
    }
  });
  context.displayName = "KeyboardShortcutsContext";

  // packages/keyboard-shortcuts/build-module/hooks/use-shortcut.mjs
  function useShortcut(name, callback, { isDisabled = false } = {}) {
    const shortcuts = (0, import_element2.useContext)(context);
    const isMatch = useShortcutEventMatch();
    const callbackRef = (0, import_element2.useRef)();
    (0, import_element2.useEffect)(() => {
      callbackRef.current = callback;
    }, [callback]);
    (0, import_element2.useEffect)(() => {
      if (isDisabled) {
        return;
      }
      function _callback(event) {
        if (isMatch(name, event)) {
          callbackRef.current(event);
        }
      }
      shortcuts.add(_callback);
      return () => {
        shortcuts.delete(_callback);
      };
    }, [name, isDisabled, shortcuts]);
  }

  // packages/keyboard-shortcuts/build-module/components/shortcut-provider.mjs
  var import_element3 = __toESM(require_element(), 1);
  var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
  var { Provider } = context;
  function ShortcutProvider(props) {
    const [keyboardShortcuts] = (0, import_element3.useState)(() => /* @__PURE__ */ new Set());
    function onKeyDown(event) {
      if (props.onKeyDown) {
        props.onKeyDown(event);
      }
      for (const keyboardShortcut of keyboardShortcuts) {
        keyboardShortcut(event);
      }
    }
    return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Provider, { value: keyboardShortcuts, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { ...props, onKeyDown }) });
  }
  return __toCommonJS(index_exports);
})();

Directory Contents

Dirs: 3 × Files: 132

Name Size Perms Modified Actions
- drwxr-xr-x 2023-11-12 05:03:56
Edit Download
- drwxr-xr-x 2026-05-21 08:23:01
Edit Download
vendor DIR
- drwxr-xr-x 2026-05-21 08:23:01
Edit Download
5.45 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
2.41 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
15.13 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
5.58 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
17.46 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
6.29 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
9.73 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
5.47 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
48 B lrw-r--r-- 2026-05-21 08:23:01
Edit Download
40 B lrw-r--r-- 2026-05-21 08:23:01
Edit Download
2.30 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
1.13 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
55.67 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
21.92 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
2.70 MB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
1.01 MB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
2.57 MB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
1.09 MB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
6.54 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
2.36 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
50.48 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
10.34 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
381.06 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
180.58 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
151.71 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
63.10 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
3.83 MB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
786.24 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
80.84 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
28.21 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
28.68 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
11.83 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
612.03 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
210.43 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
91.57 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
36.58 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
4.13 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
1.74 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
82.78 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
25.88 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
176.34 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
141.18 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
3.04 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
1.25 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
1.47 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
783 B lrw-r--r-- 2026-05-21 08:23:01
Edit Download
34.61 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
12.62 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
117.40 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
49.07 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
1.69 MB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
684.42 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
160.25 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
61.83 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
2.50 MB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
1,021.22 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
27.93 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
12.13 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
2.29 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
1.03 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
73.34 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
28.85 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
11.96 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
4.90 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
1.65 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
844 B lrw-r--r-- 2026-05-21 08:23:00
Edit Download
15.30 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
5.56 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
2.69 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
1.06 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
9.68 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
3.41 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
8.30 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
2.87 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
13.06 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
5.21 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
637.15 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
237.61 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
10.11 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
4.35 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
10.32 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
3.92 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
58.25 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
21.60 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
11.67 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
4.72 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
17.22 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
5.46 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
21.07 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
7.68 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
5.08 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
1.94 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
10.02 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
3.32 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
4.09 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
2.63 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
3.91 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
1.49 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
24.68 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
9.62 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
20.51 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
7.19 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
97.04 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
39.86 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
36.12 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
14.10 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
10.97 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
3.91 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
7.96 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
3.25 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
17.62 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
6.38 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
359.40 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
118.11 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
127.65 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
56.08 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
6.12 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
1.58 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
5.29 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
1.66 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
55.67 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
23.02 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
23.39 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
10.09 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
6.61 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
2.21 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
1.52 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
720 B lrw-r--r-- 2026-05-21 08:23:00
Edit Download
50.08 KB lrw-r--r-- 2026-05-21 08:23:00
Edit Download
20.79 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
6.93 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download
2.41 KB lrw-r--r-- 2026-05-21 08:23:01
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).