next 15.2.0-canary.29 → 15.2.0-canary.30

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.

Potentially problematic release.


This version of next might be problematic. Click here for more details.

Files changed (42) hide show
  1. package/dist/bin/next +1 -1
  2. package/dist/build/index.js +2 -2
  3. package/dist/build/swc/index.js +1 -1
  4. package/dist/build/webpack-config.js +2 -2
  5. package/dist/client/app-bootstrap.js +1 -1
  6. package/dist/client/components/react-dev-overlay/_experimental/internal/components/dialog/dialog.js +6 -1
  7. package/dist/client/components/react-dev-overlay/_experimental/internal/components/dialog/dialog.js.map +1 -1
  8. package/dist/client/components/react-dev-overlay/_experimental/internal/hooks/use-on-click-outside.d.ts +1 -1
  9. package/dist/client/components/react-dev-overlay/_experimental/internal/hooks/use-on-click-outside.js +11 -6
  10. package/dist/client/components/react-dev-overlay/_experimental/internal/hooks/use-on-click-outside.js.map +1 -1
  11. package/dist/client/index.js +1 -1
  12. package/dist/compiled/next-server/app-page-experimental.runtime.dev.js +2 -2
  13. package/dist/compiled/next-server/app-page-experimental.runtime.dev.js.map +1 -1
  14. package/dist/compiled/next-server/app-page.runtime.dev.js +2 -2
  15. package/dist/compiled/next-server/app-page.runtime.dev.js.map +1 -1
  16. package/dist/compiled/next-server/pages-turbo.runtime.prod.js +2 -2
  17. package/dist/compiled/next-server/pages-turbo.runtime.prod.js.map +1 -1
  18. package/dist/compiled/next-server/pages.runtime.prod.js +2 -2
  19. package/dist/compiled/next-server/pages.runtime.prod.js.map +1 -1
  20. package/dist/esm/build/index.js +2 -2
  21. package/dist/esm/build/swc/index.js +1 -1
  22. package/dist/esm/build/webpack-config.js +2 -2
  23. package/dist/esm/client/app-bootstrap.js +1 -1
  24. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/dialog/dialog.js +6 -1
  25. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/dialog/dialog.js.map +1 -1
  26. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/hooks/use-on-click-outside.js +11 -6
  27. package/dist/esm/client/components/react-dev-overlay/_experimental/internal/hooks/use-on-click-outside.js.map +1 -1
  28. package/dist/esm/client/index.js +1 -1
  29. package/dist/esm/server/config.js +1 -1
  30. package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
  31. package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
  32. package/dist/esm/server/lib/app-info-log.js +1 -1
  33. package/dist/esm/server/lib/start-server.js +1 -1
  34. package/dist/server/config.js +1 -1
  35. package/dist/server/dev/hot-reloader-turbopack.js +1 -1
  36. package/dist/server/dev/hot-reloader-webpack.js +1 -1
  37. package/dist/server/lib/app-info-log.js +1 -1
  38. package/dist/server/lib/start-server.js +1 -1
  39. package/dist/telemetry/anonymous-meta.js +1 -1
  40. package/dist/telemetry/events/session-stopped.js +2 -2
  41. package/dist/telemetry/events/version.js +2 -2
  42. package/package.json +15 -15
package/dist/bin/next CHANGED
@@ -75,7 +75,7 @@ const program = new NextRootCommand();
75
75
  program.name('next').description('The Next.js CLI allows you to develop, build, start your application, and more.').configureHelp({
76
76
  formatHelp: (cmd, helper)=>(0, _formatclihelpoutput.formatCliHelpOutput)(cmd, helper),
77
77
  subcommandTerm: (cmd)=>`${cmd.name()} ${cmd.usage()}`
78
- }).helpCommand(false).helpOption('-h, --help', 'Displays this message.').version(`Next.js v${"15.2.0-canary.29"}`, '-v, --version', 'Outputs the Next.js version.');
78
+ }).helpCommand(false).helpOption('-h, --help', 'Displays this message.').version(`Next.js v${"15.2.0-canary.30"}`, '-v, --version', 'Outputs the Next.js version.');
79
79
  program.command('build').description('Creates an optimized production build of your application. The output displays information about each route.').argument('[directory]', `A directory on which to build the application. ${(0, _picocolors.italic)('If no directory is provided, the current directory will be used.')}`).option('-d, --debug', 'Enables a more verbose build output.').option('--no-lint', 'Disables linting.').option('--no-mangling', 'Disables mangling.').option('--profile', 'Enables production profiling for React.').option('--experimental-app-only', 'Builds only App Router routes.').addOption(new _commander.Option('--experimental-turbo').hideHelp()).addOption(new _commander.Option('--experimental-build-mode [mode]', 'Uses an experimental build mode.').choices([
80
80
  'compile',
81
81
  'generate'
@@ -362,7 +362,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
362
362
  const nextBuildSpan = (0, _trace.trace)('next-build', undefined, {
363
363
  buildMode: experimentalBuildMode,
364
364
  isTurboBuild: String(turboNextBuild),
365
- version: "15.2.0-canary.29"
365
+ version: "15.2.0-canary.30"
366
366
  });
367
367
  _buildcontext.NextBuildContext.nextBuildSpan = nextBuildSpan;
368
368
  _buildcontext.NextBuildContext.dir = dir;
@@ -722,7 +722,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
722
722
  // Files outside of the distDir can be "type": "module"
723
723
  await writeFileUtf8(_path.default.join(distDir, 'package.json'), '{"type": "commonjs"}');
724
724
  // These are written to distDir, so they need to come after creating and cleaning distDr.
725
- await (0, _builddiagnostics.recordFrameworkVersion)("15.2.0-canary.29");
725
+ await (0, _builddiagnostics.recordFrameworkVersion)("15.2.0-canary.30");
726
726
  await (0, _builddiagnostics.updateBuildDiagnostics)({
727
727
  buildStage: 'start'
728
728
  });
@@ -119,7 +119,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
119
119
  }
120
120
  return newObj;
121
121
  }
122
- const nextVersion = "15.2.0-canary.29";
122
+ const nextVersion = "15.2.0-canary.30";
123
123
  const ArchName = (0, _os.arch)();
124
124
  const PlatformName = (0, _os.platform)();
125
125
  function infoLog(...args) {
@@ -1510,7 +1510,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
1510
1510
  isClient && new _copyfileplugin.CopyFilePlugin({
1511
1511
  // file path to build output of `@next/polyfill-nomodule`
1512
1512
  filePath: require.resolve('./polyfills/polyfill-nomodule'),
1513
- cacheKey: "15.2.0-canary.29",
1513
+ cacheKey: "15.2.0-canary.30",
1514
1514
  name: `static/chunks/polyfills${dev ? '' : '-[hash]'}.js`,
1515
1515
  minimize: false,
1516
1516
  info: {
@@ -1743,7 +1743,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
1743
1743
  // - Next.js location on disk (some loaders use absolute paths and some resolve options depend on absolute paths)
1744
1744
  // - Next.js version
1745
1745
  // - next.config.js keys that affect compilation
1746
- version: `${__dirname}|${"15.2.0-canary.29"}|${configVars}`,
1746
+ version: `${__dirname}|${"15.2.0-canary.30"}|${configVars}`,
1747
1747
  cacheDirectory: _path.default.join(distDir, 'cache', 'webpack'),
1748
1748
  // For production builds, it's more efficient to compress all cache files together instead of compression each one individually.
1749
1749
  // So we disable compression here and allow the build runner to take care of compressing the cache as a whole.
@@ -13,7 +13,7 @@ Object.defineProperty(exports, "appBootstrap", {
13
13
  return appBootstrap;
14
14
  }
15
15
  });
16
- const version = "15.2.0-canary.29";
16
+ const version = "15.2.0-canary.30";
17
17
  window.next = {
18
18
  version,
19
19
  appDir: true
@@ -12,6 +12,11 @@ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildc
12
12
  const _jsxruntime = require("react/jsx-runtime");
13
13
  const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
14
14
  const _useonclickoutside = require("../../hooks/use-on-click-outside");
15
+ const CSS_SELECTORS_TO_EXCLUDE_ON_CLICK_OUTSIDE = [
16
+ '[data-next-mark]',
17
+ '[data-issues-open]',
18
+ '#nextjs-dev-tools-menu'
19
+ ];
15
20
  const Dialog = function Dialog(param) {
16
21
  let { children, type, className, onClose, ...props } = param;
17
22
  const [dialog, setDialog] = _react.useState(null);
@@ -19,7 +24,7 @@ const Dialog = function Dialog(param) {
19
24
  const onDialog = _react.useCallback((node)=>{
20
25
  setDialog(node);
21
26
  }, []);
22
- (0, _useonclickoutside.useOnClickOutside)(dialog, (e)=>{
27
+ (0, _useonclickoutside.useOnClickOutside)(dialog, CSS_SELECTORS_TO_EXCLUDE_ON_CLICK_OUTSIDE, (e)=>{
23
28
  e.preventDefault();
24
29
  return onClose == null ? void 0 : onClose();
25
30
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../../src/client/components/react-dev-overlay/_experimental/internal/components/dialog/dialog.tsx"],"sourcesContent":["import * as React from 'react'\nimport { useOnClickOutside } from '../../hooks/use-on-click-outside'\n\nexport type DialogProps = {\n children?: React.ReactNode\n type: 'error' | 'warning'\n 'aria-labelledby': string\n 'aria-describedby': string\n className?: string\n onClose?: () => void\n}\n\nconst Dialog: React.FC<DialogProps> = function Dialog({\n children,\n type,\n className,\n onClose,\n ...props\n}) {\n const [dialog, setDialog] = React.useState<HTMLDivElement | null>(null)\n const [role, setRole] = React.useState<string | undefined>(\n typeof document !== 'undefined' && document.hasFocus()\n ? 'dialog'\n : undefined\n )\n const onDialog = React.useCallback((node: HTMLDivElement | null) => {\n setDialog(node)\n }, [])\n useOnClickOutside(dialog, (e) => {\n e.preventDefault()\n return onClose?.()\n })\n\n // Make HTMLElements with `role=link` accessible to be triggered by the\n // keyboard, i.e. [Enter].\n React.useEffect(() => {\n if (dialog == null) {\n return\n }\n\n const root = dialog.getRootNode()\n // Always true, but we do this for TypeScript:\n if (!(root instanceof ShadowRoot)) {\n return\n }\n const shadowRoot = root\n function handler(e: KeyboardEvent) {\n const el = shadowRoot.activeElement\n if (\n e.key === 'Enter' &&\n el instanceof HTMLElement &&\n el.getAttribute('role') === 'link'\n ) {\n e.preventDefault()\n e.stopPropagation()\n\n el.click()\n }\n }\n\n function handleFocus() {\n // safari will force itself as the active application when a background page triggers any sort of autofocus\n // this is a workaround to only set the dialog role if the document has focus\n setRole(document.hasFocus() ? 'dialog' : undefined)\n }\n\n shadowRoot.addEventListener('keydown', handler as EventListener)\n window.addEventListener('focus', handleFocus)\n window.addEventListener('blur', handleFocus)\n return () => {\n shadowRoot.removeEventListener('keydown', handler as EventListener)\n window.removeEventListener('focus', handleFocus)\n window.removeEventListener('blur', handleFocus)\n }\n }, [dialog])\n\n return (\n <div\n ref={onDialog}\n data-nextjs-dialog\n tabIndex={-1}\n role={role}\n aria-labelledby={props['aria-labelledby']}\n aria-describedby={props['aria-describedby']}\n aria-modal=\"true\"\n className={className}\n >\n {children}\n </div>\n )\n}\n\nexport { Dialog }\n"],"names":["Dialog","children","type","className","onClose","props","dialog","setDialog","React","useState","role","setRole","document","hasFocus","undefined","onDialog","useCallback","node","useOnClickOutside","e","preventDefault","useEffect","root","getRootNode","ShadowRoot","shadowRoot","handler","el","activeElement","key","HTMLElement","getAttribute","stopPropagation","click","handleFocus","addEventListener","window","removeEventListener","div","ref","data-nextjs-dialog","tabIndex","aria-labelledby","aria-describedby","aria-modal"],"mappings":";;;;+BA4FSA;;;eAAAA;;;;;iEA5Fc;mCACW;AAWlC,MAAMA,SAAgC,SAASA,OAAO,KAMrD;IANqD,IAAA,EACpDC,QAAQ,EACRC,IAAI,EACJC,SAAS,EACTC,OAAO,EACP,GAAGC,OACJ,GANqD;IAOpD,MAAM,CAACC,QAAQC,UAAU,GAAGC,OAAMC,QAAQ,CAAwB;IAClE,MAAM,CAACC,MAAMC,QAAQ,GAAGH,OAAMC,QAAQ,CACpC,OAAOG,aAAa,eAAeA,SAASC,QAAQ,KAChD,WACAC;IAEN,MAAMC,WAAWP,OAAMQ,WAAW,CAAC,CAACC;QAClCV,UAAUU;IACZ,GAAG,EAAE;IACLC,IAAAA,oCAAiB,EAACZ,QAAQ,CAACa;QACzBA,EAAEC,cAAc;QAChB,OAAOhB,2BAAAA;IACT;IAEA,uEAAuE;IACvE,0BAA0B;IAC1BI,OAAMa,SAAS,CAAC;QACd,IAAIf,UAAU,MAAM;YAClB;QACF;QAEA,MAAMgB,OAAOhB,OAAOiB,WAAW;QAC/B,8CAA8C;QAC9C,IAAI,CAAED,CAAAA,gBAAgBE,UAAS,GAAI;YACjC;QACF;QACA,MAAMC,aAAaH;QACnB,SAASI,QAAQP,CAAgB;YAC/B,MAAMQ,KAAKF,WAAWG,aAAa;YACnC,IACET,EAAEU,GAAG,KAAK,WACVF,cAAcG,eACdH,GAAGI,YAAY,CAAC,YAAY,QAC5B;gBACAZ,EAAEC,cAAc;gBAChBD,EAAEa,eAAe;gBAEjBL,GAAGM,KAAK;YACV;QACF;QAEA,SAASC;YACP,2GAA2G;YAC3G,6EAA6E;YAC7EvB,QAAQC,SAASC,QAAQ,KAAK,WAAWC;QAC3C;QAEAW,WAAWU,gBAAgB,CAAC,WAAWT;QACvCU,OAAOD,gBAAgB,CAAC,SAASD;QACjCE,OAAOD,gBAAgB,CAAC,QAAQD;QAChC,OAAO;YACLT,WAAWY,mBAAmB,CAAC,WAAWX;YAC1CU,OAAOC,mBAAmB,CAAC,SAASH;YACpCE,OAAOC,mBAAmB,CAAC,QAAQH;QACrC;IACF,GAAG;QAAC5B;KAAO;IAEX,qBACE,qBAACgC;QACCC,KAAKxB;QACLyB,oBAAkB;QAClBC,UAAU,CAAC;QACX/B,MAAMA;QACNgC,mBAAiBrC,KAAK,CAAC,kBAAkB;QACzCsC,oBAAkBtC,KAAK,CAAC,mBAAmB;QAC3CuC,cAAW;QACXzC,WAAWA;kBAEVF;;AAGP"}
1
+ {"version":3,"sources":["../../../../../../../../src/client/components/react-dev-overlay/_experimental/internal/components/dialog/dialog.tsx"],"sourcesContent":["import * as React from 'react'\nimport { useOnClickOutside } from '../../hooks/use-on-click-outside'\n\nexport type DialogProps = {\n children?: React.ReactNode\n type: 'error' | 'warning'\n 'aria-labelledby': string\n 'aria-describedby': string\n className?: string\n onClose?: () => void\n}\n\nconst CSS_SELECTORS_TO_EXCLUDE_ON_CLICK_OUTSIDE = [\n '[data-next-mark]',\n '[data-issues-open]',\n '#nextjs-dev-tools-menu',\n]\n\nconst Dialog: React.FC<DialogProps> = function Dialog({\n children,\n type,\n className,\n onClose,\n ...props\n}) {\n const [dialog, setDialog] = React.useState<HTMLDivElement | null>(null)\n const [role, setRole] = React.useState<string | undefined>(\n typeof document !== 'undefined' && document.hasFocus()\n ? 'dialog'\n : undefined\n )\n const onDialog = React.useCallback((node: HTMLDivElement | null) => {\n setDialog(node)\n }, [])\n useOnClickOutside(dialog, CSS_SELECTORS_TO_EXCLUDE_ON_CLICK_OUTSIDE, (e) => {\n e.preventDefault()\n return onClose?.()\n })\n\n // Make HTMLElements with `role=link` accessible to be triggered by the\n // keyboard, i.e. [Enter].\n React.useEffect(() => {\n if (dialog == null) {\n return\n }\n\n const root = dialog.getRootNode()\n // Always true, but we do this for TypeScript:\n if (!(root instanceof ShadowRoot)) {\n return\n }\n const shadowRoot = root\n function handler(e: KeyboardEvent) {\n const el = shadowRoot.activeElement\n if (\n e.key === 'Enter' &&\n el instanceof HTMLElement &&\n el.getAttribute('role') === 'link'\n ) {\n e.preventDefault()\n e.stopPropagation()\n\n el.click()\n }\n }\n\n function handleFocus() {\n // safari will force itself as the active application when a background page triggers any sort of autofocus\n // this is a workaround to only set the dialog role if the document has focus\n setRole(document.hasFocus() ? 'dialog' : undefined)\n }\n\n shadowRoot.addEventListener('keydown', handler as EventListener)\n window.addEventListener('focus', handleFocus)\n window.addEventListener('blur', handleFocus)\n return () => {\n shadowRoot.removeEventListener('keydown', handler as EventListener)\n window.removeEventListener('focus', handleFocus)\n window.removeEventListener('blur', handleFocus)\n }\n }, [dialog])\n\n return (\n <div\n ref={onDialog}\n data-nextjs-dialog\n tabIndex={-1}\n role={role}\n aria-labelledby={props['aria-labelledby']}\n aria-describedby={props['aria-describedby']}\n aria-modal=\"true\"\n className={className}\n >\n {children}\n </div>\n )\n}\n\nexport { Dialog }\n"],"names":["Dialog","CSS_SELECTORS_TO_EXCLUDE_ON_CLICK_OUTSIDE","children","type","className","onClose","props","dialog","setDialog","React","useState","role","setRole","document","hasFocus","undefined","onDialog","useCallback","node","useOnClickOutside","e","preventDefault","useEffect","root","getRootNode","ShadowRoot","shadowRoot","handler","el","activeElement","key","HTMLElement","getAttribute","stopPropagation","click","handleFocus","addEventListener","window","removeEventListener","div","ref","data-nextjs-dialog","tabIndex","aria-labelledby","aria-describedby","aria-modal"],"mappings":";;;;+BAkGSA;;;eAAAA;;;;;iEAlGc;mCACW;AAWlC,MAAMC,4CAA4C;IAChD;IACA;IACA;CACD;AAED,MAAMD,SAAgC,SAASA,OAAO,KAMrD;IANqD,IAAA,EACpDE,QAAQ,EACRC,IAAI,EACJC,SAAS,EACTC,OAAO,EACP,GAAGC,OACJ,GANqD;IAOpD,MAAM,CAACC,QAAQC,UAAU,GAAGC,OAAMC,QAAQ,CAAwB;IAClE,MAAM,CAACC,MAAMC,QAAQ,GAAGH,OAAMC,QAAQ,CACpC,OAAOG,aAAa,eAAeA,SAASC,QAAQ,KAChD,WACAC;IAEN,MAAMC,WAAWP,OAAMQ,WAAW,CAAC,CAACC;QAClCV,UAAUU;IACZ,GAAG,EAAE;IACLC,IAAAA,oCAAiB,EAACZ,QAAQN,2CAA2C,CAACmB;QACpEA,EAAEC,cAAc;QAChB,OAAOhB,2BAAAA;IACT;IAEA,uEAAuE;IACvE,0BAA0B;IAC1BI,OAAMa,SAAS,CAAC;QACd,IAAIf,UAAU,MAAM;YAClB;QACF;QAEA,MAAMgB,OAAOhB,OAAOiB,WAAW;QAC/B,8CAA8C;QAC9C,IAAI,CAAED,CAAAA,gBAAgBE,UAAS,GAAI;YACjC;QACF;QACA,MAAMC,aAAaH;QACnB,SAASI,QAAQP,CAAgB;YAC/B,MAAMQ,KAAKF,WAAWG,aAAa;YACnC,IACET,EAAEU,GAAG,KAAK,WACVF,cAAcG,eACdH,GAAGI,YAAY,CAAC,YAAY,QAC5B;gBACAZ,EAAEC,cAAc;gBAChBD,EAAEa,eAAe;gBAEjBL,GAAGM,KAAK;YACV;QACF;QAEA,SAASC;YACP,2GAA2G;YAC3G,6EAA6E;YAC7EvB,QAAQC,SAASC,QAAQ,KAAK,WAAWC;QAC3C;QAEAW,WAAWU,gBAAgB,CAAC,WAAWT;QACvCU,OAAOD,gBAAgB,CAAC,SAASD;QACjCE,OAAOD,gBAAgB,CAAC,QAAQD;QAChC,OAAO;YACLT,WAAWY,mBAAmB,CAAC,WAAWX;YAC1CU,OAAOC,mBAAmB,CAAC,SAASH;YACpCE,OAAOC,mBAAmB,CAAC,QAAQH;QACrC;IACF,GAAG;QAAC5B;KAAO;IAEX,qBACE,qBAACgC;QACCC,KAAKxB;QACLyB,oBAAkB;QAClBC,UAAU,CAAC;QACX/B,MAAMA;QACNgC,mBAAiBrC,KAAK,CAAC,kBAAkB;QACzCsC,oBAAkBtC,KAAK,CAAC,mBAAmB;QAC3CuC,cAAW;QACXzC,WAAWA;kBAEVF;;AAGP"}
@@ -1 +1 @@
1
- export declare function useOnClickOutside(el: Node | null, handler: ((e: MouseEvent | TouchEvent) => void) | undefined): void;
1
+ export declare function useOnClickOutside(el: Node | null, cssSelectorsToExclude: string[], handler: ((e: MouseEvent | TouchEvent) => void) | undefined): void;
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "useOnClickOutside", {
10
10
  });
11
11
  const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
12
  const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
- function useOnClickOutside(el, handler) {
13
+ function useOnClickOutside(el, cssSelectorsToExclude, handler) {
14
14
  _react.useEffect(()=>{
15
15
  if (el == null || handler == null) {
16
16
  return;
@@ -20,20 +20,25 @@ function useOnClickOutside(el, handler) {
20
20
  if (!el || el.contains(e.target)) {
21
21
  return;
22
22
  }
23
+ if (// Do nothing if clicking on an element that is excluded by the CSS selector(s)
24
+ cssSelectorsToExclude.some((cssSelector)=>e.target.closest(cssSelector))) {
25
+ return;
26
+ }
23
27
  handler(e);
24
28
  };
25
29
  const root = el.getRootNode();
26
- root.addEventListener('mousedown', listener);
27
- root.addEventListener('touchstart', listener, {
30
+ root.addEventListener('mouseup', listener);
31
+ root.addEventListener('touchend', listener, {
28
32
  passive: false
29
33
  });
30
34
  return function() {
31
- root.removeEventListener('mousedown', listener);
32
- root.removeEventListener('touchstart', listener);
35
+ root.removeEventListener('mouseup', listener);
36
+ root.removeEventListener('touchend', listener);
33
37
  };
34
38
  }, [
35
39
  handler,
36
- el
40
+ el,
41
+ cssSelectorsToExclude
37
42
  ]);
38
43
  }
39
44
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../src/client/components/react-dev-overlay/_experimental/internal/hooks/use-on-click-outside.ts"],"sourcesContent":["import * as React from 'react'\n\nexport function useOnClickOutside(\n el: Node | null,\n handler: ((e: MouseEvent | TouchEvent) => void) | undefined\n) {\n React.useEffect(() => {\n if (el == null || handler == null) {\n return\n }\n\n const listener = (e: MouseEvent | TouchEvent) => {\n // Do nothing if clicking ref's element or descendent elements\n if (!el || el.contains(e.target as Element)) {\n return\n }\n\n handler(e)\n }\n\n const root = el.getRootNode()\n root.addEventListener('mousedown', listener as EventListener)\n root.addEventListener('touchstart', listener as EventListener, {\n passive: false,\n })\n return function () {\n root.removeEventListener('mousedown', listener as EventListener)\n root.removeEventListener('touchstart', listener as EventListener)\n }\n }, [handler, el])\n}\n"],"names":["useOnClickOutside","el","handler","React","useEffect","listener","e","contains","target","root","getRootNode","addEventListener","passive","removeEventListener"],"mappings":";;;;+BAEgBA;;;eAAAA;;;;iEAFO;AAEhB,SAASA,kBACdC,EAAe,EACfC,OAA2D;IAE3DC,OAAMC,SAAS,CAAC;QACd,IAAIH,MAAM,QAAQC,WAAW,MAAM;YACjC;QACF;QAEA,MAAMG,WAAW,CAACC;YAChB,8DAA8D;YAC9D,IAAI,CAACL,MAAMA,GAAGM,QAAQ,CAACD,EAAEE,MAAM,GAAc;gBAC3C;YACF;YAEAN,QAAQI;QACV;QAEA,MAAMG,OAAOR,GAAGS,WAAW;QAC3BD,KAAKE,gBAAgB,CAAC,aAAaN;QACnCI,KAAKE,gBAAgB,CAAC,cAAcN,UAA2B;YAC7DO,SAAS;QACX;QACA,OAAO;YACLH,KAAKI,mBAAmB,CAAC,aAAaR;YACtCI,KAAKI,mBAAmB,CAAC,cAAcR;QACzC;IACF,GAAG;QAACH;QAASD;KAAG;AAClB"}
1
+ {"version":3,"sources":["../../../../../../../src/client/components/react-dev-overlay/_experimental/internal/hooks/use-on-click-outside.ts"],"sourcesContent":["import * as React from 'react'\n\nexport function useOnClickOutside(\n el: Node | null,\n cssSelectorsToExclude: string[],\n handler: ((e: MouseEvent | TouchEvent) => void) | undefined\n) {\n React.useEffect(() => {\n if (el == null || handler == null) {\n return\n }\n\n const listener = (e: MouseEvent | TouchEvent) => {\n // Do nothing if clicking ref's element or descendent elements\n if (!el || el.contains(e.target as Element)) {\n return\n }\n\n if (\n // Do nothing if clicking on an element that is excluded by the CSS selector(s)\n cssSelectorsToExclude.some((cssSelector) =>\n (e.target as Element).closest(cssSelector)\n )\n ) {\n return\n }\n\n handler(e)\n }\n\n const root = el.getRootNode()\n root.addEventListener('mouseup', listener as EventListener)\n root.addEventListener('touchend', listener as EventListener, {\n passive: false,\n })\n return function () {\n root.removeEventListener('mouseup', listener as EventListener)\n root.removeEventListener('touchend', listener as EventListener)\n }\n }, [handler, el, cssSelectorsToExclude])\n}\n"],"names":["useOnClickOutside","el","cssSelectorsToExclude","handler","React","useEffect","listener","e","contains","target","some","cssSelector","closest","root","getRootNode","addEventListener","passive","removeEventListener"],"mappings":";;;;+BAEgBA;;;eAAAA;;;;iEAFO;AAEhB,SAASA,kBACdC,EAAe,EACfC,qBAA+B,EAC/BC,OAA2D;IAE3DC,OAAMC,SAAS,CAAC;QACd,IAAIJ,MAAM,QAAQE,WAAW,MAAM;YACjC;QACF;QAEA,MAAMG,WAAW,CAACC;YAChB,8DAA8D;YAC9D,IAAI,CAACN,MAAMA,GAAGO,QAAQ,CAACD,EAAEE,MAAM,GAAc;gBAC3C;YACF;YAEA,IACE,+EAA+E;YAC/EP,sBAAsBQ,IAAI,CAAC,CAACC,cAC1B,AAACJ,EAAEE,MAAM,CAAaG,OAAO,CAACD,eAEhC;gBACA;YACF;YAEAR,QAAQI;QACV;QAEA,MAAMM,OAAOZ,GAAGa,WAAW;QAC3BD,KAAKE,gBAAgB,CAAC,WAAWT;QACjCO,KAAKE,gBAAgB,CAAC,YAAYT,UAA2B;YAC3DU,SAAS;QACX;QACA,OAAO;YACLH,KAAKI,mBAAmB,CAAC,WAAWX;YACpCO,KAAKI,mBAAmB,CAAC,YAAYX;QACvC;IACF,GAAG;QAACH;QAASF;QAAIC;KAAsB;AACzC"}
@@ -62,7 +62,7 @@ const _onrecoverableerror = require("./react-client-callbacks/on-recoverable-err
62
62
  const _tracer = /*#__PURE__*/ _interop_require_default._(require("./tracing/tracer"));
63
63
  const _reporttosocket = /*#__PURE__*/ _interop_require_default._(require("./tracing/report-to-socket"));
64
64
  const _isnextroutererror = require("./components/is-next-router-error");
65
- const version = "15.2.0-canary.29";
65
+ const version = "15.2.0-canary.30";
66
66
  let router;
67
67
  const emitter = (0, _mitt.default)();
68
68
  const looseToArray = (input)=>[].slice.call(input);