msw-dev-tool 1.1.4 → 1.1.6

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.
Files changed (80) hide show
  1. package/dist/cjs/index.js +28247 -4
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/msw-dev-tool.css +1 -1
  4. package/dist/esm/index.js +28231 -2
  5. package/dist/esm/index.js.map +1 -1
  6. package/dist/esm/msw-dev-tool.css +1 -1
  7. package/dist/types/index.d.ts +1 -1
  8. package/package.json +7 -2
  9. package/dist/cjs/_virtual/_commonjsHelpers.js +0 -6
  10. package/dist/cjs/_virtual/_commonjsHelpers.js.map +0 -1
  11. package/dist/cjs/_virtual/lodash.js +0 -6
  12. package/dist/cjs/_virtual/lodash.js.map +0 -1
  13. package/dist/cjs/const/handler.js +0 -10
  14. package/dist/cjs/const/handler.js.map +0 -1
  15. package/dist/cjs/hook/useFlattenHandlersTable.js +0 -71
  16. package/dist/cjs/hook/useFlattenHandlersTable.js.map +0 -1
  17. package/dist/cjs/lib/handlerStore.js +0 -66
  18. package/dist/cjs/lib/handlerStore.js.map +0 -1
  19. package/dist/cjs/lib/util.js +0 -64
  20. package/dist/cjs/lib/util.js.map +0 -1
  21. package/dist/cjs/node_modules/.pnpm/@tanstack_react-table@8.20.6_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@tanstack/react-table/build/lib/index.js +0 -137
  22. package/dist/cjs/node_modules/.pnpm/@tanstack_react-table@8.20.6_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@tanstack/react-table/build/lib/index.js.map +0 -1
  23. package/dist/cjs/node_modules/.pnpm/@tanstack_table-core@8.20.5/node_modules/@tanstack/table-core/build/lib/index.js +0 -3012
  24. package/dist/cjs/node_modules/.pnpm/@tanstack_table-core@8.20.5/node_modules/@tanstack/table-core/build/lib/index.js.map +0 -1
  25. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js +0 -17209
  26. package/dist/cjs/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js.map +0 -1
  27. package/dist/cjs/store/uiControlStore.js +0 -13
  28. package/dist/cjs/store/uiControlStore.js.map +0 -1
  29. package/dist/cjs/ui/DevToolContent/DevToolContentContainer.js +0 -18
  30. package/dist/cjs/ui/DevToolContent/DevToolContentContainer.js.map +0 -1
  31. package/dist/cjs/ui/DevToolContent/HttpControl.js +0 -21
  32. package/dist/cjs/ui/DevToolContent/HttpControl.js.map +0 -1
  33. package/dist/cjs/ui/MSWDevTool.js +0 -16
  34. package/dist/cjs/ui/MSWDevTool.js.map +0 -1
  35. package/dist/cjs/ui/Table/PreviewHandler/KeyValueInputList.js +0 -73
  36. package/dist/cjs/ui/Table/PreviewHandler/KeyValueInputList.js.map +0 -1
  37. package/dist/cjs/ui/Table/PreviewHandler/PathParamSetter.js +0 -22
  38. package/dist/cjs/ui/Table/PreviewHandler/PathParamSetter.js.map +0 -1
  39. package/dist/cjs/ui/Table/PreviewHandler/RequestPreview.js +0 -68
  40. package/dist/cjs/ui/Table/PreviewHandler/RequestPreview.js.map +0 -1
  41. package/dist/cjs/ui/Table/PreviewHandler/index.js +0 -61
  42. package/dist/cjs/ui/Table/PreviewHandler/index.js.map +0 -1
  43. package/dist/cjs/utils/url.js +0 -43
  44. package/dist/cjs/utils/url.js.map +0 -1
  45. package/dist/esm/_virtual/_commonjsHelpers.js +0 -4
  46. package/dist/esm/_virtual/_commonjsHelpers.js.map +0 -1
  47. package/dist/esm/_virtual/lodash.js +0 -4
  48. package/dist/esm/_virtual/lodash.js.map +0 -1
  49. package/dist/esm/const/handler.js +0 -7
  50. package/dist/esm/const/handler.js.map +0 -1
  51. package/dist/esm/hook/useFlattenHandlersTable.js +0 -69
  52. package/dist/esm/hook/useFlattenHandlersTable.js.map +0 -1
  53. package/dist/esm/lib/handlerStore.js +0 -63
  54. package/dist/esm/lib/handlerStore.js.map +0 -1
  55. package/dist/esm/lib/util.js +0 -58
  56. package/dist/esm/lib/util.js.map +0 -1
  57. package/dist/esm/node_modules/.pnpm/@tanstack_react-table@8.20.6_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@tanstack/react-table/build/lib/index.js +0 -75
  58. package/dist/esm/node_modules/.pnpm/@tanstack_react-table@8.20.6_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@tanstack/react-table/build/lib/index.js.map +0 -1
  59. package/dist/esm/node_modules/.pnpm/@tanstack_table-core@8.20.5/node_modules/@tanstack/table-core/build/lib/index.js +0 -2970
  60. package/dist/esm/node_modules/.pnpm/@tanstack_table-core@8.20.5/node_modules/@tanstack/table-core/build/lib/index.js.map +0 -1
  61. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js +0 -17207
  62. package/dist/esm/node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js.map +0 -1
  63. package/dist/esm/store/uiControlStore.js +0 -11
  64. package/dist/esm/store/uiControlStore.js.map +0 -1
  65. package/dist/esm/ui/DevToolContent/DevToolContentContainer.js +0 -16
  66. package/dist/esm/ui/DevToolContent/DevToolContentContainer.js.map +0 -1
  67. package/dist/esm/ui/DevToolContent/HttpControl.js +0 -19
  68. package/dist/esm/ui/DevToolContent/HttpControl.js.map +0 -1
  69. package/dist/esm/ui/MSWDevTool.js +0 -14
  70. package/dist/esm/ui/MSWDevTool.js.map +0 -1
  71. package/dist/esm/ui/Table/PreviewHandler/KeyValueInputList.js +0 -71
  72. package/dist/esm/ui/Table/PreviewHandler/KeyValueInputList.js.map +0 -1
  73. package/dist/esm/ui/Table/PreviewHandler/PathParamSetter.js +0 -20
  74. package/dist/esm/ui/Table/PreviewHandler/PathParamSetter.js.map +0 -1
  75. package/dist/esm/ui/Table/PreviewHandler/RequestPreview.js +0 -66
  76. package/dist/esm/ui/Table/PreviewHandler/RequestPreview.js.map +0 -1
  77. package/dist/esm/ui/Table/PreviewHandler/index.js +0 -59
  78. package/dist/esm/ui/Table/PreviewHandler/index.js.map +0 -1
  79. package/dist/esm/utils/url.js +0 -39
  80. package/dist/esm/utils/url.js.map +0 -1
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { HttpHandler } from 'msw';
3
3
  import { SetupWorker } from 'msw/browser';
4
4
 
5
- declare const MSWDevTool: () => React.ReactPortal;
5
+ declare const MSWDevTool: () => React.JSX.Element;
6
6
 
7
7
  type FlattenHandler = {
8
8
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "msw-dev-tool",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -51,9 +51,14 @@
51
51
  "zustand": "^5.0.2"
52
52
  },
53
53
  "dependencies": {
54
+ "@radix-ui/colors": "^3.0.0",
55
+ "@radix-ui/react-dialog": "^1.1.6",
56
+ "@radix-ui/react-label": "^2.1.2",
57
+ "@radix-ui/themes": "^3.2.1",
54
58
  "@tanstack/react-table": "^8.20.6",
55
59
  "@types/lodash": "^4.17.15",
56
60
  "immer": "^10.1.1",
57
- "lodash": "^4.17.21"
61
+ "lodash": "^4.17.21",
62
+ "vaul": "^1.1.2"
58
63
  }
59
64
  }
@@ -1,6 +0,0 @@
1
- 'use strict';
2
-
3
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
4
-
5
- exports.commonjsGlobal = commonjsGlobal;
6
- //# sourceMappingURL=_commonjsHelpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_commonjsHelpers.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -1,6 +0,0 @@
1
- 'use strict';
2
-
3
- var lodash = {exports: {}};
4
-
5
- exports.__module = lodash;
6
- //# sourceMappingURL=lodash.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lodash.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
@@ -1,10 +0,0 @@
1
- 'use strict';
2
-
3
- var msw = require('msw');
4
-
5
- const dummyUrl = "/msw-dev-tool-dummy";
6
- const dummyHandler = msw.http.get(dummyUrl, () => { });
7
-
8
- exports.dummyHandler = dummyHandler;
9
- exports.dummyUrl = dummyUrl;
10
- //# sourceMappingURL=handler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"handler.js","sources":["../../../src/const/handler.ts"],"sourcesContent":["import { http } from \"msw\";\n\nexport const dummyUrl = \"/msw-dev-tool-dummy\";\n\nexport const dummyHandler = http.get(dummyUrl, () => {});\n"],"names":["http"],"mappings":";;;;AAEO,MAAM,QAAQ,GAAG,sBAAsB;AAEvC,MAAM,YAAY,GAAGA,QAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAO,GAAC;;;;;"}
@@ -1,71 +0,0 @@
1
- 'use strict';
2
-
3
- var index$1 = require('../node_modules/.pnpm/@tanstack_react-table@8.20.6_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@tanstack/react-table/build/lib/index.js');
4
- var handlerStore = require('../lib/handlerStore.js');
5
- var React = require('react');
6
- var index = require('../ui/Table/PreviewHandler/index.js');
7
- var index$2 = require('../node_modules/.pnpm/@tanstack_table-core@8.20.5/node_modules/@tanstack/table-core/build/lib/index.js');
8
-
9
- const useFlattenHandlersTable = () => {
10
- const { flattenHandlers, handlerRowSelection, handleHandlerRowSelectionChange, } = handlerStore.useHandlerStore();
11
- const columnHelper = index$2.createColumnHelper();
12
- const columns = React.useMemo(() => {
13
- return [
14
- columnHelper.accessor("enabled", {
15
- header: ({ table }) => (React.createElement("input", { type: "checkbox", checked: table.getIsAllRowsSelected(), onChange: (e) => table.toggleAllRowsSelected(e.target.checked) })),
16
- cell: ({ row }) => (React.createElement("input", { type: "checkbox", checked: row.getIsSelected(), onChange: (e) => row.toggleSelected(e.target.checked) })),
17
- }),
18
- columnHelper.accessor("path", {
19
- header: "Protocol",
20
- cell: ({ row }) => {
21
- console.log(row.original.path);
22
- const protocol = new URL(row.original.path, location.href).protocol;
23
- return React.createElement("div", { className: "msw-dev-tool-center" }, protocol);
24
- },
25
- }),
26
- columnHelper.accessor("path", {
27
- header: "Host",
28
- cell: ({ row }) => {
29
- const host = new URL(row.original.path, location.href).host;
30
- return React.createElement("div", { className: "msw-dev-tool-center" }, host);
31
- },
32
- }),
33
- columnHelper.accessor("path", {
34
- header: "Path",
35
- cell: ({ row }) => {
36
- const path = new URL(row.original.path, location.href).pathname;
37
- return React.createElement("div", { className: "msw-dev-tool-center" }, path);
38
- },
39
- }),
40
- columnHelper.accessor("method", {
41
- header: "Method",
42
- cell: ({ row }) => (React.createElement("div", { className: "msw-dev-tool-center" }, row.original.method)),
43
- }),
44
- columnHelper.accessor("handler", {
45
- header: "Preview",
46
- cell: ({ row }) => {
47
- const handler = row.original.handler;
48
- const [isOpen, setIsOpen] = React.useState(false);
49
- return (React.createElement(React.Fragment, null,
50
- React.createElement("button", { onClick: () => setIsOpen(true) }, "Preview"),
51
- isOpen && (React.createElement(index.PreviewHandler, { handler: handler, onClose: () => setIsOpen(false) }))));
52
- },
53
- }),
54
- ];
55
- }, []);
56
- const table = index$1.useReactTable({
57
- columns,
58
- data: flattenHandlers,
59
- getCoreRowModel: index$2.getCoreRowModel(),
60
- state: {
61
- rowSelection: handlerRowSelection,
62
- },
63
- onRowSelectionChange: handleHandlerRowSelectionChange,
64
- getRowId: (row) => row.id,
65
- enableRowSelection: true,
66
- });
67
- return table;
68
- };
69
-
70
- exports.useFlattenHandlersTable = useFlattenHandlersTable;
71
- //# sourceMappingURL=useFlattenHandlersTable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useFlattenHandlersTable.js","sources":["../../../src/hook/useFlattenHandlersTable.tsx"],"sourcesContent":["import {\n ColumnDef,\n createColumnHelper,\n getCoreRowModel,\n useReactTable,\n} from \"@tanstack/react-table\";\nimport { useHandlerStore } from \"../lib/handlerStore\";\nimport { FlattenHandler } from \"../lib\";\nimport React, { useMemo, useState } from \"react\";\nimport { PreviewHandler } from \"../ui/Table/PreviewHandler\";\n\nexport const useFlattenHandlersTable = () => {\n const {\n flattenHandlers,\n handlerRowSelection,\n handleHandlerRowSelectionChange,\n } = useHandlerStore();\n\n const columnHelper = createColumnHelper<FlattenHandler>();\n const columns: ColumnDef<FlattenHandler, any>[] = useMemo(() => {\n return [\n columnHelper.accessor(\"enabled\", {\n header: ({ table }) => (\n <input\n type=\"checkbox\"\n checked={table.getIsAllRowsSelected()}\n onChange={(e) => table.toggleAllRowsSelected(e.target.checked)}\n />\n ),\n cell: ({ row }) => (\n <input\n type=\"checkbox\"\n checked={row.getIsSelected()}\n onChange={(e) => row.toggleSelected(e.target.checked)}\n />\n ),\n }),\n columnHelper.accessor(\"path\", {\n header: \"Protocol\",\n cell: ({ row }) => {\n console.log(row.original.path);\n const protocol = new URL(row.original.path, location.href).protocol;\n return <div className=\"msw-dev-tool-center\">{protocol}</div>;\n },\n }),\n columnHelper.accessor(\"path\", {\n header: \"Host\",\n cell: ({ row }) => {\n const host = new URL(row.original.path,location.href).host;\n return <div className=\"msw-dev-tool-center\">{host}</div>;\n },\n }),\n columnHelper.accessor(\"path\", {\n header: \"Path\",\n cell: ({ row }) => {\n const path = new URL(row.original.path, location.href).pathname;\n return <div className=\"msw-dev-tool-center\">{path}</div>;\n },\n }),\n columnHelper.accessor(\"method\", {\n header: \"Method\",\n cell: ({ row }) => (\n <div className=\"msw-dev-tool-center\">{row.original.method}</div>\n ),\n }),\n columnHelper.accessor(\"handler\", {\n header: \"Preview\",\n cell: ({ row }) => {\n const handler = row.original.handler;\n const [isOpen, setIsOpen] = useState(false);\n return (\n <>\n <button onClick={() => setIsOpen(true)}>Preview</button>\n {isOpen && (\n <PreviewHandler\n handler={handler}\n onClose={() => setIsOpen(false)}\n />\n )}\n </>\n );\n },\n }),\n ];\n }, []);\n\n const table = useReactTable({\n columns,\n data: flattenHandlers,\n getCoreRowModel: getCoreRowModel(),\n state: {\n rowSelection: handlerRowSelection,\n },\n onRowSelectionChange: handleHandlerRowSelectionChange,\n getRowId: (row) => row.id,\n enableRowSelection: true,\n });\n\n return table;\n};\n"],"names":["useHandlerStore","createColumnHelper","useMemo","useState","PreviewHandler","useReactTable","getCoreRowModel"],"mappings":";;;;;;;;AAWO,MAAM,uBAAuB,GAAG,MAAK;IAC1C,MAAM,EACJ,eAAe,EACf,mBAAmB,EACnB,+BAA+B,GAChC,GAAGA,4BAAe,EAAE,CAAC;AAEtB,IAAA,MAAM,YAAY,GAAGC,0BAAkB,EAAkB,CAAC;AAC1D,IAAA,MAAM,OAAO,GAAqCC,aAAO,CAAC,MAAK;QAC7D,OAAO;AACL,YAAA,YAAY,CAAC,QAAQ,CAAC,SAAS,EAAE;AAC/B,gBAAA,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,MAChB,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EACE,IAAI,EAAC,UAAU,EACf,OAAO,EAAE,KAAK,CAAC,oBAAoB,EAAE,EACrC,QAAQ,EAAE,CAAC,CAAC,KAAK,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,GAC9D,CACH;AACD,gBAAA,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,MACZ,KAAA,CAAA,aAAA,CAAA,OAAA,EAAA,EACE,IAAI,EAAC,UAAU,EACf,OAAO,EAAE,GAAG,CAAC,aAAa,EAAE,EAC5B,QAAQ,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,GACrD,CACH;aACF,CAAC;AACF,YAAA,YAAY,CAAC,QAAQ,CAAC,MAAM,EAAE;AAC5B,gBAAA,MAAM,EAAE,UAAU;AAClB,gBAAA,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,KAAI;oBAChB,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CA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AAY,CAAC,QAAQ,CAAC,SAAS,EAAE;AAC/B,gBAAA,MAAM,EAAE,SAAS;AACjB,gBAAA,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,KAAI;AAChB,oBAAA,MAAM,OAAO,GAAG,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC;oBACrC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAGC,cAAQ,CAAC,KAAK,CAAC,CAAC;AAC5C,oBAAA,QACE,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA;wBACE,KAAQ,CAAA,aAAA,CAAA,QAAA,EAAA,EAAA,OAAO,EAAE,MAAM,SAAS,CAAC,IAAI,CAAC,EAAkB,EAAA,SAAA,CAAA;wBACvD,MAAM,KACL,KAAC,CAAA,aAAA,CAAAC,oBAAc,IACb,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,MAAM,SAAS,CAAC,KAAK,CAAC,EAC/B,CAAA,CACH,CACA,EACH;iBACH;aACF,CAAC;SACH,CAAC;KACH,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,KAAK,GAAGC,qBAAa,CAAC;QAC1B,OAAO;AACP,QAAA,IAAI,EAAE,eAAe;QACrB,eAAe,EAAEC,uBAAe,EAAE;AAClC,QAAA,KAAK,EAAE;AACL,YAAA,YAAY,EAAE,mBAAmB;AAClC,SAAA;AACD,QAAA,oBAAoB,EAAE,+BAA+B;QACrD,QAAQ,EAAE,CAAC,GAAG,KAAK,GAAG,CAAC,EAAE;AACzB,QAAA,kBAAkB,EAAE,IAAI;AACzB,KAAA,CAAC,CAAC;AAEH,IAAA,OAAO,KAAK,CAAC;AACf;;;;"}
@@ -1,66 +0,0 @@
1
- 'use strict';
2
-
3
- var zustand = require('zustand');
4
- var util = require('./util.js');
5
- var lodash = require('../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js');
6
-
7
- const useHandlerStore = zustand.create((set, get) => ({
8
- flattenHandlers: [],
9
- worker: null,
10
- restHandlers: [],
11
- handlerRowSelection: {},
12
- initMSWDevTool: (_worker) => {
13
- const { worker, flattenHandlers, handlerRowSelection, unsupportedHandlers, } = util.initMSWDevToolStore(_worker);
14
- set({ worker });
15
- set({ flattenHandlers });
16
- set({
17
- handlerRowSelection,
18
- });
19
- set({ restHandlers: unsupportedHandlers });
20
- return worker;
21
- },
22
- resetMSWDevTool: () => {
23
- const _worker = get().getWorker();
24
- _worker.resetHandlers();
25
- const { worker, flattenHandlers, handlerRowSelection, unsupportedHandlers, } = util.initMSWDevToolStore(_worker);
26
- set({ worker });
27
- set({ flattenHandlers });
28
- set({
29
- handlerRowSelection,
30
- });
31
- set({ restHandlers: unsupportedHandlers });
32
- },
33
- handleHandlerRowSelectionChange: (updater) => {
34
- const worker = get().getWorker();
35
- if (lodash.lodashExports.isFunction(updater)) {
36
- set(({ handlerRowSelection }) => {
37
- const next = updater(handlerRowSelection);
38
- const current = get().flattenHandlers.map((handler) => next[handler.id]
39
- ? { ...handler, enabled: true }
40
- : { ...handler, enabled: false });
41
- return { handlerRowSelection: next, flattenHandlers: current };
42
- });
43
- }
44
- else {
45
- const current = get().flattenHandlers.map((handler) => updater[handler.id]
46
- ? { ...handler, enabled: true }
47
- : { ...handler, enabled: false });
48
- set({ handlerRowSelection: updater, flattenHandlers: current });
49
- }
50
- const flattenHandlers = get().flattenHandlers;
51
- const restHandlers = get().restHandlers;
52
- const totalEnableHandlers = util.getTotalEnableHandlers(flattenHandlers, restHandlers);
53
- util.updateEnableHandlers(worker, totalEnableHandlers);
54
- },
55
- getWorker: () => {
56
- const worker = get().worker;
57
- if (!worker)
58
- throw new Error("Worker is not initialized");
59
- return worker;
60
- },
61
- }));
62
- const initMSWDevTool = useHandlerStore.getState().initMSWDevTool;
63
-
64
- exports.initMSWDevTool = initMSWDevTool;
65
- exports.useHandlerStore = useHandlerStore;
66
- //# sourceMappingURL=handlerStore.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"handlerStore.js","sources":["../../../src/lib/handlerStore.ts"],"sourcesContent":["import { SetupWorker } from \"msw/browser\";\nimport { create } from \"zustand\";\nimport { FlattenHandler, Handler } from \"./type\";\nimport {\n convertHandlers,\n getTotalEnableHandlers,\n initMSWDevToolStore,\n updateEnableHandlers,\n} from \"./util\";\nimport { OnChangeFn, RowSelectionState, Updater } from \"@tanstack/react-table\";\nimport { isFunction } from \"lodash\";\n\nexport interface HandlerStoreState {\n /**\n * @remarks ⚠️ To be safe, access `getWorker()` rather than `get().worker` directly.\n */\n worker: SetupWorker | null;\n /**\n * GraphQL or WebSocketHandler\n *\n * **Currently not supported**\n */\n restHandlers: Handler[];\n flattenHandlers: FlattenHandler[];\n handlerRowSelection: RowSelectionState;\n initMSWDevTool: (worker: SetupWorker) => SetupWorker;\n resetMSWDevTool: () => void;\n handleHandlerRowSelectionChange: OnChangeFn<RowSelectionState>;\n getWorker: () => SetupWorker;\n}\nexport const useHandlerStore = create<HandlerStoreState>((set, get) => ({\n flattenHandlers: [],\n worker: null,\n restHandlers: [],\n handlerRowSelection: {},\n initMSWDevTool: (_worker) => {\n const {\n worker,\n flattenHandlers,\n handlerRowSelection,\n unsupportedHandlers,\n } = initMSWDevToolStore(_worker);\n\n set({ worker });\n set({ flattenHandlers });\n set({\n handlerRowSelection,\n });\n set({ restHandlers: unsupportedHandlers });\n\n return worker;\n },\n resetMSWDevTool: () => {\n const _worker = get().getWorker();\n _worker.resetHandlers();\n \n const {\n worker,\n flattenHandlers,\n handlerRowSelection,\n unsupportedHandlers,\n } = initMSWDevToolStore(_worker);\n\n set({ worker });\n set({ flattenHandlers });\n set({\n handlerRowSelection,\n });\n set({ restHandlers: unsupportedHandlers });\n },\n handleHandlerRowSelectionChange: (updater) => {\n const worker = get().getWorker();\n\n if (isFunction(updater)) {\n set(({ handlerRowSelection }) => {\n const next = updater(handlerRowSelection);\n const current = get().flattenHandlers.map((handler) =>\n next[handler.id]\n ? { ...handler, enabled: true }\n : { ...handler, enabled: false }\n );\n return { handlerRowSelection: next, flattenHandlers: current };\n });\n } else {\n const current = get().flattenHandlers.map((handler) =>\n updater[handler.id]\n ? { ...handler, enabled: true }\n : { ...handler, enabled: false }\n );\n set({ handlerRowSelection: updater, flattenHandlers: current });\n }\n\n const flattenHandlers = get().flattenHandlers;\n const restHandlers = get().restHandlers;\n const totalEnableHandlers = getTotalEnableHandlers(\n flattenHandlers,\n restHandlers\n );\n updateEnableHandlers(worker, totalEnableHandlers);\n },\n getWorker: () => {\n const worker = get().worker;\n if (!worker) throw new Error(\"Worker is not initialized\");\n return worker;\n },\n}));\n\nexport const initMSWDevTool = useHandlerStore.getState().initMSWDevTool;\n"],"names":["create","initMSWDevToolStore","isFunction","getTotalEnableHandlers","updateEnableHandlers"],"mappings":";;;;;;AA8BO,MAAM,eAAe,GAAGA,cAAM,CAAoB,CAAC,GAAG,EAAE,GAAG,MAAM;AACtE,IAAA,eAAe,EAAE,EAAE;AACnB,IAAA,MAAM,EAAE,IAAI;AACZ,IAAA,YAAY,EAAE,EAAE;AAChB,IAAA,mBAAmB,EAAE,EAAE;AACvB,IAAA,cAAc,EAAE,CAAC,OAAO,KAAI;AAC1B,QAAA,MAAM,EACJ,MAAM,EACN,eAAe,EACf,mBAAmB,EACnB,mBAAmB,GACpB,GAAGC,wBAAmB,CAAC,OAAO,CAAC,CAAC;AAEjC,QAAA,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;AAChB,QAAA,GAAG,CAAC,EAAE,eAAe,EAAE,CAAC,CAAC;AACzB,QAAA,GAAG,CAAC;YACF,mBAAmB;AACpB,SAAA,CAAC,CAAC;AACH,QAAA,GAAG,CAAC,EAAE,YAAY,EAAE,mBAAmB,EAAE,CAAC,CAAC;AAE3C,QAAA,OAAO,MAAM,CAAC;KACf;IACD,eAAe,EAAE,MAAK;AACpB,QAAA,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,SAAS,EAAE,CAAC;QAClC,OAAO,CAAC,aAAa,EAAE,CAAC;AAExB,QAAA,MAAM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CAAC;YACF,GAAG,CAAC,EAAE,mBAAmB,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,CAAC,CAAC;SACjE;AAED,QAAA,MAAM,eAAe,GAAG,GAAG,EAAE,CAAC,eAAe,CAAC;AAC9C,QAAA,MAAM,YAAY,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC;QACxC,MAAM,mBAAmB,GAAGC,2BAAsB,CAChD,eAAe,EACf,YAAY,CACb,CAAC;AACF,QAAAC,yBAAoB,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;KACnD;IACD,SAAS,EAAE,MAAK;AACd,QAAA,MAAM,MAAM,GAAG,GAAG,EAAE,CAAC,MAAM,CAAC;AAC5B,QAAA,IAAI,CAAC,MAAM;AAAE,YAAA,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;AAC1D,QAAA,OAAO,MAAM,CAAC;KACf;AACF,CAAA,CAAC,EAAE;AAES,MAAA,cAAc,GAAG,eAAe,CAAC,QAAQ,EAAE,CAAC;;;;;"}
@@ -1,64 +0,0 @@
1
- 'use strict';
2
-
3
- var handler = require('../const/handler.js');
4
-
5
- const getRowId = ({ path, method }) => JSON.stringify({
6
- path,
7
- method,
8
- });
9
- const convertHandlers = (handlers) => {
10
- const unsupportedHandlers = [];
11
- const flattenHandlers = handlers.reduce((acc, _handler) => {
12
- // Current, GraphQL & WebSocketHandler is not supported.
13
- const handler = _handler;
14
- if (!("info" in handler && handler.info.method && handler.info.path)) {
15
- unsupportedHandlers.push(handler);
16
- return acc;
17
- }
18
- const { method: _method, path: _path } = handler.info;
19
- const [method, path] = [_method.toString(), _path.toString()];
20
- acc.push({
21
- id: getRowId({ path, method }),
22
- path,
23
- method,
24
- enabled: true,
25
- handler,
26
- });
27
- return acc;
28
- }, []);
29
- return { flattenHandlers, unsupportedHandlers };
30
- };
31
- const getTotalEnableHandlers = (flattenHandlers, restHandlers) => {
32
- const checkedHttpHandlers = flattenHandlers
33
- .filter((h) => h.enabled)
34
- .map((h) => h.handler);
35
- return [...checkedHttpHandlers, ...restHandlers];
36
- };
37
- /**
38
- * This has to do with `msw` internal workings.
39
- * If I spread an empty array in `resetHandlers`, it will be replaced by `initialHandler`.
40
- * Therefore, I proposed the `clear` method, but unfortunately it was not accepted!
41
- */
42
- const updateEnableHandlers = (worker, totalEnableHandlers) => {
43
- if (totalEnableHandlers.length === 0) {
44
- worker.resetHandlers(handler.dummyHandler);
45
- return;
46
- }
47
- worker.resetHandlers(...totalEnableHandlers);
48
- };
49
- const initMSWDevToolStore = (worker) => {
50
- const handlers = worker.listHandlers();
51
- const { flattenHandlers, unsupportedHandlers } = convertHandlers(handlers);
52
- const handlerRowSelection = flattenHandlers.reduce((acc, handler) => {
53
- acc[handler.id] = handler.enabled;
54
- return acc;
55
- }, {});
56
- return { worker, flattenHandlers, unsupportedHandlers, handlerRowSelection };
57
- };
58
-
59
- exports.convertHandlers = convertHandlers;
60
- exports.getRowId = getRowId;
61
- exports.getTotalEnableHandlers = getTotalEnableHandlers;
62
- exports.initMSWDevToolStore = initMSWDevToolStore;
63
- exports.updateEnableHandlers = updateEnableHandlers;
64
- //# sourceMappingURL=util.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"util.js","sources":["../../../src/lib/util.ts"],"sourcesContent":["import { HttpHandler } from \"msw\";\nimport { FlattenHandler, Handler } from \"./type\";\nimport { dummyHandler } from \"../const/handler\";\nimport { SetupWorker } from \"msw/lib/browser\";\nimport { initial } from \"lodash\";\nimport { RowSelectionState } from \"@tanstack/react-table\";\n\nexport const getRowId = ({ path, method }: { path: string; method: string }) =>\n JSON.stringify({\n path,\n method,\n });\n\nexport const getObjFromRowId = (rowId: string) =>\n JSON.parse(rowId) as { path: string; method: string };\n\nexport const convertHandlers = (handlers: Handler[]) => {\n const unsupportedHandlers: Handler[] = [];\n const flattenHandlers: FlattenHandler[] = handlers.reduce((acc, _handler) => {\n // Current, GraphQL & WebSocketHandler is not supported.\n const handler = _handler as HttpHandler;\n if (!(\"info\" in handler && handler.info.method && handler.info.path)) {\n unsupportedHandlers.push(handler);\n return acc;\n }\n\n const { method: _method, path: _path } = handler.info;\n const [method, path] = [_method.toString(), _path.toString()];\n acc.push({\n id: getRowId({ path, method }),\n path,\n method,\n enabled: true,\n handler,\n });\n\n return acc;\n }, [] as FlattenHandler[]);\n return { flattenHandlers, unsupportedHandlers };\n};\n\nexport const getTotalEnableHandlers = (\n flattenHandlers: FlattenHandler[],\n restHandlers: Handler[]\n) => {\n const checkedHttpHandlers = flattenHandlers\n .filter((h) => h.enabled)\n .map((h) => h.handler);\n return [...checkedHttpHandlers, ...restHandlers];\n};\n\n/**\n * This has to do with `msw` internal workings.\n * If I spread an empty array in `resetHandlers`, it will be replaced by `initialHandler`.\n * Therefore, I proposed the `clear` method, but unfortunately it was not accepted!\n */\nexport const updateEnableHandlers = (\n worker: SetupWorker,\n totalEnableHandlers: Handler[]\n) => {\n if (totalEnableHandlers.length === 0) {\n worker.resetHandlers(dummyHandler);\n return;\n }\n\n worker.resetHandlers(...totalEnableHandlers);\n};\n\nexport const initMSWDevToolStore = (worker: SetupWorker) => {\n const handlers = worker.listHandlers() as Handler[];\n const { flattenHandlers, unsupportedHandlers } = convertHandlers(handlers);\n const handlerRowSelection = flattenHandlers.reduce((acc, handler) => {\n acc[handler.id] = handler.enabled;\n return acc;\n }, {} as RowSelectionState);\n\n return { worker, flattenHandlers, unsupportedHandlers, handlerRowSelection };\n};\n"],"names":["dummyHandler"],"mappings":";;;;AAOa,MAAA,QAAQ,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,EAAoC,KACzE,IAAI,CAAC,SAAS,CAAC;IACb,IAAI;IACJ,MAAM;AACP,CAAA,EAAE;AAKQ,MAAA,eAAe,GAAG,CAAC,QAAmB,KAAI;IACrD,MAAM,mBAAmB,GAAc,EAAE,CAAC;IAC1C,MAAM,eAAe,GAAqB,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,QAAQ,KAAI;;QAE1E,M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AC,aAAa,CAACA,oBAAY,CAAC,CAAC;QACnC,OAAO;KACR;AAED,IAAA,MAAM,CAAC,aAAa,CAAC,GAAG,mBAAmB,CAAC,CAAC;AAC/C,EAAE;AAEW,MAAA,mBAAmB,GAAG,CAAC,MAAmB,KAAI;AACzD,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,YAAY,EAAe,CAAC;IACpD,MAAM,EAAE,eAAe,EAAE,mBAAmB,EAAE,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;IAC3E,MAAM,mBAAmB,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,OAAO,KAAI;QAClE,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;AAClC,QAAA,OAAO,GAAG,CAAC;KACZ,EAAE,EAAuB,CAAC,CAAC;IAE5B,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,CAAC;AAC/E;;;;;;;;"}
@@ -1,137 +0,0 @@
1
- 'use strict';
2
-
3
- var React = require('react');
4
- var index = require('../../../../../../@tanstack_table-core@8.20.5/node_modules/@tanstack/table-core/build/lib/index.js');
5
-
6
- function _interopNamespaceDefault(e) {
7
- var n = Object.create(null);
8
- if (e) {
9
- Object.keys(e).forEach(function (k) {
10
- if (k !== 'default') {
11
- var d = Object.getOwnPropertyDescriptor(e, k);
12
- Object.defineProperty(n, k, d.get ? d : {
13
- enumerable: true,
14
- get: function () { return e[k]; }
15
- });
16
- }
17
- });
18
- }
19
- n.default = e;
20
- return Object.freeze(n);
21
- }
22
-
23
- var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
24
-
25
- /**
26
- * react-table
27
- *
28
- * Copyright (c) TanStack
29
- *
30
- * This source code is licensed under the MIT license found in the
31
- * LICENSE.md file in the root directory of this source tree.
32
- *
33
- * @license MIT
34
- */
35
-
36
- //
37
-
38
- /**
39
- * If rendering headers, cells, or footers with custom markup, use flexRender instead of `cell.getValue()` or `cell.renderValue()`.
40
- */
41
- function flexRender(Comp, props) {
42
- return !Comp ? null : isReactComponent(Comp) ? /*#__PURE__*/React__namespace.createElement(Comp, props) : Comp;
43
- }
44
- function isReactComponent(component) {
45
- return isClassComponent(component) || typeof component === 'function' || isExoticComponent(component);
46
- }
47
- function isClassComponent(component) {
48
- return typeof component === 'function' && (() => {
49
- const proto = Object.getPrototypeOf(component);
50
- return proto.prototype && proto.prototype.isReactComponent;
51
- })();
52
- }
53
- function isExoticComponent(component) {
54
- return typeof component === 'object' && typeof component.$$typeof === 'symbol' && ['react.memo', 'react.forward_ref'].includes(component.$$typeof.description);
55
- }
56
- function useReactTable(options) {
57
- // Compose in the generic options to the user options
58
- const resolvedOptions = {
59
- state: {},
60
- // Dummy state
61
- onStateChange: () => {},
62
- // noop
63
- renderFallbackValue: null,
64
- ...options
65
- };
66
-
67
- // Create a new table and store it in state
68
- const [tableRef] = React__namespace.useState(() => ({
69
- current: index.createTable(resolvedOptions)
70
- }));
71
-
72
- // By default, manage table state here using the table's initial state
73
- const [state, setState] = React__namespace.useState(() => tableRef.current.initialState);
74
-
75
- // Compose the default state above with any user state. This will allow the user
76
- // to only control a subset of the state if desired.
77
- tableRef.current.setOptions(prev => ({
78
- ...prev,
79
- ...options,
80
- state: {
81
- ...state,
82
- ...options.state
83
- },
84
- // Similarly, we'll maintain both our internal state and any user-provided
85
- // state.
86
- onStateChange: updater => {
87
- setState(updater);
88
- options.onStateChange == null || options.onStateChange(updater);
89
- }
90
- }));
91
- return tableRef.current;
92
- }
93
-
94
- exports.ColumnFaceting = index.ColumnFaceting;
95
- exports.ColumnFiltering = index.ColumnFiltering;
96
- exports.ColumnGrouping = index.ColumnGrouping;
97
- exports.ColumnOrdering = index.ColumnOrdering;
98
- exports.ColumnPinning = index.ColumnPinning;
99
- exports.ColumnSizing = index.ColumnSizing;
100
- exports.ColumnVisibility = index.ColumnVisibility;
101
- exports.GlobalFaceting = index.GlobalFaceting;
102
- exports.GlobalFiltering = index.GlobalFiltering;
103
- exports.Headers = index.Headers;
104
- exports.RowExpanding = index.RowExpanding;
105
- exports.RowPagination = index.RowPagination;
106
- exports.RowPinning = index.RowPinning;
107
- exports.RowSelection = index.RowSelection;
108
- exports.RowSorting = index.RowSorting;
109
- exports._getVisibleLeafColumns = index._getVisibleLeafColumns;
110
- exports.aggregationFns = index.aggregationFns;
111
- exports.buildHeaderGroups = index.buildHeaderGroups;
112
- exports.createCell = index.createCell;
113
- exports.createColumn = index.createColumn;
114
- exports.createColumnHelper = index.createColumnHelper;
115
- exports.createRow = index.createRow;
116
- exports.createTable = index.createTable;
117
- exports.defaultColumnSizing = index.defaultColumnSizing;
118
- exports.filterFns = index.filterFns;
119
- exports.flattenBy = index.flattenBy;
120
- exports.functionalUpdate = index.functionalUpdate;
121
- exports.getCoreRowModel = index.getCoreRowModel;
122
- exports.getMemoOptions = index.getMemoOptions;
123
- exports.isFunction = index.isFunction;
124
- exports.isNumberArray = index.isNumberArray;
125
- exports.isRowSelected = index.isRowSelected;
126
- exports.isSubRowSelected = index.isSubRowSelected;
127
- exports.makeStateUpdater = index.makeStateUpdater;
128
- exports.memo = index.memo;
129
- exports.orderColumns = index.orderColumns;
130
- exports.passiveEventSupported = index.passiveEventSupported;
131
- exports.reSplitAlphaNumeric = index.reSplitAlphaNumeric;
132
- exports.selectRowsFn = index.selectRowsFn;
133
- exports.shouldAutoRemoveFilter = index.shouldAutoRemoveFilter;
134
- exports.sortingFns = index.sortingFns;
135
- exports.flexRender = flexRender;
136
- exports.useReactTable = useReactTable;
137
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../../../../../../../../node_modules/.pnpm/@tanstack+react-table@8.20.6_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@tanstack/react-table/build/lib/index.mjs"],"sourcesContent":["/**\n * react-table\n *\n * Copyright (c) TanStack\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.md file in the root directory of this source tree.\n *\n * @license MIT\n */\nimport * as React from 'react';\nimport { createTable } from '@tanstack/table-core';\nexport * from '@tanstack/table-core';\n\n//\n\n/**\n * If rendering headers, cells, or footers with custom markup, use flexRender instead of `cell.getValue()` or `cell.renderValue()`.\n */\nfunction flexRender(Comp, props) {\n return !Comp ? null : isReactComponent(Comp) ? /*#__PURE__*/React.createElement(Comp, props) : Comp;\n}\nfunction isReactComponent(component) {\n return isClassComponent(component) || typeof component === 'function' || isExoticComponent(component);\n}\nfunction isClassComponent(component) {\n return typeof component === 'function' && (() => {\n const proto = Object.getPrototypeOf(component);\n return proto.prototype && proto.prototype.isReactComponent;\n })();\n}\nfunction isExoticComponent(component) {\n return typeof component === 'object' && typeof component.$$typeof === 'symbol' && ['react.memo', 'react.forward_ref'].includes(component.$$typeof.description);\n}\nfunction useReactTable(options) {\n // Compose in the generic options to the user options\n const resolvedOptions = {\n state: {},\n // Dummy state\n onStateChange: () => {},\n // noop\n renderFallbackValue: null,\n ...options\n };\n\n // Create a new table and store it in state\n const [tableRef] = React.useState(() => ({\n current: createTable(resolvedOptions)\n }));\n\n // By default, manage table state here using the table's initial state\n const [state, setState] = React.useState(() => tableRef.current.initialState);\n\n // Compose the default state above with any user state. This will allow the user\n // to only control a subset of the state if desired.\n tableRef.current.setOptions(prev => ({\n ...prev,\n ...options,\n state: {\n ...state,\n ...options.state\n },\n // Similarly, we'll maintain both our internal state and any user-provided\n // state.\n onStateChange: updater => {\n setState(updater);\n options.onStateChange == null || options.onStateChange(updater);\n }\n }));\n return tableRef.current;\n}\n\nexport { flexRender, useReactTable };\n//# sourceMappingURL=index.mjs.map\n"],"names":["React","createTable"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE;AACjC,EAAE,OAAO,CAAC,IAAI,GAAG,I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