@wordpress/priority-queue 3.34.0 → 3.34.1-next.2f1c7c01b.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/build/index.js CHANGED
@@ -26,13 +26,15 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // packages/priority-queue/src/index.ts
29
31
  var index_exports = {};
30
32
  __export(index_exports, {
31
33
  createQueue: () => createQueue
32
34
  });
33
35
  module.exports = __toCommonJS(index_exports);
34
36
  var import_request_idle_callback = __toESM(require("./request-idle-callback"));
35
- const createQueue = () => {
37
+ var createQueue = () => {
36
38
  const waitingList = /* @__PURE__ */ new Map();
37
39
  let isRunning = false;
38
40
  const runWaitingList = (deadline) => {
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts"],
4
4
  "sourcesContent": ["/**\n * Internal dependencies\n */\nimport requestIdleCallback from './request-idle-callback';\n\n/**\n * Enqueued callback to invoke once idle time permits.\n */\nexport type WPPriorityQueueCallback = VoidFunction;\n\n/**\n * An object used to associate callbacks in a particular context grouping.\n */\nexport type WPPriorityQueueContext = object;\n\n/**\n * Interface for the priority queue instance.\n */\nexport interface WPPriorityQueue {\n\t/**\n\t * Add a callback to the queue for a given context.\n\t */\n\tadd: (\n\t\telement: WPPriorityQueueContext,\n\t\titem: WPPriorityQueueCallback\n\t) => void;\n\n\t/**\n\t * Flush and run the callback for a given context immediately.\n\t * @return true if a callback was run, false otherwise.\n\t */\n\tflush: ( element: WPPriorityQueueContext ) => boolean;\n\n\t/**\n\t * Cancel (remove) the callback for a given context without running it.\n\t * @return true if a callback was cancelled, false otherwise.\n\t */\n\tcancel: ( element: WPPriorityQueueContext ) => boolean;\n\n\t/**\n\t * Reset the entire queue, clearing pending callbacks.\n\t */\n\treset: VoidFunction;\n}\n\n/**\n * Creates a context-aware queue that only executes\n * the last task of a given context.\n *\n * @example\n *```js\n * import { createQueue } from '@wordpress/priority-queue';\n *\n * const queue = createQueue();\n *\n * // Context objects.\n * const ctx1 = {};\n * const ctx2 = {};\n *\n * // For a given context in the queue, only the last callback is executed.\n * queue.add( ctx1, () => console.log( 'This will be printed first' ) );\n * queue.add( ctx2, () => console.log( 'This won\\'t be printed' ) );\n * queue.add( ctx2, () => console.log( 'This will be printed second' ) );\n *```\n *\n * @return {WPPriorityQueue} Queue object with `add`, `flush` and `reset` methods.\n */\nexport const createQueue = (): WPPriorityQueue => {\n\tconst waitingList = new Map<\n\t\tWPPriorityQueueContext,\n\t\tWPPriorityQueueCallback\n\t>();\n\tlet isRunning = false;\n\n\t/**\n\t * Callback to process as much queue as time permits.\n\t *\n\t * Map Iteration follows the original insertion order. This means that here\n\t * we can iterate the queue and know that the first contexts which were\n\t * added will be run first. On the other hand, if anyone adds a new callback\n\t * for an existing context it will supplant the previously-set callback for\n\t * that context because we reassigned that map key's value.\n\t *\n\t * In the case that a callback adds a new callback to its own context then\n\t * the callback it adds will appear at the end of the iteration and will be\n\t * run only after all other existing contexts have finished executing.\n\t *\n\t * @param {IdleDeadline|number} deadline Idle callback deadline object, or\n\t * animation frame timestamp.\n\t */\n\tconst runWaitingList = ( deadline: IdleDeadline | number ): void => {\n\t\tfor ( const [ nextElement, callback ] of waitingList ) {\n\t\t\twaitingList.delete( nextElement );\n\t\t\tcallback();\n\n\t\t\tif (\n\t\t\t\t'number' === typeof deadline ||\n\t\t\t\tdeadline.timeRemaining() <= 0\n\t\t\t) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ( waitingList.size === 0 ) {\n\t\t\tisRunning = false;\n\t\t\treturn;\n\t\t}\n\n\t\trequestIdleCallback( runWaitingList );\n\t};\n\n\t/**\n\t * Add a callback to the queue for a given context.\n\t *\n\t * If errors with undefined callbacks are encountered double check that\n\t * all of your useSelect calls have the right dependencies set correctly\n\t * in their second parameter. Missing dependencies can cause unexpected\n\t * loops and race conditions in the queue.\n\t *\n\t * @param {WPPriorityQueueContext} element Context object.\n\t * @param {WPPriorityQueueCallback} item Callback function.\n\t */\n\tconst add: WPPriorityQueue[ 'add' ] = (\n\t\telement: WPPriorityQueueContext,\n\t\titem: WPPriorityQueueCallback\n\t) => {\n\t\twaitingList.set( element, item );\n\t\tif ( ! isRunning ) {\n\t\t\tisRunning = true;\n\t\t\trequestIdleCallback( runWaitingList );\n\t\t}\n\t};\n\n\t/**\n\t * Flushes queue for a given context, returning true if the flush was\n\t * performed, or false if there is no queue for the given context.\n\t *\n\t * @param {WPPriorityQueueContext} element Context object.\n\t *\n\t * @return {boolean} Whether flush was performed.\n\t */\n\tconst flush: WPPriorityQueue[ 'flush' ] = (\n\t\telement: WPPriorityQueueContext\n\t) => {\n\t\tconst callback = waitingList.get( element );\n\t\tif ( undefined === callback ) {\n\t\t\treturn false;\n\t\t}\n\n\t\twaitingList.delete( element );\n\t\tcallback();\n\n\t\treturn true;\n\t};\n\n\t/**\n\t * Clears the queue for a given context, cancelling the callbacks without\n\t * executing them. Returns `true` if there were scheduled callbacks to cancel,\n\t * or `false` if there was is no queue for the given context.\n\t *\n\t * @param {WPPriorityQueueContext} element Context object.\n\t *\n\t * @return {boolean} Whether any callbacks got cancelled.\n\t */\n\tconst cancel: WPPriorityQueue[ 'cancel' ] = (\n\t\telement: WPPriorityQueueContext\n\t) => {\n\t\treturn waitingList.delete( element );\n\t};\n\n\t/**\n\t * Reset the queue without running the pending callbacks.\n\t */\n\tconst reset: WPPriorityQueue[ 'reset' ] = () => {\n\t\twaitingList.clear();\n\t\tisRunning = false;\n\t};\n\n\treturn {\n\t\tadd,\n\t\tflush,\n\t\tcancel,\n\t\treset,\n\t};\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,mCAAgC;AAgEzB,MAAM,cAAc,MAAuB;AACjD,QA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ACD;AAAA,MACD;AAAA,IACD;AAEA,QAAK,YAAY,SAAS,GAAI;AAC7B,kBAAY;AACZ;AAAA,IACD;AAEA,qCAAAA,SAAqB,cAAe;AAAA,EACrC;AAaA,QAAM,MAAgC,CACrC,SACA,SACI;AACJ,gBAAY,IAAK,SAAS,IAAK;AAC/B,QAAK,CAAE,WAAY;AAClB,kBAAY;AACZ,uCAAAA,SAAqB,cAAe;AAAA,IACrC;AAAA,EACD;AAUA,QAAM,QAAoC,CACzC,YACI;AACJ,UAAM,WAAW,YAAY,IAAK,OAAQ;AAC1C,QAAK,WAAc,UAAW;AAC7B,aAAO;AAAA,IACR;AAEA,gBAAY,OAAQ,OAAQ;AAC5B,aAAS;AAET,WAAO;AAAA,EACR;AAWA,QAAM,SAAsC,CAC3C,YACI;AACJ,WAAO,YAAY,OAAQ,OAAQ;AAAA,EACpC;AAKA,QAAM,QAAoC,MAAM;AAC/C,gBAAY,MAAM;AAClB,gBAAY;AAAA,EACb;AAEA,SAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD;",
6
6
  "names": ["requestIdleCallback"]
7
7
  }
@@ -16,6 +16,8 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // packages/priority-queue/src/request-idle-callback.ts
19
21
  var request_idle_callback_exports = {};
20
22
  __export(request_idle_callback_exports, {
21
23
  createRequestIdleCallback: () => createRequestIdleCallback,
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/request-idle-callback.ts"],
4
4
  "sourcesContent": ["/**\n * External dependencies\n */\nimport 'requestidlecallback';\n\n/**\n * Internal dependencies\n */\nimport type { RequestIdleCallbackCallback } from './types';\n\n/**\n * @return A function that schedules a callback when the browser is idle or via setTimeout on the server.\n */\nexport function createRequestIdleCallback() {\n\tif ( typeof window === 'undefined' ) {\n\t\treturn ( callback: RequestIdleCallbackCallback ) => {\n\t\t\tsetTimeout( () => callback( Date.now() ), 0 );\n\t\t};\n\t}\n\n\treturn window.requestIdleCallback;\n}\n\nexport default createRequestIdleCallback();\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,iCAAO;AAUA,SAAS,4BAA4B;AAC3C,MAAK,OAAO,WAAW,aAAc;AACpC,WAAO,CAAE,aAA2C;AACnD,iBAAY,MAAM,SAAU,KAAK,IAAI,CAAE,GAAG,CAAE;AAAA,IAC7C;AAAA,EACD;AAEA,SAAO,OAAO;AACf;AAEA,IAAO,gCAAQ,0BAA0B;",
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,iCAAO;AAUA,SAAS,4BAA4B;AAC3C,MAAK,OAAO,WAAW,aAAc;AACpC,WAAO,CAAE,aAA2C;AACnD,iBAAY,MAAM,SAAU,KAAK,IAAI,CAAE,GAAG,CAAE;AAAA,IAC7C;AAAA,EACD;AAEA,SAAO,OAAO;AACf;AAEA,IAAO,gCAAQ,0BAA0B;",
6
6
  "names": []
7
7
  }
package/build/types.js CHANGED
@@ -12,6 +12,8 @@ var __copyProps = (to, from, except, desc) => {
12
12
  return to;
13
13
  };
14
14
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // packages/priority-queue/src/types.ts
15
17
  var types_exports = {};
16
18
  module.exports = __toCommonJS(types_exports);
17
19
  //# sourceMappingURL=types.js.map
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/types.ts"],
4
4
  "sourcesContent": ["export type RequestIdleCallbackCallback = (\n\t/**\n\t * @param timeOrDeadline - IdleDeadline object or a timestamp number.\n\t */\n\ttimeOrDeadline: IdleDeadline | number\n) => void;\n"],
5
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
5
+ "mappings": ";;;;;;;;;;;;;;;;AAAA;AAAA;",
6
6
  "names": []
7
7
  }
@@ -1,5 +1,6 @@
1
+ // packages/priority-queue/src/index.ts
1
2
  import requestIdleCallback from "./request-idle-callback";
2
- const createQueue = () => {
3
+ var createQueue = () => {
3
4
  const waitingList = /* @__PURE__ */ new Map();
4
5
  let isRunning = false;
5
6
  const runWaitingList = (deadline) => {
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts"],
4
4
  "sourcesContent": ["/**\n * Internal dependencies\n */\nimport requestIdleCallback from './request-idle-callback';\n\n/**\n * Enqueued callback to invoke once idle time permits.\n */\nexport type WPPriorityQueueCallback = VoidFunction;\n\n/**\n * An object used to associate callbacks in a particular context grouping.\n */\nexport type WPPriorityQueueContext = object;\n\n/**\n * Interface for the priority queue instance.\n */\nexport interface WPPriorityQueue {\n\t/**\n\t * Add a callback to the queue for a given context.\n\t */\n\tadd: (\n\t\telement: WPPriorityQueueContext,\n\t\titem: WPPriorityQueueCallback\n\t) => void;\n\n\t/**\n\t * Flush and run the callback for a given context immediately.\n\t * @return true if a callback was run, false otherwise.\n\t */\n\tflush: ( element: WPPriorityQueueContext ) => boolean;\n\n\t/**\n\t * Cancel (remove) the callback for a given context without running it.\n\t * @return true if a callback was cancelled, false otherwise.\n\t */\n\tcancel: ( element: WPPriorityQueueContext ) => boolean;\n\n\t/**\n\t * Reset the entire queue, clearing pending callbacks.\n\t */\n\treset: VoidFunction;\n}\n\n/**\n * Creates a context-aware queue that only executes\n * the last task of a given context.\n *\n * @example\n *```js\n * import { createQueue } from '@wordpress/priority-queue';\n *\n * const queue = createQueue();\n *\n * // Context objects.\n * const ctx1 = {};\n * const ctx2 = {};\n *\n * // For a given context in the queue, only the last callback is executed.\n * queue.add( ctx1, () => console.log( 'This will be printed first' ) );\n * queue.add( ctx2, () => console.log( 'This won\\'t be printed' ) );\n * queue.add( ctx2, () => console.log( 'This will be printed second' ) );\n *```\n *\n * @return {WPPriorityQueue} Queue object with `add`, `flush` and `reset` methods.\n */\nexport const createQueue = (): WPPriorityQueue => {\n\tconst waitingList = new Map<\n\t\tWPPriorityQueueContext,\n\t\tWPPriorityQueueCallback\n\t>();\n\tlet isRunning = false;\n\n\t/**\n\t * Callback to process as much queue as time permits.\n\t *\n\t * Map Iteration follows the original insertion order. This means that here\n\t * we can iterate the queue and know that the first contexts which were\n\t * added will be run first. On the other hand, if anyone adds a new callback\n\t * for an existing context it will supplant the previously-set callback for\n\t * that context because we reassigned that map key's value.\n\t *\n\t * In the case that a callback adds a new callback to its own context then\n\t * the callback it adds will appear at the end of the iteration and will be\n\t * run only after all other existing contexts have finished executing.\n\t *\n\t * @param {IdleDeadline|number} deadline Idle callback deadline object, or\n\t * animation frame timestamp.\n\t */\n\tconst runWaitingList = ( deadline: IdleDeadline | number ): void => {\n\t\tfor ( const [ nextElement, callback ] of waitingList ) {\n\t\t\twaitingList.delete( nextElement );\n\t\t\tcallback();\n\n\t\t\tif (\n\t\t\t\t'number' === typeof deadline ||\n\t\t\t\tdeadline.timeRemaining() <= 0\n\t\t\t) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ( waitingList.size === 0 ) {\n\t\t\tisRunning = false;\n\t\t\treturn;\n\t\t}\n\n\t\trequestIdleCallback( runWaitingList );\n\t};\n\n\t/**\n\t * Add a callback to the queue for a given context.\n\t *\n\t * If errors with undefined callbacks are encountered double check that\n\t * all of your useSelect calls have the right dependencies set correctly\n\t * in their second parameter. Missing dependencies can cause unexpected\n\t * loops and race conditions in the queue.\n\t *\n\t * @param {WPPriorityQueueContext} element Context object.\n\t * @param {WPPriorityQueueCallback} item Callback function.\n\t */\n\tconst add: WPPriorityQueue[ 'add' ] = (\n\t\telement: WPPriorityQueueContext,\n\t\titem: WPPriorityQueueCallback\n\t) => {\n\t\twaitingList.set( element, item );\n\t\tif ( ! isRunning ) {\n\t\t\tisRunning = true;\n\t\t\trequestIdleCallback( runWaitingList );\n\t\t}\n\t};\n\n\t/**\n\t * Flushes queue for a given context, returning true if the flush was\n\t * performed, or false if there is no queue for the given context.\n\t *\n\t * @param {WPPriorityQueueContext} element Context object.\n\t *\n\t * @return {boolean} Whether flush was performed.\n\t */\n\tconst flush: WPPriorityQueue[ 'flush' ] = (\n\t\telement: WPPriorityQueueContext\n\t) => {\n\t\tconst callback = waitingList.get( element );\n\t\tif ( undefined === callback ) {\n\t\t\treturn false;\n\t\t}\n\n\t\twaitingList.delete( element );\n\t\tcallback();\n\n\t\treturn true;\n\t};\n\n\t/**\n\t * Clears the queue for a given context, cancelling the callbacks without\n\t * executing them. Returns `true` if there were scheduled callbacks to cancel,\n\t * or `false` if there was is no queue for the given context.\n\t *\n\t * @param {WPPriorityQueueContext} element Context object.\n\t *\n\t * @return {boolean} Whether any callbacks got cancelled.\n\t */\n\tconst cancel: WPPriorityQueue[ 'cancel' ] = (\n\t\telement: WPPriorityQueueContext\n\t) => {\n\t\treturn waitingList.delete( element );\n\t};\n\n\t/**\n\t * Reset the queue without running the pending callbacks.\n\t */\n\tconst reset: WPPriorityQueue[ 'reset' ] = () => {\n\t\twaitingList.clear();\n\t\tisRunning = false;\n\t};\n\n\treturn {\n\t\tadd,\n\t\tflush,\n\t\tcancel,\n\t\treset,\n\t};\n};\n"],
5
- "mappings": "AAGA,OAAO,yBAAyB;AAgEzB,MAAM,cAAc,MAAuB;AACjD,QAAM,cAAc,oBAAI,IAGtB;AACF,MAAI,YAAY;AAkBhB,QAAM,iBAAiB,CAAE,aAA2C;AACnE,eAAY,CAAE,aAAa,QAAS,KAAK,aAAc;AACtD,kBAAY,OAAQ,WAAY;AAChC,eAAS;AAET,UACC,aAAa,OAAO,YACpB,SAAS,cAAc,KAAK,GAC3B;AACD;AAAA,MACD;AAAA,IACD;AAEA,QAAK,YAAY,SAAS,GAAI;AAC7B,kBAAY;AACZ;AAAA,IACD;AAEA,wBAAqB,cAAe;AAAA,EACrC;AAaA,QAAM,MAAgC,CACrC,SACA,SACI;AACJ,gBAAY,IAAK,SA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AsC,CAC3C,YACI;AACJ,WAAO,YAAY,OAAQ,OAAQ;AAAA,EACpC;AAKA,QAAM,QAAoC,MAAM;AAC/C,gBAAY,MAAM;AAClB,gBAAY;AAAA,EACb;AAEA,SAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD;",
6
6
  "names": []
7
7
  }
@@ -1,3 +1,4 @@
1
+ // packages/priority-queue/src/request-idle-callback.ts
1
2
  import "requestidlecallback";
2
3
  function createRequestIdleCallback() {
3
4
  if (typeof window === "undefined") {
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/request-idle-callback.ts"],
4
4
  "sourcesContent": ["/**\n * External dependencies\n */\nimport 'requestidlecallback';\n\n/**\n * Internal dependencies\n */\nimport type { RequestIdleCallbackCallback } from './types';\n\n/**\n * @return A function that schedules a callback when the browser is idle or via setTimeout on the server.\n */\nexport function createRequestIdleCallback() {\n\tif ( typeof window === 'undefined' ) {\n\t\treturn ( callback: RequestIdleCallbackCallback ) => {\n\t\t\tsetTimeout( () => callback( Date.now() ), 0 );\n\t\t};\n\t}\n\n\treturn window.requestIdleCallback;\n}\n\nexport default createRequestIdleCallback();\n"],
5
- "mappings": "AAGA,OAAO;AAUA,SAAS,4BAA4B;AAC3C,MAAK,OAAO,WAAW,aAAc;AACpC,WAAO,CAAE,aAA2C;AACnD,iBAAY,MAAM,SAAU,KAAK,IAAI,CAAE,GAAG,CAAE;AAAA,IAC7C;AAAA,EACD;AAEA,SAAO,OAAO;AACf;AAEA,IAAO,gCAAQ,0BAA0B;",
5
+ "mappings": ";AAGA,OAAO;AAUA,SAAS,4BAA4B;AAC3C,MAAK,OAAO,WAAW,aAAc;AACpC,WAAO,CAAE,aAA2C;AACnD,iBAAY,MAAM,SAAU,KAAK,IAAI,CAAE,GAAG,CAAE;AAAA,IAC7C;AAAA,EACD;AAEA,SAAO,OAAO;AACf;AAEA,IAAO,gCAAQ,0BAA0B;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/priority-queue",
3
- "version": "3.34.0",
3
+ "version": "3.34.1-next.2f1c7c01b.0",
4
4
  "description": "Generic browser priority queue.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -43,5 +43,5 @@
43
43
  "publishConfig": {
44
44
  "access": "public"
45
45
  },
46
- "gitHead": "ceebff807958d2e8fc755b5a20473939c78b4d1d"
46
+ "gitHead": "c6ddcdf455bc02567a2c9e03de6862a2061b85e8"
47
47
  }