@contember/react-devbar 2.0.0-alpha.9 → 2.0.0-beta.1

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 (64) hide show
  1. package/dist/development/src/DevErrorManager.cjs.map +1 -1
  2. package/dist/development/src/DevErrorManager.js.map +1 -1
  3. package/dist/development/src/errorHandling.cjs.map +1 -1
  4. package/dist/development/src/errorHandling.js.map +1 -1
  5. package/dist/development/src/hooks/useParsedStacktrace.cjs +6 -1
  6. package/dist/development/src/hooks/useParsedStacktrace.cjs.map +1 -1
  7. package/dist/development/src/hooks/useParsedStacktrace.js +6 -1
  8. package/dist/development/src/hooks/useParsedStacktrace.js.map +1 -1
  9. package/dist/development/src/ui/DevBar/DevBar.cjs +128 -174
  10. package/dist/development/src/ui/DevBar/DevBar.cjs.map +1 -1
  11. package/dist/development/src/ui/DevBar/DevBar.js +130 -176
  12. package/dist/development/src/ui/DevBar/DevBar.js.map +1 -1
  13. package/dist/development/src/ui/DevError/DevError.cjs +5 -5
  14. package/dist/development/src/ui/DevError/DevError.cjs.map +1 -1
  15. package/dist/development/src/ui/DevError/DevError.js +5 -5
  16. package/dist/development/src/ui/DevError/DevError.js.map +1 -1
  17. package/dist/development/src/ui/DevError/DevErrorInner.cjs +1 -1
  18. package/dist/development/src/ui/DevError/DevErrorInner.cjs.map +1 -1
  19. package/dist/development/src/ui/DevError/DevErrorInner.js +1 -1
  20. package/dist/development/src/ui/DevError/DevErrorInner.js.map +1 -1
  21. package/dist/development/src/ui/DevError/DevErrorList.cjs +28 -17
  22. package/dist/development/src/ui/DevError/DevErrorList.cjs.map +1 -1
  23. package/dist/development/src/ui/DevError/DevErrorList.js +28 -17
  24. package/dist/development/src/ui/DevError/DevErrorList.js.map +1 -1
  25. package/dist/development/src/ui/DevError/StackTrace.cjs.map +1 -1
  26. package/dist/development/src/ui/DevError/StackTrace.js.map +1 -1
  27. package/dist/production/src/errorHandling.cjs.map +1 -1
  28. package/dist/production/src/errorHandling.js.map +1 -1
  29. package/dist/production/src/hooks/useParsedStacktrace.cjs +6 -1
  30. package/dist/production/src/hooks/useParsedStacktrace.cjs.map +1 -1
  31. package/dist/production/src/hooks/useParsedStacktrace.js +6 -1
  32. package/dist/production/src/hooks/useParsedStacktrace.js.map +1 -1
  33. package/dist/production/src/ui/DevBar/DevBar.cjs +74 -112
  34. package/dist/production/src/ui/DevBar/DevBar.cjs.map +1 -1
  35. package/dist/production/src/ui/DevBar/DevBar.js +77 -115
  36. package/dist/production/src/ui/DevBar/DevBar.js.map +1 -1
  37. package/dist/production/src/ui/DevError/DevError.cjs.map +1 -1
  38. package/dist/production/src/ui/DevError/DevError.js.map +1 -1
  39. package/dist/production/src/ui/DevError/DevErrorBadge.cjs.map +1 -1
  40. package/dist/production/src/ui/DevError/DevErrorBadge.js.map +1 -1
  41. package/dist/production/src/ui/DevError/DevErrorInner.cjs +1 -1
  42. package/dist/production/src/ui/DevError/DevErrorInner.cjs.map +1 -1
  43. package/dist/production/src/ui/DevError/DevErrorInner.js +1 -1
  44. package/dist/production/src/ui/DevError/DevErrorInner.js.map +1 -1
  45. package/dist/production/src/ui/DevError/DevErrorList.cjs +11 -4
  46. package/dist/production/src/ui/DevError/DevErrorList.cjs.map +1 -1
  47. package/dist/production/src/ui/DevError/DevErrorList.js +11 -4
  48. package/dist/production/src/ui/DevError/DevErrorList.js.map +1 -1
  49. package/dist/production/src/ui/DevError/StackTrace.cjs.map +1 -1
  50. package/dist/production/src/ui/DevError/StackTrace.js.map +1 -1
  51. package/dist/types/hooks/useParsedStacktrace.d.ts +1 -1
  52. package/dist/types/hooks/useParsedStacktrace.d.ts.map +1 -1
  53. package/dist/types/tsconfig.tsbuildinfo +1 -1
  54. package/dist/types/ui/DevBar/DevBar.d.ts +5 -4
  55. package/dist/types/ui/DevBar/DevBar.d.ts.map +1 -1
  56. package/dist/types/ui/DevError/DevError.d.ts.map +1 -1
  57. package/dist/types/ui/DevError/DevErrorList.d.ts.map +1 -1
  58. package/package.json +7 -6
  59. package/src/hooks/useParsedStacktrace.ts +6 -1
  60. package/src/index.css +290 -227
  61. package/src/ui/DevBar/DevBar.tsx +72 -97
  62. package/src/ui/DevError/DevError.tsx +0 -1
  63. package/src/ui/DevError/DevErrorInner.tsx +1 -1
  64. package/src/ui/DevError/DevErrorList.tsx +14 -5
@@ -1 +1 @@
1
- {"version":3,"file":"DevErrorManager.cjs","sources":["../../../../packages/react-devbar/src/DevErrorManager.tsx"],"sourcesContent":["import { DevErrorBadge, DevErrorList, ErrorType } from './ui/DevError'\nimport { useEffect, useState } from 'react'\nimport { useProcessedError } from './hooks/useParsedStacktrace'\n\nexport class ErrorBus {\n\tprivate queue: { error: ErrorType; source: string }[] = []\n\tprivate listener: null | ((error: { error: ErrorType; source: string }) => void) = null\n\n\tasync handleError(source: string, error: ErrorType) {\n\t\tconst boxedError = { error, source }\n\n\t\tif (!this.listener) {\n\t\t\tthis.queue.push(boxedError)\n\t\t\tthis.queue.push(boxedError)\n\t\t\tthis.queue.push(boxedError)\n\t\t\tthis.queue.push(boxedError)\n\n\t\t} else {\n\t\t\tthis.listener(boxedError)\n\t\t\tthis.listener(boxedError)\n\t\t\tthis.listener(boxedError)\n\t\t\tthis.listener(boxedError)\n\t\t}\n\t}\n\n\tregister(listener: (error: { error: ErrorType; source: string }) => void): () => void {\n\t\tthis.listener = listener\n\t\tthis.queue.forEach(listener)\n\t\tthis.queue = []\n\t\treturn () => {\n\t\t\tthis.listener = null\n\t\t}\n\t}\n}\n\nexport interface DevErrorManagerProps {\n\tbus: ErrorBus\n}\n\nexport function DevErrorManager(props: DevErrorManagerProps) {\n\tconst [errors, setErrors] = useState<{ error: ErrorType; source: string }[]>([])\n\tconst [errIndex, setErrorIndex] = useState(0)\n\tconst [open, setOpen] = useState(false)\n\n\tuseEffect(\n\t\t() => {\n\t\t\treturn props.bus.register(err => {\n\t\t\t\tsetTimeout(\n\t\t\t\t\t() => {\n\t\t\t\t\t\tsetErrors(errors => [err, ...errors])\n\t\t\t\t\t\tsetOpen(true)\n\t\t\t\t\t},\n\t\t\t\t\t0,\n\t\t\t\t)\n\t\t\t})\n\t\t},\n\t\t[props.bus],\n\t)\n\n\tconst currentError = errors[errIndex]\n\tconst processedError = useProcessedError(currentError?.error)\n\tif (!currentError) {\n\t\treturn null\n\t}\n\tconst onPrevious = () => setErrorIndex(it => Math.max(0, it - 1))\n\tconst onNext = () => setErrorIndex(it => Math.min(errors.length - 1, it + 1))\n\tconst onClose = () => setOpen(false)\n\tif (!open) {\n\t\treturn <DevErrorBadge errorCount={errors.length} onOpen={() => setOpen(true)} />\n\t}\n\treturn (\n\t\t<DevErrorList\n\t\t\tcurrentError={processedError}\n\t\t\tcurrentErrorSource={currentError.source}\n\t\t\tcurrentErrorIndex={errIndex}\n\t\t\terrorCount={errors.length}\n\t\t\tonPrevious={onPrevious}\n\t\t\tonNext={onNext}\n\t\t\tonClose={onClose}\n\t\t/>\n\t)\n}\n"],"names":["useState","useEffect","errors","useProcessedError","jsxDEV","DevErrorBadge","DevErrorList"],"mappings":";;;;;;;;;;AAIO,MAAM,SAAS;AAAA,EAAf,cAAA;AACN,kBAAA,MAAQ,SAAgD,CAAA,CAAC;AACzD,kBAAA,MAAQ,YAA2E,IAAA;AAAA,EAAA;AAAA,EAEnF,MAAM,YAAY,QAAgB,OAAkB;AAC7C,UAAA,aAAa,EAAE,OAAO;AAExB,QAAA,CAAC,KAAK,UAAU;AACd,WAAA,MAAM,KAAK,UAAU;AACrB,WAAA,MAAM,KAAK,UAAU;AACrB,WAAA,MAAM,KAAK,UAAU;AACrB,WAAA,MAAM,KAAK,UAAU;AAAA,IAAA,OAEpB;AACN,WAAK,SAAS,UAAU;AACxB,WAAK,SAAS,UAAU;AACxB,WAAK,SAAS,UAAU;AACxB,WAAK,SAAS,UAAU;AAAA,IACzB;AAAA,EACD;AAAA,EAEA,SAAS,UAA6E;AACrF,SAAK,WAAW;AACX,SAAA,MAAM,QAAQ,QAAQ;AAC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,OAAO;AAAA,MACnB;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,IAPD;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAA;AAAA,EAAA;AAUF;;;"}
1
+ {"version":3,"file":"DevErrorManager.cjs","sources":["../../../../packages/react-devbar/src/DevErrorManager.tsx"],"sourcesContent":["import { DevErrorBadge, DevErrorList, ErrorType } from './ui/DevError'\nimport { useEffect, useState } from 'react'\nimport { useProcessedError } from './hooks/useParsedStacktrace'\n\nexport class ErrorBus {\n\tprivate queue: { error: ErrorType; source: string }[] = []\n\tprivate listener: null | ((error: { error: ErrorType; source: string }) => void) = null\n\n\tasync handleError(source: string, error: ErrorType) {\n\t\tconst boxedError = { error, source }\n\n\t\tif (!this.listener) {\n\t\t\tthis.queue.push(boxedError)\n\t\t\tthis.queue.push(boxedError)\n\t\t\tthis.queue.push(boxedError)\n\t\t\tthis.queue.push(boxedError)\n\n\t\t} else {\n\t\t\tthis.listener(boxedError)\n\t\t\tthis.listener(boxedError)\n\t\t\tthis.listener(boxedError)\n\t\t\tthis.listener(boxedError)\n\t\t}\n\t}\n\n\tregister(listener: (error: { error: ErrorType; source: string }) => void): () => void {\n\t\tthis.listener = listener\n\t\tthis.queue.forEach(listener)\n\t\tthis.queue = []\n\t\treturn () => {\n\t\t\tthis.listener = null\n\t\t}\n\t}\n}\n\nexport interface DevErrorManagerProps {\n\tbus: ErrorBus\n}\n\nexport function DevErrorManager(props: DevErrorManagerProps) {\n\tconst [errors, setErrors] = useState<{ error: ErrorType; source: string }[]>([])\n\tconst [errIndex, setErrorIndex] = useState(0)\n\tconst [open, setOpen] = useState(false)\n\n\tuseEffect(\n\t\t() => {\n\t\t\treturn props.bus.register(err => {\n\t\t\t\tsetTimeout(\n\t\t\t\t\t() => {\n\t\t\t\t\t\tsetErrors(errors => [err, ...errors])\n\t\t\t\t\t\tsetOpen(true)\n\t\t\t\t\t},\n\t\t\t\t\t0,\n\t\t\t\t)\n\t\t\t})\n\t\t},\n\t\t[props.bus],\n\t)\n\n\tconst currentError = errors[errIndex]\n\tconst processedError = useProcessedError(currentError?.error)\n\tif (!currentError) {\n\t\treturn null\n\t}\n\tconst onPrevious = () => setErrorIndex(it => Math.max(0, it - 1))\n\tconst onNext = () => setErrorIndex(it => Math.min(errors.length - 1, it + 1))\n\tconst onClose = () => setOpen(false)\n\tif (!open) {\n\t\treturn <DevErrorBadge errorCount={errors.length} onOpen={() => setOpen(true)} />\n\t}\n\treturn (\n\t\t<DevErrorList\n\t\t\tcurrentError={processedError}\n\t\t\tcurrentErrorSource={currentError.source}\n\t\t\tcurrentErrorIndex={errIndex}\n\t\t\terrorCount={errors.length}\n\t\t\tonPrevious={onPrevious}\n\t\t\tonNext={onNext}\n\t\t\tonClose={onClose}\n\t\t/>\n\t)\n}\n"],"names":["useState","useEffect","errors","useProcessedError","jsxDEV","DevErrorBadge","DevErrorList"],"mappings":";;;;;;;;;;AAIO,MAAM,SAAS;AAAA,EAAf,cAAA;AACN,kBAAA,MAAQ,SAAgD,EAAC;AACzD,kBAAA,MAAQ,YAA2E,IAAA;AAAA,EAAA;AAAA,EAEnF,MAAM,YAAY,QAAgB,OAAkB;AAC7C,UAAA,aAAa,EAAE,OAAO,OAAO;AAE/B,QAAA,CAAC,KAAK,UAAU;AACd,WAAA,MAAM,KAAK,UAAU;AACrB,WAAA,MAAM,KAAK,UAAU;AACrB,WAAA,MAAM,KAAK,UAAU;AACrB,WAAA,MAAM,KAAK,UAAU;AAAA,IAAA,OAEpB;AACN,WAAK,SAAS,UAAU;AACxB,WAAK,SAAS,UAAU;AACxB,WAAK,SAAS,UAAU;AACxB,WAAK,SAAS,UAAU;AAAA,IAAA;AAAA,EACzB;AAAA,EAGD,SAAS,UAA6E;AACrF,SAAK,WAAW;AACX,SAAA,MAAM,QAAQ,QAAQ;AAC3B,SAAK,QAAQ,CAAC;AACd,WAAO,MAAM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ACnB;AAAA,MACA;AAAA,MACA;AAAA,IAAA;AAAA,IAPD;AAAA,IAAA;AAAA,IAAA;AAAA,MAAA,UAAA;AAAA,MAAA,YAAA;AAAA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAA;AAAA,EAQA;AAEF;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"DevErrorManager.js","sources":["../../../../packages/react-devbar/src/DevErrorManager.tsx"],"sourcesContent":["import { DevErrorBadge, DevErrorList, ErrorType } from './ui/DevError'\nimport { useEffect, useState } from 'react'\nimport { useProcessedError } from './hooks/useParsedStacktrace'\n\nexport class ErrorBus {\n\tprivate queue: { error: ErrorType; source: string }[] = []\n\tprivate listener: null | ((error: { error: ErrorType; source: string }) => void) = null\n\n\tasync handleError(source: string, error: ErrorType) {\n\t\tconst boxedError = { error, source }\n\n\t\tif (!this.listener) {\n\t\t\tthis.queue.push(boxedError)\n\t\t\tthis.queue.push(boxedError)\n\t\t\tthis.queue.push(boxedError)\n\t\t\tthis.queue.push(boxedError)\n\n\t\t} else {\n\t\t\tthis.listener(boxedError)\n\t\t\tthis.listener(boxedError)\n\t\t\tthis.listener(boxedError)\n\t\t\tthis.listener(boxedError)\n\t\t}\n\t}\n\n\tregister(listener: (error: { error: ErrorType; source: string }) => void): () => void {\n\t\tthis.listener = listener\n\t\tthis.queue.forEach(listener)\n\t\tthis.queue = []\n\t\treturn () => {\n\t\t\tthis.listener = null\n\t\t}\n\t}\n}\n\nexport interface DevErrorManagerProps {\n\tbus: ErrorBus\n}\n\nexport function DevErrorManager(props: DevErrorManagerProps) {\n\tconst [errors, setErrors] = useState<{ error: ErrorType; source: string }[]>([])\n\tconst [errIndex, setErrorIndex] = useState(0)\n\tconst [open, setOpen] = useState(false)\n\n\tuseEffect(\n\t\t() => {\n\t\t\treturn props.bus.register(err => {\n\t\t\t\tsetTimeout(\n\t\t\t\t\t() => {\n\t\t\t\t\t\tsetErrors(errors => [err, ...errors])\n\t\t\t\t\t\tsetOpen(true)\n\t\t\t\t\t},\n\t\t\t\t\t0,\n\t\t\t\t)\n\t\t\t})\n\t\t},\n\t\t[props.bus],\n\t)\n\n\tconst currentError = errors[errIndex]\n\tconst processedError = useProcessedError(currentError?.error)\n\tif (!currentError) {\n\t\treturn null\n\t}\n\tconst onPrevious = () => setErrorIndex(it => Math.max(0, it - 1))\n\tconst onNext = () => setErrorIndex(it => Math.min(errors.length - 1, it + 1))\n\tconst onClose = () => setOpen(false)\n\tif (!open) {\n\t\treturn <DevErrorBadge errorCount={errors.length} onOpen={() => setOpen(true)} />\n\t}\n\treturn (\n\t\t<DevErrorList\n\t\t\tcurrentError={processedError}\n\t\t\tcurrentErrorSource={currentError.source}\n\t\t\tcurrentErrorIndex={errIndex}\n\t\t\terrorCount={errors.length}\n\t\t\tonPrevious={onPrevious}\n\t\t\tonNext={onNext}\n\t\t\tonClose={onClose}\n\t\t/>\n\t)\n}\n"],"names":["errors"],"mappings":";;;;;;;;AAIO,MAAM,SAAS;AAAA,EAAf,cAAA;AACN,kBAAA,MAAQ,SAAgD,CAAA,CAAC;AACzD,kBAAA,MAAQ,YAA2E,IAAA;AAAA,EAAA;AAAA,EAEnF,MAAM,YAAY,QAAgB,OAAkB;AAC7C,UAAA,aAAa,EAAE,OAAO;AAExB,QAAA,CAAC,KAAK,UAAU;AACd,WAAA,MAAM,KAAK,UAAU;AACrB,WAAA,MAAM,KAAK,UAAU;AACrB,WAAA,MAAM,KAAK,UAAU;AACrB,WAAA,MAAM,KAAK,UAAU;AAAA,IAAA,OAEpB;AACN,WAAK,SAAS,UAAU;AACxB,WAAK,SAAS,UAAU;AACxB,WAAK,SAAS,UAAU;AACxB,WAAK,SAAS,UAAU;AAAA,IACzB;AAAA,EACD;AAAA,EAEA,SAAS,UAA6E;AACrF,SAAK,WAAW;AACX,SAAA,MAAM,QAAQ,QAAQ;AAC3B,SAAK,QAAQ;AACb,WAAO,MAAM;AACZ,WAAK,WAAW;AAAA,IAAA;AAAA,EAElB;AACD;AAMO,SAAS,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A;AAAA,IAAA;AAAA,IAAA;AAAA,EAAA;AAUF;"}
1
+ {"version":3,"file":"DevErrorManager.js","sources":["../../../../packages/react-devbar/src/DevErrorManager.tsx"],"sourcesContent":["import { DevErrorBadge, DevErrorList, ErrorType } from './ui/DevError'\nimport { useEffect, useState } from 'react'\nimport { useProcessedError } from './hooks/useParsedStacktrace'\n\nexport class ErrorBus {\n\tprivate queue: { error: ErrorType; source: string }[] = []\n\tprivate listener: null | ((error: { error: ErrorType; source: string }) => void) = null\n\n\tasync handleError(source: string, error: ErrorType) {\n\t\tconst boxedError = { error, source }\n\n\t\tif (!this.listener) {\n\t\t\tthis.queue.push(boxedError)\n\t\t\tthis.queue.push(boxedError)\n\t\t\tthis.queue.push(boxedError)\n\t\t\tthis.queue.push(boxedError)\n\n\t\t} else {\n\t\t\tthis.listener(boxedError)\n\t\t\tthis.listener(boxedError)\n\t\t\tthis.listener(boxedError)\n\t\t\tthis.listener(boxedError)\n\t\t}\n\t}\n\n\tregister(listener: (error: { error: ErrorType; source: string }) => void): () => void {\n\t\tthis.listener = listener\n\t\tthis.queue.forEach(listener)\n\t\tthis.queue = []\n\t\treturn () => {\n\t\t\tthis.listener = null\n\t\t}\n\t}\n}\n\nexport interface DevErrorManagerProps {\n\tbus: ErrorBus\n}\n\nexport function DevErrorManager(props: DevErrorManagerProps) {\n\tconst [errors, setErrors] = useState<{ error: ErrorType; source: string }[]>([])\n\tconst [errIndex, setErrorIndex] = useState(0)\n\tconst [open, setOpen] = useState(false)\n\n\tuseEffect(\n\t\t() => {\n\t\t\treturn props.bus.register(err => {\n\t\t\t\tsetTimeout(\n\t\t\t\t\t() => {\n\t\t\t\t\t\tsetErrors(errors => [err, ...errors])\n\t\t\t\t\t\tsetOpen(true)\n\t\t\t\t\t},\n\t\t\t\t\t0,\n\t\t\t\t)\n\t\t\t})\n\t\t},\n\t\t[props.bus],\n\t)\n\n\tconst currentError = errors[errIndex]\n\tconst processedError = useProcessedError(currentError?.error)\n\tif (!currentError) {\n\t\treturn null\n\t}\n\tconst onPrevious = () => setErrorIndex(it => Math.max(0, it - 1))\n\tconst onNext = () => setErrorIndex(it => Math.min(errors.length - 1, it + 1))\n\tconst onClose = () => setOpen(false)\n\tif (!open) {\n\t\treturn <DevErrorBadge errorCount={errors.length} onOpen={() => setOpen(true)} />\n\t}\n\treturn (\n\t\t<DevErrorList\n\t\t\tcurrentError={processedError}\n\t\t\tcurrentErrorSource={currentError.source}\n\t\t\tcurrentErrorIndex={errIndex}\n\t\t\terrorCount={errors.length}\n\t\t\tonPrevious={onPrevious}\n\t\t\tonNext={onNext}\n\t\t\tonClose={onClose}\n\t\t/>\n\t)\n}\n"],"names":["errors"],"mappings":";;;;;;;;AAIO,MAAM,SAAS;AAAA,EAAf,cAAA;AACN,kBAAA,MAAQ,SAAgD,EAAC;AACzD,kBAAA,MAAQ,YAA2E,IAAA;AAAA,EAAA;AAAA,EAEnF,MAAM,YAAY,QAAgB,OAAkB;AAC7C,UAAA,aAAa,EAAE,OAAO,OAAO;AAE/B,QAAA,CAAC,KAAK,UAAU;AACd,WAAA,MAAM,KAAK,UAAU;AACrB,WAAA,MAAM,KAAK,UAAU;AACrB,WAAA,MAAM,KAAK,UAAU;AACrB,WAAA,MAAM,KAAK,UAAU;AAAA,IAAA,OAEpB;AACN,WAAK,SAAS,UAAU;AACxB,WAAK,SAAS,UAAU;AACxB,WAAK,SAAS,UAAU;AACxB,WAAK,SAAS,UAAU;AAAA,IAAA;AAAA,EACzB;AAAA,EAGD,SAAS,UAA6E;AACrF,SAAK,WAAW;AACX,SAAA,MAAM,QAAQ,QAAQ;AAC3B,SAAK,QAAQ,CAAC;AACd,WAAO,MAAM;AACZ,WAAK,WAAW;AAAA,IACjB;AAAA,EAAA;AAEF;AAMO,SAAS,gBAAgB,OAA6B;AAC5D,QAAM,CAAC,QAAQ,SAAS,IAAI,SAAiD,CAAA,CAAE;AAC/E,QAAM,CAAC,UAAU,aAAa,IAAI,SAAS,CAAC;AAC5C,QA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esContent":["import * as ReactDOM from 'react-dom'\nimport { Buffer } from 'buffer'\nimport { DevErrorManager, ErrorBus } from './DevErrorManager'\nimport { ReactElement } from 'react'\n\nexport type ErrorReactRenderer = (domElement: Element, reactElement: ReactElement, onRecoverableError: (e: any) => void) => void\n\nconst getErrorContainer = () => {\n\tconst errorElementId = '__contember__dev__error__container__element'\n\tlet errorContainer = document.getElementById(errorElementId)\n\n\tif (errorContainer) {\n\t\t// eslint-disable-next-line react/no-deprecated\n\t\tReactDOM.unmountComponentAtNode(errorContainer)\n\n\t} else {\n\t\terrorContainer = document.createElement('div')\n\t\terrorContainer.id = errorElementId\n\t\tdocument.body.appendChild(errorContainer)\n\t}\n\n\treturn errorContainer\n}\n\nconst devErrorHandler = (renderer: ErrorReactRenderer): TryRun => {\n\tconst errorBus = new ErrorBus()\n\n\t;(window as any).Buffer = Buffer\n\twindow.addEventListener('error', e => {\n\t\tif (e.message.startsWith('ResizeObserver')) {\n\t\t\t// Apparently, this can be ignored: https://stackoverflow.com/questions/49384120/resizeobserver-loop-limit-exceeded\n\t\t\treturn\n\t\t}\n\t\terrorBus.handleError('Unhandled error', e.error)\n\t})\n\n\twindow.addEventListener('unhandledrejection', e => errorBus.handleError('Unhandled promise rejection', e.reason))\n\n\tconst origOnError = console.error\n\tconsole.error = (...args) => {\n\t\torigOnError(...args)\n\t\tfor (const arg of args) {\n\t\t\tif (arg instanceof Error) {\n\t\t\t\terrorBus.handleError('Logged error', arg)\n\t\t\t}\n\t\t}\n\t}\n\trenderer(getErrorContainer(), <DevErrorManager bus={errorBus} />, () => {})\n\n\treturn async cb => {\n\t\ttry {\n\t\t\tawait cb(e => errorBus.handleError('Recoverable React error', e))\n\t\t} catch (e) {\n\t\t\terrorBus.handleError('Entrypoint crash', e)\n\t\t}\n\t}\n}\n\ntype TryRun = <T>(cb: (onRecoverableError: (e: any) => void) => T | Promise<T>) => void\nconst prodErrorHandler = (renderer: ErrorReactRenderer): TryRun => {\n\tconst renderError = () => {\n\t\trenderer(getErrorContainer(), <h1>Fatal error</h1>, () => {})\n\t}\n\n\twindow.addEventListener('error', renderError)\n\twindow.addEventListener('unhandledrejection', renderError)\n\n\treturn async cb => {\n\t\ttry {\n\t\t\tawait cb(e => {\n\t\t\t\tconsole.warn(e)\n\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t\trenderError()\n\t\t}\n\t}\n}\n\n\nexport const createErrorHandler = (renderer: ErrorReactRenderer) => {\n\tif (import.meta.env.DEV) {\n\t\treturn devErrorHandler(renderer)\n\t} else {\n\t\treturn prodErrorHandler(renderer)\n\t}\n}\n"],"names":["ReactDOM","ErrorBus","Buffer","jsxDEV","DevErrorManager"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAM,oBAAoB,MAAM;AAC/B,QAAM,iBAAiB;AACnB,MAAA,iBAAiB,SAAS,eAAe,cAAc;AAE3D,MAAI,gBAAgB;AAEnBA,wBAAS,uBAAuB,cAAc;AAAA,EAAA,OAExC;AACW,qBAAA,SAAS,cAAc,KAAK;AAC7C,mBAAe,KAAK;AACX,aAAA,KAAK,YAAY,cAAc;AAAA,EACzC;AAEO,SAAA;AACR;AAEA,MAAM,kBAAkB,CAAC,aAAyC;AAC3D,QAAA,WAAW,IAAIC,gBAAAA;AAEnB,SAAe,SAASC;AACnB,SAAA,iBAAiB,SAAS,CAAK,MAAA;AACrC,QAAI,EAAE,QAAQ,WAAW,gBAAgB,GAAG;AAE3C;AAAA,IACD;AACS,aAAA,YAAY,mBAAmB,EAAE,KAAK;AAAA,EAAA,CAC/C;AAEM,SAAA,iBAAiB,sBAAsB,CAAK,MAAA,SAAS,YAAY,+BAA+B,EAAE,MAAM,CAAC;AAEhH,QAAM,cAAc,QAAQ;AACpB,UAAA,QAAQ,IAAI,SAAS;AAC5B,gBAAY,GAAG,IAAI;AACnB,eAAW,OAAO,MAAM;AACvB,UAAI,eAAe,OAAO;AAChB,iBAAA,YAAY,gBAAgB,GAAG;AAAA,MACzC;AAAA,IACD;AAAA,EAAA;AAEQ,WAAA,qBAAsBC,8BAAAA,OAAAC,gBAAA,iBAAA,EAAgB,KAAK,SAAtB,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAA,MAAgC,GAAI,MAAM;AAAA,EAAA,CAAE;AAE1E,SAAO,OAAM,OAAM;AACd,QAAA;AACH,YAAM,GAAG,CAAK,MAAA,SAAS,YAAY,2BAA2B,CAAC,CAAC;AAAA,aACxD,GAAG;AACF,eAAA,YAAY,oBAAoB,CAAC;AAAA,IAC3C;AAAA,EAAA;AAEF;AAwBa,MAAA,qBAAqB,CAAC,aAAiC;AAC1C;AACxB,WAAO,gBAAgB,QAAQ;AAAA,EAGhC;AACD;;"}
1
+ {"version":3,"file":"errorHandling.cjs","sources":["../../../../packages/react-devbar/src/errorHandling.tsx"],"sourcesContent":["import * as ReactDOM from 'react-dom'\nimport { Buffer } from 'buffer'\nimport { DevErrorManager, ErrorBus } from './DevErrorManager'\nimport { ReactElement } from 'react'\n\nexport type ErrorReactRenderer = (domElement: Element, reactElement: ReactElement, onRecoverableError: (e: any) => void) => void\n\nconst getErrorContainer = () => {\n\tconst errorElementId = '__contember__dev__error__container__element'\n\tlet errorContainer = document.getElementById(errorElementId)\n\n\tif (errorContainer) {\n\t\t// eslint-disable-next-line react/no-deprecated\n\t\tReactDOM.unmountComponentAtNode(errorContainer)\n\n\t} else {\n\t\terrorContainer = document.createElement('div')\n\t\terrorContainer.id = errorElementId\n\t\tdocument.body.appendChild(errorContainer)\n\t}\n\n\treturn errorContainer\n}\n\nconst devErrorHandler = (renderer: ErrorReactRenderer): TryRun => {\n\tconst errorBus = new ErrorBus()\n\n\t;(window as any).Buffer = Buffer\n\twindow.addEventListener('error', e => {\n\t\tif (e.message.startsWith('ResizeObserver')) {\n\t\t\t// Apparently, this can be ignored: https://stackoverflow.com/questions/49384120/resizeobserver-loop-limit-exceeded\n\t\t\treturn\n\t\t}\n\t\terrorBus.handleError('Unhandled error', e.error)\n\t})\n\n\twindow.addEventListener('unhandledrejection', e => errorBus.handleError('Unhandled promise rejection', e.reason))\n\n\tconst origOnError = console.error\n\tconsole.error = (...args) => {\n\t\torigOnError(...args)\n\t\tfor (const arg of args) {\n\t\t\tif (arg instanceof Error) {\n\t\t\t\terrorBus.handleError('Logged error', arg)\n\t\t\t}\n\t\t}\n\t}\n\trenderer(getErrorContainer(), <DevErrorManager bus={errorBus} />, () => {})\n\n\treturn async cb => {\n\t\ttry {\n\t\t\tawait cb(e => errorBus.handleError('Recoverable React error', e))\n\t\t} catch (e) {\n\t\t\terrorBus.handleError('Entrypoint crash', e)\n\t\t}\n\t}\n}\n\ntype TryRun = <T>(cb: (onRecoverableError: (e: any) => void) => T | Promise<T>) => void\nconst prodErrorHandler = (renderer: ErrorReactRenderer): TryRun => {\n\tconst renderError = () => {\n\t\trenderer(getErrorContainer(), <h1>Fatal error</h1>, () => {})\n\t}\n\n\twindow.addEventListener('error', renderError)\n\twindow.addEventListener('unhandledrejection', renderError)\n\n\treturn async cb => {\n\t\ttry {\n\t\t\tawait cb(e => {\n\t\t\t\tconsole.warn(e)\n\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t\trenderError()\n\t\t}\n\t}\n}\n\n\nexport const createErrorHandler = (renderer: ErrorReactRenderer) => {\n\tif (import.meta.env.DEV) {\n\t\treturn devErrorHandler(renderer)\n\t} else {\n\t\treturn prodErrorHandler(renderer)\n\t}\n}\n"],"names":["ReactDOM","ErrorBus","Buffer","jsxDEV","DevErrorManager"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAOA,MAAM,oBAAoB,MAAM;AAC/B,QAAM,iBAAiB;AACnB,MAAA,iBAAiB,SAAS,eAAe,cAAc;AAE3D,MAAI,gBAAgB;AAEnBA,wBAAS,uBAAuB,cAAc;AAAA,EAAA,OAExC;AACW,qBAAA,SAAS,cAAc,KAAK;AAC7C,mBAAe,KAAK;AACX,aAAA,KAAK,YAAY,cAAc;AAAA,EAAA;AAGlC,SAAA;AACR;AAEA,MAAM,kBAAkB,CAAC,aAAyC;AAC3D,QAAA,WAAW,IAAIC,yBAAS;AAE5B,SAAe,SAASC,OAAA;AACnB,SAAA,iBAAiB,SAAS,CAAK,MAAA;AACrC,QAAI,EAAE,QAAQ,WAAW,gBAAgB,GAAG;AAE3C;AAAA,IAAA;AAEQ,aAAA,YAAY,mBAAmB,EAAE,KAAK;AAAA,EAAA,CAC/C;AAEM,SAAA,iBAAiB,sBAAsB,CAAK,MAAA,SAAS,YAAY,+BAA+B,EAAE,MAAM,CAAC;AAEhH,QAAM,cAAc,QAAQ;AACpB,UAAA,QAAQ,IAAI,SAAS;AAC5B,gBAAY,GAAG,IAAI;AACnB,eAAW,OAAO,MAAM;AACvB,UAAI,eAAe,OAAO;AAChB,iBAAA,YAAY,gBAAgB,GAAG;AAAA,MAAA;AAAA,IACzC;AAAA,EAEF;AACS,WAAA,qBAAsBC,8BAAAA,OAAAC,gBAAA,iBAAA,EAAgB,KAAK,SAAtB,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAA,MAAgC,GAAI,MAAM;AAAA,EAAA,CAAE;AAE1E,SAAO,OAAM,OAAM;AACd,QAAA;AACH,YAAM,GAAG,CAAK,MAAA,SAAS,YAAY,2BAA2B,CAAC,CAAC;AAAA,aACxD,GAAG;AACF,eAAA,YAAY,oBAAoB,CAAC;AAAA,IAAA;AAAA,EAE5C;AACD;AAwBa,MAAA,qBAAqB,CAAC,aAAiC;AAC1C;AACxB,WAAO,gBAAgB,QAAQ;AAAA,EAAA;AAIjC;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"errorHandling.js","sources":["../../../../packages/react-devbar/src/errorHandling.tsx"],"sourcesContent":["import * as ReactDOM from 'react-dom'\nimport { Buffer } from 'buffer'\nimport { DevErrorManager, ErrorBus } from './DevErrorManager'\nimport { ReactElement } from 'react'\n\nexport type ErrorReactRenderer = (domElement: Element, reactElement: ReactElement, onRecoverableError: (e: any) => void) => void\n\nconst getErrorContainer = () => {\n\tconst errorElementId = '__contember__dev__error__container__element'\n\tlet errorContainer = document.getElementById(errorElementId)\n\n\tif (errorContainer) {\n\t\t// eslint-disable-next-line react/no-deprecated\n\t\tReactDOM.unmountComponentAtNode(errorContainer)\n\n\t} else {\n\t\terrorContainer = document.createElement('div')\n\t\terrorContainer.id = errorElementId\n\t\tdocument.body.appendChild(errorContainer)\n\t}\n\n\treturn errorContainer\n}\n\nconst devErrorHandler = (renderer: ErrorReactRenderer): TryRun => {\n\tconst errorBus = new ErrorBus()\n\n\t;(window as any).Buffer = Buffer\n\twindow.addEventListener('error', e => {\n\t\tif (e.message.startsWith('ResizeObserver')) {\n\t\t\t// Apparently, this can be ignored: https://stackoverflow.com/questions/49384120/resizeobserver-loop-limit-exceeded\n\t\t\treturn\n\t\t}\n\t\terrorBus.handleError('Unhandled error', e.error)\n\t})\n\n\twindow.addEventListener('unhandledrejection', e => errorBus.handleError('Unhandled promise rejection', e.reason))\n\n\tconst origOnError = console.error\n\tconsole.error = (...args) => {\n\t\torigOnError(...args)\n\t\tfor (const arg of args) {\n\t\t\tif (arg instanceof Error) {\n\t\t\t\terrorBus.handleError('Logged error', arg)\n\t\t\t}\n\t\t}\n\t}\n\trenderer(getErrorContainer(), <DevErrorManager bus={errorBus} />, () => {})\n\n\treturn async cb => {\n\t\ttry {\n\t\t\tawait cb(e => errorBus.handleError('Recoverable React error', e))\n\t\t} catch (e) {\n\t\t\terrorBus.handleError('Entrypoint crash', e)\n\t\t}\n\t}\n}\n\ntype TryRun = <T>(cb: (onRecoverableError: (e: any) => void) => T | Promise<T>) => void\nconst prodErrorHandler = (renderer: ErrorReactRenderer): TryRun => {\n\tconst renderError = () => {\n\t\trenderer(getErrorContainer(), <h1>Fatal error</h1>, () => {})\n\t}\n\n\twindow.addEventListener('error', renderError)\n\twindow.addEventListener('unhandledrejection', renderError)\n\n\treturn async cb => {\n\t\ttry {\n\t\t\tawait cb(e => {\n\t\t\t\tconsole.warn(e)\n\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t\trenderError()\n\t\t}\n\t}\n}\n\n\nexport const createErrorHandler = (renderer: ErrorReactRenderer) => {\n\tif (import.meta.env.DEV) {\n\t\treturn devErrorHandler(renderer)\n\t} else {\n\t\treturn prodErrorHandler(renderer)\n\t}\n}\n"],"names":[],"mappings":";;;;AAOA,MAAM,oBAAoB,MAAM;AAC/B,QAAM,iBAAiB;AACnB,MAAA,iBAAiB,SAAS,eAAe,cAAc;AAE3D,MAAI,gBAAgB;AAEnB,aAAS,uBAAuB,cAAc;AAAA,EAAA,OAExC;AACW,qBAAA,SAAS,cAAc,KAAK;AAC7C,mBAAe,KAAK;AACX,aAAA,KAAK,YAAY,cAAc;AAAA,EACzC;AAEO,SAAA;AACR;AAEA,MAAM,kBAAkB,CAAC,aAAyC;AAC3D,QAAA,WAAW,IAAI;AAEnB,SAAe,SAAS;AACnB,SAAA,iBAAiB,SAAS,CAAK,MAAA;AACrC,QAAI,EAAE,QAAQ,WAAW,gBAAgB,GAAG;AAE3C;AAAA,IACD;AACS,aAAA,YAAY,mBAAmB,EAAE,KAAK;AAAA,EAAA,CAC/C;AAEM,SAAA,iBAAiB,sBAAsB,CAAK,MAAA,SAAS,YAAY,+BAA+B,EAAE,MAAM,CAAC;AAEhH,QAAM,cAAc,QAAQ;AACpB,UAAA,QAAQ,IAAI,SAAS;AAC5B,gBAAY,GAAG,IAAI;AACnB,eAAW,OAAO,MAAM;AACvB,UAAI,eAAe,OAAO;AAChB,iBAAA,YAAY,gBAAgB,GAAG;AAAA,MACzC;AAAA,IACD;AAAA,EAAA;AAEQ,WAAA,qBAAsB,uBAAA,iBAAA,EAAgB,KAAK,SAAtB,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAA,MAAgC,GAAI,MAAM;AAAA,EAAA,CAAE;AAE1E,SAAO,OAAM,OAAM;AACd,QAAA;AACH,YAAM,GAAG,CAAK,MAAA,SAAS,YAAY,2BAA2B,CAAC,CAAC;AAAA,aACxD,GAAG;AACF,eAAA,YAAY,oBAAoB,CAAC;AAAA,IAC3C;AAAA,EAAA;AAEF;AAwBa,MAAA,qBAAqB,CAAC,aAAiC;AAC1C;AACxB,WAAO,gBAAgB,QAAQ;AAAA,EAGhC;AACD;"}
1
+ {"version":3,"file":"errorHandling.js","sources":["../../../../packages/react-devbar/src/errorHandling.tsx"],"sourcesContent":["import * as ReactDOM from 'react-dom'\nimport { Buffer } from 'buffer'\nimport { DevErrorManager, ErrorBus } from './DevErrorManager'\nimport { ReactElement } from 'react'\n\nexport type ErrorReactRenderer = (domElement: Element, reactElement: ReactElement, onRecoverableError: (e: any) => void) => void\n\nconst getErrorContainer = () => {\n\tconst errorElementId = '__contember__dev__error__container__element'\n\tlet errorContainer = document.getElementById(errorElementId)\n\n\tif (errorContainer) {\n\t\t// eslint-disable-next-line react/no-deprecated\n\t\tReactDOM.unmountComponentAtNode(errorContainer)\n\n\t} else {\n\t\terrorContainer = document.createElement('div')\n\t\terrorContainer.id = errorElementId\n\t\tdocument.body.appendChild(errorContainer)\n\t}\n\n\treturn errorContainer\n}\n\nconst devErrorHandler = (renderer: ErrorReactRenderer): TryRun => {\n\tconst errorBus = new ErrorBus()\n\n\t;(window as any).Buffer = Buffer\n\twindow.addEventListener('error', e => {\n\t\tif (e.message.startsWith('ResizeObserver')) {\n\t\t\t// Apparently, this can be ignored: https://stackoverflow.com/questions/49384120/resizeobserver-loop-limit-exceeded\n\t\t\treturn\n\t\t}\n\t\terrorBus.handleError('Unhandled error', e.error)\n\t})\n\n\twindow.addEventListener('unhandledrejection', e => errorBus.handleError('Unhandled promise rejection', e.reason))\n\n\tconst origOnError = console.error\n\tconsole.error = (...args) => {\n\t\torigOnError(...args)\n\t\tfor (const arg of args) {\n\t\t\tif (arg instanceof Error) {\n\t\t\t\terrorBus.handleError('Logged error', arg)\n\t\t\t}\n\t\t}\n\t}\n\trenderer(getErrorContainer(), <DevErrorManager bus={errorBus} />, () => {})\n\n\treturn async cb => {\n\t\ttry {\n\t\t\tawait cb(e => errorBus.handleError('Recoverable React error', e))\n\t\t} catch (e) {\n\t\t\terrorBus.handleError('Entrypoint crash', e)\n\t\t}\n\t}\n}\n\ntype TryRun = <T>(cb: (onRecoverableError: (e: any) => void) => T | Promise<T>) => void\nconst prodErrorHandler = (renderer: ErrorReactRenderer): TryRun => {\n\tconst renderError = () => {\n\t\trenderer(getErrorContainer(), <h1>Fatal error</h1>, () => {})\n\t}\n\n\twindow.addEventListener('error', renderError)\n\twindow.addEventListener('unhandledrejection', renderError)\n\n\treturn async cb => {\n\t\ttry {\n\t\t\tawait cb(e => {\n\t\t\t\tconsole.warn(e)\n\t\t\t})\n\t\t} catch (e) {\n\t\t\tconsole.error(e)\n\t\t\trenderError()\n\t\t}\n\t}\n}\n\n\nexport const createErrorHandler = (renderer: ErrorReactRenderer) => {\n\tif (import.meta.env.DEV) {\n\t\treturn devErrorHandler(renderer)\n\t} else {\n\t\treturn prodErrorHandler(renderer)\n\t}\n}\n"],"names":[],"mappings":";;;;AAOA,MAAM,oBAAoB,MAAM;AAC/B,QAAM,iBAAiB;AACnB,MAAA,iBAAiB,SAAS,eAAe,cAAc;AAE3D,MAAI,gBAAgB;AAEnB,aAAS,uBAAuB,cAAc;AAAA,EAAA,OAExC;AACW,qBAAA,SAAS,cAAc,KAAK;AAC7C,mBAAe,KAAK;AACX,aAAA,KAAK,YAAY,cAAc;AAAA,EAAA;AAGlC,SAAA;AACR;AAEA,MAAM,kBAAkB,CAAC,aAAyC;AAC3D,QAAA,WAAW,IAAI,SAAS;AAE5B,SAAe,SAAS;AACnB,SAAA,iBAAiB,SAAS,CAAK,MAAA;AACrC,QAAI,EAAE,QAAQ,WAAW,gBAAgB,GAAG;AAE3C;AAAA,IAAA;AAEQ,aAAA,YAAY,mBAAmB,EAAE,KAAK;AAAA,EAAA,CAC/C;AAEM,SAAA,iBAAiB,sBAAsB,CAAK,MAAA,SAAS,YAAY,+BAA+B,EAAE,MAAM,CAAC;AAEhH,QAAM,cAAc,QAAQ;AACpB,UAAA,QAAQ,IAAI,SAAS;AAC5B,gBAAY,GAAG,IAAI;AACnB,eAAW,OAAO,MAAM;AACvB,UAAI,eAAe,OAAO;AAChB,iBAAA,YAAY,gBAAgB,GAAG;AAAA,MAAA;AAAA,IACzC;AAAA,EAEF;AACS,WAAA,qBAAsB,uBAAA,iBAAA,EAAgB,KAAK,SAAtB,GAAA,QAAA,OAAA;AAAA,IAAA,UAAA;AAAA,IAAA,YAAA;AAAA,IAAA,cAAA;AAAA,EAAA,GAAA,MAAgC,GAAI,MAAM;AAAA,EAAA,CAAE;AAE1E,SAAO,OAAM,OAAM;AACd,QAAA;AACH,YAAM,GAAG,CAAK,MAAA,SAAS,YAAY,2BAA2B,CAAC,CAAC;AAAA,aACxD,GAAG;AACF,eAAA,YAAY,oBAAoB,CAAC;AAAA,IAAA;AAAA,EAE5C;AACD;AAwBa,MAAA,qBAAqB,CAAC,aAAiC;AAC1C;AACxB,WAAO,gBAAgB,QAAQ;AAAA,EAAA;AAIjC;"}
@@ -24,7 +24,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
24
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
25
25
  const React = require("react");
26
26
  const parseStacktrace = async (e) => {
27
- const StackTracey = (await import("stacktracey")).default;
27
+ let StackTracey;
28
+ try {
29
+ StackTracey = (await import("stacktracey")).default;
30
+ } catch {
31
+ return void 0;
32
+ }
28
33
  return (await new StackTracey(e).withSourcesAsync()).items.map((it) => ({
29
34
  filename: it.fileShort,
30
35
  line: it.line,
@@ -1 +1 @@
1
- {"version":3,"file":"useParsedStacktrace.cjs","sources":["../../../../../packages/react-devbar/src/hooks/useParsedStacktrace.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\nimport { ErrorType, ProcessedError } from '../ui/DevError'\n\nexport const parseStacktrace = async (e: Error) => {\n\tconst StackTracey = (await import('stacktracey')).default\n\treturn (await new StackTracey(e).withSourcesAsync()).items.map(it => ({\n\t\tfilename: it.fileShort,\n\t\tline: it.line,\n\t\tcallee: it.callee,\n\t\tthirdParty: it.thirdParty,\n\t\tsourceCodeLines: it.sourceFile?.lines,\n\t}))\n}\n\nconst createInitialError = (e: ErrorType): ProcessedError => ({\n\terror: e,\n\tcause: e instanceof Error && 'cause' in e && (e as any).cause !== undefined ? createInitialError((e as any).cause) : undefined,\n})\n\nexport const useProcessedError = (e: ErrorType): ProcessedError => {\n\tconst [error, setError] = useState<ProcessedError>(() => createInitialError(e))\n\tuseEffect(() => {\n\t\tsetError(createInitialError(e))\n\t\tif (!(e instanceof Error)) {\n\t\t\treturn\n\t\t}\n\t\tconst createErrorWithStackTrace = async (e: ErrorType): Promise<ProcessedError> => {\n\t\t\treturn {\n\t\t\t\terror: e,\n\t\t\t\tparsedStackStrace: e instanceof Error ? await parseStacktrace(e) : undefined,\n\t\t\t\tcause: e instanceof Error && 'cause' in e && (e as any).cause !== undefined ? await createErrorWithStackTrace((e as any).cause) : undefined,\n\t\t\t}\n\t\t}\n\t\t(async () => {\n\t\t\tsetError(await createErrorWithStackTrace(e))\n\t\t})()\n\t}, [e])\n\n\treturn error\n}\n"],"names":["useState","useEffect","e"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAGa,MAAA,kBAAkB,OAAO,MAAa;AAClD,QAAM,eAAe,MAAM,OAAO,aAAa,GAAG;AAC1C,UAAA,MAAM,IAAI,YAAY,CAAC,EAAE,iBAAiB,GAAG,MAAM,IAAI,CAAO,QAAA;AAAA,IACrE,UAAU,GAAG;AAAA,IACb,MAAM,GAAG;AAAA,IACT,QAAQ,GAAG;AAAA,IACX,YAAY,GAAG;AAAA,IACf,iBAAiB,GAAG,YAAY;AAAA,EAC/B,EAAA;AACH;AAEA,MAAM,qBAAqB,CAAC,OAAkC;AAAA,EAC7D,OAAO;AAAA,EACP,OAAO,aAAa,SAAS,WAAW,KAAM,EAAU,UAAU,SAAY,mBAAoB,EAAU,KAAK,IAAI;AACtH;AAEa,MAAA,oBAAoB,CAAC,MAAiC;AAC5D,QAAA,CAAC,OAAO,QAAQ,IAAIA,eAAyB,MAAM,mBAAmB,CAAC,CAAC;AAC9EC,QAAAA,UAAU,MAAM;AACN,aAAA,mBAAmB,CAAC,CAAC;AAC1B,QAAA,EAAE,aAAa,QAAQ;AAC1B;AAAA,IACD;AACM,UAAA,4BAA4B,OAAOC,OAA0C;AAC3E,aAAA;AAAA,QACN,OAAOA;AAAAA,QACP,mBAAmBA,cAAa,QAAQ,MAAM,gBAAgBA,EAAC,IAAI;AAAA,QACnE,OAAOA,cAAa,SAAS,WAAWA,MAAMA,GAAU,UAAU,SAAY,MAAM,0BAA2BA,GAAU,KAAK,IAAI;AAAA,MAAA;AAAA,IACnI;AAED,KAAC,YAAY;AACH,eAAA,MAAM,0BAA0B,CAAC,CAAC;AAAA,IAAA;EACzC,GACD,CAAC,CAAC,CAAC;AAEC,SAAA;AACR;;;"}
1
+ {"version":3,"file":"useParsedStacktrace.cjs","sources":["../../../../../packages/react-devbar/src/hooks/useParsedStacktrace.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\nimport { ErrorType, ProcessedError } from '../ui/DevError'\n\nexport const parseStacktrace = async (e: Error) => {\n\tlet StackTracey\n\ttry {\n\t\tStackTracey = (await import('stacktracey')).default\n\t} catch {\n\t\treturn undefined\n\t}\n\treturn (await new StackTracey(e).withSourcesAsync()).items.map(it => ({\n\t\tfilename: it.fileShort,\n\t\tline: it.line,\n\t\tcallee: it.callee,\n\t\tthirdParty: it.thirdParty,\n\t\tsourceCodeLines: it.sourceFile?.lines,\n\t}))\n}\n\nconst createInitialError = (e: ErrorType): ProcessedError => ({\n\terror: e,\n\tcause: e instanceof Error && 'cause' in e && (e as any).cause !== undefined ? createInitialError((e as any).cause) : undefined,\n})\n\nexport const useProcessedError = (e: ErrorType): ProcessedError => {\n\tconst [error, setError] = useState<ProcessedError>(() => createInitialError(e))\n\tuseEffect(() => {\n\t\tsetError(createInitialError(e))\n\t\tif (!(e instanceof Error)) {\n\t\t\treturn\n\t\t}\n\t\tconst createErrorWithStackTrace = async (e: ErrorType): Promise<ProcessedError> => {\n\t\t\treturn {\n\t\t\t\terror: e,\n\t\t\t\tparsedStackStrace: e instanceof Error ? await parseStacktrace(e) : undefined,\n\t\t\t\tcause: e instanceof Error && 'cause' in e && (e as any).cause !== undefined ? await createErrorWithStackTrace((e as any).cause) : undefined,\n\t\t\t}\n\t\t}\n\t\t(async () => {\n\t\t\tsetError(await createErrorWithStackTrace(e))\n\t\t})()\n\t}, [e])\n\n\treturn error\n}\n"],"names":["useState","useEffect","e"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAGa,MAAA,kBAAkB,OAAO,MAAa;AAC9C,MAAA;AACA,MAAA;AACY,mBAAA,MAAM,OAAO,aAAa,GAAG;AAAA,EAAA,QACrC;AACA,WAAA;AAAA,EAAA;AAEA,UAAA,MAAM,IAAI,YAAY,CAAC,EAAE,iBAAiB,GAAG,MAAM,IAAI,CAAO,QAAA;AAAA,IACrE,UAAU,GAAG;AAAA,IACb,MAAM,GAAG;AAAA,IACT,QAAQ,GAAG;AAAA,IACX,YAAY,GAAG;AAAA,IACf,iBAAiB,GAAG,YAAY;AAAA,EAAA,EAC/B;AACH;AAEA,MAAM,qBAAqB,CAAC,OAAkC;AAAA,EAC7D,OAAO;AAAA,EACP,OAAO,aAAa,SAAS,WAAW,KAAM,EAAU,UAAU,SAAY,mBAAoB,EAAU,KAAK,IAAI;AACtH;AAEa,MAAA,oBAAoB,CAAC,MAAiC;AAC5D,QAAA,CAAC,OAAO,QAAQ,IAAIA,eAAyB,MAAM,mBAAmB,CAAC,CAAC;AAC9EC,QAAAA,UAAU,MAAM;AACN,aAAA,mBAAmB,CAAC,CAAC;AAC1B,QAAA,EAAE,aAAa,QAAQ;AAC1B;AAAA,IAAA;AAEK,UAAA,4BAA4B,OAAOC,OAA0C;AAC3E,aAAA;AAAA,QACN,OAAOA;AAAAA,QACP,mBAAmBA,cAAa,QAAQ,MAAM,gBAAgBA,EAAC,IAAI;AAAA,QACnE,OAAOA,cAAa,SAAS,WAAWA,MAAMA,GAAU,UAAU,SAAY,MAAM,0BAA2BA,GAAU,KAAK,IAAI;AAAA,MACnI;AAAA,IACD;AACA,KAAC,YAAY;AACH,eAAA,MAAM,0BAA0B,CAAC,CAAC;AAAA,IAAA,GACzC;AAAA,EAAA,GACD,CAAC,CAAC,CAAC;AAEC,SAAA;AACR;;;"}
@@ -1,6 +1,11 @@
1
1
  import { useState, useEffect } from "react";
2
2
  const parseStacktrace = async (e) => {
3
- const StackTracey = (await import("stacktracey")).default;
3
+ let StackTracey;
4
+ try {
5
+ StackTracey = (await import("stacktracey")).default;
6
+ } catch {
7
+ return void 0;
8
+ }
4
9
  return (await new StackTracey(e).withSourcesAsync()).items.map((it) => ({
5
10
  filename: it.fileShort,
6
11
  line: it.line,
@@ -1 +1 @@
1
- {"version":3,"file":"useParsedStacktrace.js","sources":["../../../../../packages/react-devbar/src/hooks/useParsedStacktrace.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\nimport { ErrorType, ProcessedError } from '../ui/DevError'\n\nexport const parseStacktrace = async (e: Error) => {\n\tconst StackTracey = (await import('stacktracey')).default\n\treturn (await new StackTracey(e).withSourcesAsync()).items.map(it => ({\n\t\tfilename: it.fileShort,\n\t\tline: it.line,\n\t\tcallee: it.callee,\n\t\tthirdParty: it.thirdParty,\n\t\tsourceCodeLines: it.sourceFile?.lines,\n\t}))\n}\n\nconst createInitialError = (e: ErrorType): ProcessedError => ({\n\terror: e,\n\tcause: e instanceof Error && 'cause' in e && (e as any).cause !== undefined ? createInitialError((e as any).cause) : undefined,\n})\n\nexport const useProcessedError = (e: ErrorType): ProcessedError => {\n\tconst [error, setError] = useState<ProcessedError>(() => createInitialError(e))\n\tuseEffect(() => {\n\t\tsetError(createInitialError(e))\n\t\tif (!(e instanceof Error)) {\n\t\t\treturn\n\t\t}\n\t\tconst createErrorWithStackTrace = async (e: ErrorType): Promise<ProcessedError> => {\n\t\t\treturn {\n\t\t\t\terror: e,\n\t\t\t\tparsedStackStrace: e instanceof Error ? await parseStacktrace(e) : undefined,\n\t\t\t\tcause: e instanceof Error && 'cause' in e && (e as any).cause !== undefined ? await createErrorWithStackTrace((e as any).cause) : undefined,\n\t\t\t}\n\t\t}\n\t\t(async () => {\n\t\t\tsetError(await createErrorWithStackTrace(e))\n\t\t})()\n\t}, [e])\n\n\treturn error\n}\n"],"names":["e"],"mappings":";AAGa,MAAA,kBAAkB,OAAO,MAAa;AAClD,QAAM,eAAe,MAAM,OAAO,aAAa,GAAG;AAC1C,UAAA,MAAM,IAAI,YAAY,CAAC,EAAE,iBAAiB,GAAG,MAAM,IAAI,CAAO,QAAA;AAAA,IACrE,UAAU,GAAG;AAAA,IACb,MAAM,GAAG;AAAA,IACT,QAAQ,GAAG;AAAA,IACX,YAAY,GAAG;AAAA,IACf,iBAAiB,GAAG,YAAY;AAAA,EAC/B,EAAA;AACH;AAEA,MAAM,qBAAqB,CAAC,OAAkC;AAAA,EAC7D,OAAO;AAAA,EACP,OAAO,aAAa,SAAS,WAAW,KAAM,EAAU,UAAU,SAAY,mBAAoB,EAAU,KAAK,IAAI;AACtH;AAEa,MAAA,oBAAoB,CAAC,MAAiC;AAC5D,QAAA,CAAC,OAAO,QAAQ,IAAI,SAAyB,MAAM,mBAAmB,CAAC,CAAC;AAC9E,YAAU,MAAM;AACN,aAAA,mBAAmB,CAAC,CAAC;AAC1B,QAAA,EAAE,aAAa,QAAQ;AAC1B;AAAA,IACD;AACM,UAAA,4BAA4B,OAAOA,OAA0C;AAC3E,aAAA;AAAA,QACN,OAAOA;AAAAA,QACP,mBAAmBA,cAAa,QAAQ,MAAM,gBAAgBA,EAAC,IAAI;AAAA,QACnE,OAAOA,cAAa,SAAS,WAAWA,MAAMA,GAAU,UAAU,SAAY,MAAM,0BAA2BA,GAAU,KAAK,IAAI;AAAA,MAAA;AAAA,IACnI;AAED,KAAC,YAAY;AACH,eAAA,MAAM,0BAA0B,CAAC,CAAC;AAAA,IAAA;EACzC,GACD,CAAC,CAAC,CAAC;AAEC,SAAA;AACR;"}
1
+ {"version":3,"file":"useParsedStacktrace.js","sources":["../../../../../packages/react-devbar/src/hooks/useParsedStacktrace.ts"],"sourcesContent":["import { useEffect, useState } from 'react'\nimport { ErrorType, ProcessedError } from '../ui/DevError'\n\nexport const parseStacktrace = async (e: Error) => {\n\tlet StackTracey\n\ttry {\n\t\tStackTracey = (await import('stacktracey')).default\n\t} catch {\n\t\treturn undefined\n\t}\n\treturn (await new StackTracey(e).withSourcesAsync()).items.map(it => ({\n\t\tfilename: it.fileShort,\n\t\tline: it.line,\n\t\tcallee: it.callee,\n\t\tthirdParty: it.thirdParty,\n\t\tsourceCodeLines: it.sourceFile?.lines,\n\t}))\n}\n\nconst createInitialError = (e: ErrorType): ProcessedError => ({\n\terror: e,\n\tcause: e instanceof Error && 'cause' in e && (e as any).cause !== undefined ? createInitialError((e as any).cause) : undefined,\n})\n\nexport const useProcessedError = (e: ErrorType): ProcessedError => {\n\tconst [error, setError] = useState<ProcessedError>(() => createInitialError(e))\n\tuseEffect(() => {\n\t\tsetError(createInitialError(e))\n\t\tif (!(e instanceof Error)) {\n\t\t\treturn\n\t\t}\n\t\tconst createErrorWithStackTrace = async (e: ErrorType): Promise<ProcessedError> => {\n\t\t\treturn {\n\t\t\t\terror: e,\n\t\t\t\tparsedStackStrace: e instanceof Error ? await parseStacktrace(e) : undefined,\n\t\t\t\tcause: e instanceof Error && 'cause' in e && (e as any).cause !== undefined ? await createErrorWithStackTrace((e as any).cause) : undefined,\n\t\t\t}\n\t\t}\n\t\t(async () => {\n\t\t\tsetError(await createErrorWithStackTrace(e))\n\t\t})()\n\t}, [e])\n\n\treturn error\n}\n"],"names":["e"],"mappings":";AAGa,MAAA,kBAAkB,OAAO,MAAa;AAC9C,MAAA;AACA,MAAA;AACY,mBAAA,MAAM,OAAO,aAAa,GAAG;AAAA,EAAA,QACrC;AACA,WAAA;AAAA,EAAA;AAEA,UAAA,MAAM,IAAI,YAAY,CAAC,EAAE,iBAAiB,GAAG,MAAM,IAAI,CAAO,QAAA;AAAA,IACrE,UAAU,GAAG;AAAA,IACb,MAAM,GAAG;AAAA,IACT,QAAQ,GAAG;AAAA,IACX,YAAY,GAAG;AAAA,IACf,iBAAiB,GAAG,YAAY;AAAA,EAAA,EAC/B;AACH;AAEA,MAAM,qBAAqB,CAAC,OAAkC;AAAA,EAC7D,OAAO;AAAA,EACP,OAAO,aAAa,SAAS,WAAW,KAAM,EAAU,UAAU,SAAY,mBAAoB,EAAU,KAAK,IAAI;AACtH;AAEa,MAAA,oBAAoB,CAAC,MAAiC;AAC5D,QAAA,CAAC,OAAO,QAAQ,IAAI,SAAyB,MAAM,mBAAmB,CAAC,CAAC;AAC9E,YAAU,MAAM;AACN,aAAA,mBAAmB,CAAC,CAAC;AAC1B,QAAA,EAAE,aAAa,QAAQ;AAC1B;AAAA,IAAA;AAEK,UAAA,4BAA4B,OAAOA,OAA0C;AAC3E,aAAA;AAAA,QACN,OAAOA;AAAAA,QACP,mBAAmBA,cAAa,QAAQ,MAAM,gBAAgBA,EAAC,IAAI;AAAA,QACnE,OAAOA,cAAa,SAAS,WAAWA,MAAMA,GAAU,UAAU,SAAY,MAAM,0BAA2BA,GAAU,KAAK,IAAI;AAAA,MACnI;AAAA,IACD;AACA,KAAC,YAAY;AACH,eAAA,MAAM,0BAA0B,CAAC,CAAC;AAAA,IAAA,GACzC;AAAA,EAAA,GACD,CAAC,CAAC,CAAC;AAEC,SAAA;AACR;"}
@@ -7,12 +7,10 @@ const React = require("react");
7
7
  const className = (cls) => cls ? `cui-devBar-${cls}` : "cui-devBar";
8
8
  const DevBar = ({
9
9
  breakpoint = 768,
10
- children,
11
- brand
10
+ children
12
11
  }) => {
13
- const [expanded, setExpanded] = React.useState(true);
12
+ const [expanded, setExpanded] = React.useState(false);
14
13
  const isSmallScreen = reactUtils.useWindowSize().width < breakpoint;
15
- const toggleButtonRef = React.useRef(null);
16
14
  const handleToggle = reactUtils.useReferentiallyStableCallback(() => {
17
15
  setExpanded((expanded2) => !expanded2);
18
16
  });
@@ -21,16 +19,7 @@ const DevBar = ({
21
19
  if (event.code === "KeyJ" && (event.ctrlKey || event.metaKey)) {
22
20
  event.preventDefault();
23
21
  event.stopPropagation();
24
- if (expanded) {
25
- setExpanded(false);
26
- toggleButtonRef.current?.blur();
27
- } else {
28
- if (toggleButtonRef.current !== document.activeElement) {
29
- toggleButtonRef.current?.focus();
30
- } else {
31
- toggleButtonRef.current?.blur();
32
- }
33
- }
22
+ handleToggle();
34
23
  }
35
24
  }
36
25
  document.addEventListener("keydown", handleKeyDown);
@@ -40,99 +29,49 @@ const DevBar = ({
40
29
  reactUtils.useOnElementClickOutsideCallback(devBarContentRef, () => {
41
30
  if (expanded) {
42
31
  setExpanded(false);
43
- toggleButtonRef.current?.blur();
44
32
  }
45
33
  });
46
34
  const id = `dev-bar-panel${reactUtils.useId()}`;
47
35
  return /* @__PURE__ */ jsxDevRuntime.jsxDEV(
48
36
  "section",
49
37
  {
50
- "data-transparent": true,
51
- "data-overrides-lucide-icons": true,
38
+ "data-transparent": "true",
39
+ "data-overrides-lucide-icons": "true",
52
40
  "data-expanded": utilities.dataAttribute(expanded),
53
41
  "data-small-screen": utilities.dataAttribute(isSmallScreen),
54
42
  className: className(null),
55
- onKeyDown: (event) => {
56
- if (event.code === "Escape") {
57
- event.preventDefault();
58
- event.stopPropagation();
59
- if (expanded) {
60
- setExpanded(false);
61
- } else if (document.activeElement && document.activeElement instanceof HTMLElement) {
62
- document.activeElement.blur();
63
- }
64
- }
65
- },
66
- children: [
67
- /* @__PURE__ */ jsxDevRuntime.jsxDEV("style", { children: `svg { pointer-events: none }` }, void 0, false, {
68
- fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevBar/DevBar.tsx",
69
- lineNumber: 83,
70
- columnNumber: 4
71
- }, void 0),
72
- /* @__PURE__ */ jsxDevRuntime.jsxDEV("div", { ref: devBarContentRef, className: className("content"), children: [
73
- /* @__PURE__ */ jsxDevRuntime.jsxDEV(
74
- "div",
75
- {
76
- "data-expanded": utilities.dataAttribute(expanded),
77
- id,
78
- role: "dialog",
79
- style: { display: "contents" },
80
- children: [
81
- /* @__PURE__ */ jsxDevRuntime.jsxDEV("div", { className: className("brand"), children: brand }, void 0, false, {
82
- fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevBar/DevBar.tsx",
83
- lineNumber: 91,
84
- columnNumber: 6
85
- }, void 0),
86
- /* @__PURE__ */ jsxDevRuntime.jsxDEV("div", { className: className("panels"), children }, void 0, false, {
87
- fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevBar/DevBar.tsx",
88
- lineNumber: 96,
89
- columnNumber: 6
90
- }, void 0)
91
- ]
92
- },
93
- void 0,
94
- true,
95
- {
96
- fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevBar/DevBar.tsx",
97
- lineNumber: 85,
98
- columnNumber: 5
99
- },
100
- void 0
101
- ),
102
- /* @__PURE__ */ jsxDevRuntime.jsxDEV(
103
- "button",
104
- {
105
- ref: toggleButtonRef,
106
- id: "dev-bar-toggle-button",
107
- "aria-label": "Toggle Contember Developer Toolbar",
108
- "aria-controls": id,
109
- "aria-expanded": expanded,
110
- className: className("close"),
111
- onClick: handleToggle,
112
- tabIndex: 0,
113
- children: expanded ? "🗙" : "ᐸ"
114
- },
115
- void 0,
116
- false,
117
- {
118
- fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevBar/DevBar.tsx",
119
- lineNumber: 102,
120
- columnNumber: 5
121
- },
122
- void 0
123
- )
124
- ] }, void 0, true, {
43
+ children: /* @__PURE__ */ jsxDevRuntime.jsxDEV("div", { ref: devBarContentRef, className: className("content"), children: /* @__PURE__ */ jsxDevRuntime.jsxDEV(
44
+ "div",
45
+ {
46
+ "data-expanded": true,
47
+ id,
48
+ role: "dialog",
49
+ style: { display: "contents" },
50
+ children: /* @__PURE__ */ jsxDevRuntime.jsxDEV("div", { className: className("panels"), children }, void 0, false, {
51
+ fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevBar/DevBar.tsx",
52
+ lineNumber: 64,
53
+ columnNumber: 6
54
+ }, void 0)
55
+ },
56
+ void 0,
57
+ false,
58
+ {
125
59
  fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevBar/DevBar.tsx",
126
- lineNumber: 84,
127
- columnNumber: 4
128
- }, void 0)
129
- ]
60
+ lineNumber: 58,
61
+ columnNumber: 5
62
+ },
63
+ void 0
64
+ ) }, void 0, false, {
65
+ fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevBar/DevBar.tsx",
66
+ lineNumber: 57,
67
+ columnNumber: 4
68
+ }, void 0)
130
69
  },
131
70
  void 0,
132
- true,
71
+ false,
133
72
  {
134
73
  fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevBar/DevBar.tsx",
135
- lineNumber: 64,
74
+ lineNumber: 50,
136
75
  columnNumber: 3
137
76
  },
138
77
  void 0
@@ -140,97 +79,112 @@ const DevBar = ({
140
79
  };
141
80
  const DevPanel = ({ heading, icon, children, preview }) => {
142
81
  const id = `cui-devBar-panel-${reactUtils.useId()}`;
143
- const [expanded, setExpanded] = React.useState(false);
144
- const mouseEnterTimeStampRef = React.useRef(void 0);
145
- const devPanelRef = React.useRef(null);
146
- reactUtils.useOnElementMouseEnterDelayedCallback(devPanelRef, reactUtils.useReferentiallyStableCallback(({ type }) => {
147
- if (type === "mouseenter") {
148
- mouseEnterTimeStampRef.current = Date.now() + 300;
149
- setExpanded(true);
150
- }
151
- }));
152
- return /* @__PURE__ */ jsxDevRuntime.jsxDEV(
153
- "div",
154
- {
155
- ref: devPanelRef,
156
- "data-expanded": utilities.dataAttribute(expanded),
157
- className: className("trigger"),
158
- onMouseLeave: reactUtils.useReferentiallyStableCallback(() => {
159
- setExpanded(false);
160
- }),
161
- onKeyDown: reactUtils.useReferentiallyStableCallback((event) => {
162
- if (expanded && event.code === "Escape") {
163
- event.preventDefault();
164
- event.stopPropagation();
165
- setExpanded(false);
166
- }
167
- }),
168
- children: [
82
+ const dialogRef = React.useRef(null);
83
+ const triggerRef = React.useRef(null);
84
+ const handleOpen = React.useCallback(() => {
85
+ dialogRef.current?.showModal();
86
+ }, []);
87
+ const handleClose = React.useCallback(() => {
88
+ dialogRef.current?.close();
89
+ }, []);
90
+ React.useEffect(() => {
91
+ const dialog = dialogRef.current;
92
+ if (!dialog) return;
93
+ const handleClickOutside = (event) => {
94
+ const rect = dialog.getBoundingClientRect();
95
+ const isInDialog = rect.top <= event.clientY && event.clientY <= rect.top + rect.height && rect.left <= event.clientX && event.clientX <= rect.left + rect.width;
96
+ if (!isInDialog) {
97
+ dialog.close();
98
+ }
99
+ };
100
+ dialog.addEventListener("click", handleClickOutside);
101
+ return () => dialog.removeEventListener("click", handleClickOutside);
102
+ }, []);
103
+ React.useEffect(() => {
104
+ const handleEscape = (event) => {
105
+ if (event.key === "Escape") {
106
+ handleClose();
107
+ }
108
+ };
109
+ document.addEventListener("keydown", handleEscape);
110
+ return () => document.removeEventListener("keydown", handleEscape);
111
+ }, [handleClose]);
112
+ return /* @__PURE__ */ jsxDevRuntime.jsxDEV("div", { className: className("trigger"), children: [
113
+ /* @__PURE__ */ jsxDevRuntime.jsxDEV(
114
+ "button",
115
+ {
116
+ ref: triggerRef,
117
+ tabIndex: 0,
118
+ "aria-haspopup": "dialog",
119
+ "aria-controls": id,
120
+ className: className("trigger-label"),
121
+ onClick: handleOpen,
122
+ children: [
123
+ icon,
124
+ /* @__PURE__ */ jsxDevRuntime.jsxDEV("span", { className: className("trigger-label-text"), children: preview ?? heading }, void 0, false, {
125
+ fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevBar/DevBar.tsx",
126
+ lineNumber: 137,
127
+ columnNumber: 5
128
+ }, void 0)
129
+ ]
130
+ },
131
+ void 0,
132
+ true,
133
+ {
134
+ fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevBar/DevBar.tsx",
135
+ lineNumber: 128,
136
+ columnNumber: 4
137
+ },
138
+ void 0
139
+ ),
140
+ /* @__PURE__ */ jsxDevRuntime.jsxDEV("dialog", { ref: dialogRef, id, className: className("panel"), children: /* @__PURE__ */ jsxDevRuntime.jsxDEV("div", { className: className("panel-content"), children: [
141
+ /* @__PURE__ */ jsxDevRuntime.jsxDEV("div", { className: className("panel-header"), children: [
142
+ /* @__PURE__ */ jsxDevRuntime.jsxDEV("h2", { className: "h4", children: heading }, void 0, false, {
143
+ fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevBar/DevBar.tsx",
144
+ lineNumber: 145,
145
+ columnNumber: 7
146
+ }, void 0),
169
147
  /* @__PURE__ */ jsxDevRuntime.jsxDEV(
170
148
  "button",
171
149
  {
172
- tabIndex: 0,
173
- "aria-haspopup": "dialog",
174
- "aria-controls": id,
175
- "aria-expanded": expanded,
176
- className: className("trigger-label"),
177
- onClick: reactUtils.useReferentiallyStableCallback(() => {
178
- if (mouseEnterTimeStampRef.current && Date.now() < mouseEnterTimeStampRef.current) {
179
- return;
180
- } else {
181
- setExpanded((expanded2) => !expanded2);
182
- mouseEnterTimeStampRef.current = void 0;
183
- }
184
- }),
185
- children: [
186
- icon,
187
- /* @__PURE__ */ jsxDevRuntime.jsxDEV("span", { className: className("trigger-label-text"), children: preview ?? heading }, void 0, false, {
188
- fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevBar/DevBar.tsx",
189
- lineNumber: 170,
190
- columnNumber: 5
191
- }, void 0)
192
- ]
150
+ onClick: handleClose,
151
+ className: className("close-button"),
152
+ "aria-label": "Close",
153
+ children: "✕"
193
154
  },
194
155
  void 0,
195
- true,
156
+ false,
196
157
  {
197
158
  fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevBar/DevBar.tsx",
198
- lineNumber: 154,
199
- columnNumber: 4
159
+ lineNumber: 146,
160
+ columnNumber: 7
200
161
  },
201
162
  void 0
202
- ),
203
- expanded && /* @__PURE__ */ jsxDevRuntime.jsxDEV("div", { tabIndex: 0, id, role: "dialog", className: className("panel"), children: /* @__PURE__ */ jsxDevRuntime.jsxDEV("div", { className: className("panel-content"), children: [
204
- /* @__PURE__ */ jsxDevRuntime.jsxDEV("h2", { className: "h4", children: heading }, void 0, false, {
205
- fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevBar/DevBar.tsx",
206
- lineNumber: 175,
207
- columnNumber: 7
208
- }, void 0),
209
- /* @__PURE__ */ jsxDevRuntime.jsxDEV("div", { className: className("panel-body"), children }, void 0, false, {
210
- fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevBar/DevBar.tsx",
211
- lineNumber: 178,
212
- columnNumber: 7
213
- }, void 0)
214
- ] }, void 0, true, {
215
- fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevBar/DevBar.tsx",
216
- lineNumber: 174,
217
- columnNumber: 6
218
- }, void 0) }, void 0, false, {
219
- fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevBar/DevBar.tsx",
220
- lineNumber: 173,
221
- columnNumber: 5
222
- }, void 0)
223
- ]
224
- },
225
- void 0,
226
- true,
227
- {
163
+ )
164
+ ] }, void 0, true, {
165
+ fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevBar/DevBar.tsx",
166
+ lineNumber: 144,
167
+ columnNumber: 6
168
+ }, void 0),
169
+ /* @__PURE__ */ jsxDevRuntime.jsxDEV("div", { className: className("panel-body"), children }, void 0, false, {
170
+ fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevBar/DevBar.tsx",
171
+ lineNumber: 154,
172
+ columnNumber: 6
173
+ }, void 0)
174
+ ] }, void 0, true, {
228
175
  fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevBar/DevBar.tsx",
229
- lineNumber: 139,
230
- columnNumber: 3
231
- },
232
- void 0
233
- );
176
+ lineNumber: 143,
177
+ columnNumber: 5
178
+ }, void 0) }, void 0, false, {
179
+ fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevBar/DevBar.tsx",
180
+ lineNumber: 142,
181
+ columnNumber: 4
182
+ }, void 0)
183
+ ] }, void 0, true, {
184
+ fileName: "/home/runner/work/contember/contember/packages/react-devbar/src/ui/DevBar/DevBar.tsx",
185
+ lineNumber: 127,
186
+ columnNumber: 3
187
+ }, void 0);
234
188
  };
235
189
  exports.DevBar = DevBar;
236
190
  exports.DevPanel = DevPanel;
@@ -1 +1 @@
1
- {"version":3,"file":"DevBar.cjs","sources":["../../../../../../packages/react-devbar/src/ui/DevBar/DevBar.tsx"],"sourcesContent":["import {\n\tuseId,\n\tuseOnElementClickOutsideCallback,\n\tuseOnElementMouseEnterDelayedCallback,\n\tuseReferentiallyStableCallback,\n\tuseWindowSize,\n} from '@contember/react-utils'\nimport { dataAttribute } from '@contember/utilities'\nimport { PropsWithChildren, ReactNode, useEffect, useRef, useState } from 'react'\n\nconst className = (cls: string | null) => cls ? `cui-devBar-${cls}` : 'cui-devBar'\n\nexport const DevBar = ({\n\tbreakpoint = 768,\n\tchildren,\n\tbrand,\n}: PropsWithChildren<{\n\tbrand?: ReactNode\n\tbreakpoint?: number\n}>) => {\n\tconst [expanded, setExpanded] = useState(true)\n\tconst isSmallScreen = useWindowSize().width < breakpoint\n\tconst toggleButtonRef = useRef<HTMLButtonElement>(null)\n\n\tconst handleToggle = useReferentiallyStableCallback(() => {\n\t\tsetExpanded(expanded => !expanded)\n\t})\n\n\tuseEffect(() => {\n\t\tfunction handleKeyDown(event: KeyboardEvent) {\n\t\t\tif (event.code === 'KeyJ' && (event.ctrlKey || event.metaKey)) {\n\t\t\t\tevent.preventDefault()\n\t\t\t\tevent.stopPropagation()\n\n\t\t\t\tif (expanded) {\n\t\t\t\t\tsetExpanded(false)\n\t\t\t\t\ttoggleButtonRef.current?.blur()\n\t\t\t\t} else {\n\t\t\t\t\tif (toggleButtonRef.current !== document.activeElement) {\n\t\t\t\t\t\ttoggleButtonRef.current?.focus()\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttoggleButtonRef.current?.blur()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tdocument.addEventListener('keydown', handleKeyDown)\n\t\treturn () => document.removeEventListener('keydown', handleKeyDown)\n\t}, [expanded, handleToggle])\n\n\tconst devBarContentRef = useRef<HTMLDivElement>(null)\n\n\tuseOnElementClickOutsideCallback(devBarContentRef, () => {\n\t\tif (expanded) {\n\t\t\tsetExpanded(false)\n\t\t\ttoggleButtonRef.current?.blur()\n\t\t}\n\t})\n\n\tconst id = `dev-bar-panel${useId()}`\n\n\treturn (\n\t\t<section\n\t\t\tdata-transparent\n\t\t\tdata-overrides-lucide-icons\n\t\t\tdata-expanded={dataAttribute(expanded)}\n\t\t\tdata-small-screen={dataAttribute(isSmallScreen)}\n\t\t\tclassName={className(null)}\n\t\t\tonKeyDown={event => {\n\t\t\t\tif (event.code === 'Escape') {\n\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\tevent.stopPropagation()\n\n\t\t\t\t\tif (expanded) {\n\t\t\t\t\t\tsetExpanded(false)\n\t\t\t\t\t} else if (document.activeElement && document.activeElement instanceof HTMLElement) {\n\t\t\t\t\t\tdocument.activeElement.blur()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}}\n\t\t>\n\t\t\t<style>{`svg { pointer-events: none }`}</style>\n\t\t\t<div ref={devBarContentRef} className={className('content')}>\n\t\t\t\t<div\n\t\t\t\t\tdata-expanded={dataAttribute(expanded)}\n\t\t\t\t\tid={id}\n\t\t\t\t\trole=\"dialog\"\n\t\t\t\t\tstyle={{ display: 'contents' }}\n\t\t\t\t>\n\t\t\t\t\t<div className={className('brand')}>\n\t\t\t\t\t\t{brand}\n\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div className={className('panels')}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</div>\n\n\t\t\t\t</div>\n\n\t\t\t\t<button\n\t\t\t\t\tref={toggleButtonRef}\n\t\t\t\t\tid=\"dev-bar-toggle-button\"\n\t\t\t\t\taria-label=\"Toggle Contember Developer Toolbar\"\n\t\t\t\t\taria-controls={id}\n\t\t\t\t\taria-expanded={expanded}\n\t\t\t\t\tclassName={className('close')}\n\t\t\t\t\tonClick={handleToggle}\n\t\t\t\t\ttabIndex={0}\n\t\t\t\t>\n\t\t\t\t\t{expanded ? '🗙' : 'ᐸ'}\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t</section>\n\t)\n}\n\nexport const DevPanel = ({ heading, icon, children, preview }: {\n\ticon: ReactNode\n\theading: ReactNode\n\tchildren: ReactNode\n\tpreview?: ReactNode\n}) => {\n\tconst id = `cui-devBar-panel-${useId()}`\n\tconst [expanded, setExpanded] = useState(false)\n\tconst mouseEnterTimeStampRef = useRef<ReturnType<typeof Date.now> | undefined>(undefined)\n\n\tconst devPanelRef = useRef<HTMLDivElement>(null)\n\n\tuseOnElementMouseEnterDelayedCallback(devPanelRef, useReferentiallyStableCallback(({ type }) => {\n\t\tif (type === 'mouseenter') {\n\t\t\tmouseEnterTimeStampRef.current = Date.now() + 300\n\t\t\tsetExpanded(true)\n\t\t}\n\t}))\n\n\treturn (\n\t\t<div\n\t\t\tref={devPanelRef}\n\t\t\tdata-expanded={dataAttribute(expanded)}\n\t\t\tclassName={className('trigger')}\n\t\t\tonMouseLeave={useReferentiallyStableCallback(() => {\n\t\t\t\tsetExpanded(false)\n\t\t\t})}\n\t\t\tonKeyDown={useReferentiallyStableCallback(event => {\n\t\t\t\tif (expanded && event.code === 'Escape') {\n\t\t\t\t\tevent.preventDefault()\n\t\t\t\t\tevent.stopPropagation()\n\t\t\t\t\tsetExpanded(false)\n\t\t\t\t}\n\t\t\t})}\n\t\t>\n\t\t\t<button\n\t\t\t\ttabIndex={0}\n\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\taria-controls={id}\n\t\t\t\taria-expanded={expanded}\n\t\t\t\tclassName={className('trigger-label')}\n\t\t\t\tonClick={useReferentiallyStableCallback(() => {\n\t\t\t\t\tif (mouseEnterTimeStampRef.current && Date.now() < mouseEnterTimeStampRef.current) {\n\t\t\t\t\t\treturn\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetExpanded(expanded => !expanded)\n\t\t\t\t\t\tmouseEnterTimeStampRef.current = undefined\n\t\t\t\t\t}\n\t\t\t\t})}\n\t\t\t>\n\t\t\t\t{icon}\n\t\t\t\t<span className={className('trigger-label-text')}>{preview ?? heading}</span>\n\t\t\t</button>\n\t\t\t{expanded && (\n\t\t\t\t<div tabIndex={0} id={id} role=\"dialog\" className={className('panel')}>\n\t\t\t\t\t<div className={className('panel-content')}>\n\t\t\t\t\t\t<h2 className=\"h4\">\n\t\t\t\t\t\t\t{heading}\n\t\t\t\t\t\t</h2>\n\t\t\t\t\t\t<div className={className('panel-body')}>\n\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t)\n}\n"],"names":["useState","useWindowSize","useRef","useReferentiallyStableCallback","expanded","useEffect","useOnElementClickOutsideCallback","useId","jsxDEV","dataAttribute","this","useOnElementMouseEnterDelayedCallback"],"mappings":";;;;;;AAUA,MAAM,YAAY,CAAC,QAAuB,MAAM,cAAc,GAAG,KAAK;AAE/D,MAAM,SAAS,CAAC;AAAA,EACtB,aAAa;AAAA,EACb;AAAA,EACA;AACD,MAGO;AACN,QAAM,CAAC,UAAU,WAAW,IAAIA,eAAS,IAAI;AACvC,QAAA,gBAAgBC,WAAAA,gBAAgB,QAAQ;AACxC,QAAA,kBAAkBC,aAA0B,IAAI;AAEhD,QAAA,eAAeC,WAAAA,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AA,MAAA,cAAA;AAAA,IAAA;AAAA,IAAAA;AAAAA,EAAA;AA+CF;;;"}
1
+ {"version":3,"file":"DevBar.cjs","sources":["../../../../../../packages/react-devbar/src/ui/DevBar/DevBar.tsx"],"sourcesContent":["import {\n\tuseId,\n\tuseOnElementClickOutsideCallback,\n\tuseReferentiallyStableCallback,\n\tuseWindowSize,\n} from '@contember/react-utils'\nimport { dataAttribute } from '@contember/utilities'\nimport { PropsWithChildren, ReactNode, useCallback, useEffect, useRef, useState } from 'react'\n\nconst className = (cls: string | null) => cls ? `cui-devBar-${cls}` : 'cui-devBar'\n\nexport const DevBar = ({\n\tbreakpoint = 768,\n\tchildren,\n}: PropsWithChildren<{\n\tbreakpoint?: number\n}>) => {\n\tconst [expanded, setExpanded] = useState(false)\n\tconst isSmallScreen = useWindowSize().width < breakpoint\n\n\tconst handleToggle = useReferentiallyStableCallback(() => {\n\t\tsetExpanded(expanded => !expanded)\n\t})\n\n\tuseEffect(() => {\n\t\tfunction handleKeyDown(event: KeyboardEvent) {\n\t\t\tif (event.code === 'KeyJ' && (event.ctrlKey || event.metaKey)) {\n\t\t\t\tevent.preventDefault()\n\t\t\t\tevent.stopPropagation()\n\n\t\t\t\thandleToggle()\n\t\t\t}\n\t\t}\n\n\t\tdocument.addEventListener('keydown', handleKeyDown)\n\t\treturn () => document.removeEventListener('keydown', handleKeyDown)\n\t}, [expanded, handleToggle])\n\n\tconst devBarContentRef = useRef<HTMLDivElement>(null)\n\n\tuseOnElementClickOutsideCallback(devBarContentRef, () => {\n\t\tif (expanded) {\n\t\t\tsetExpanded(false)\n\t\t}\n\t})\n\n\tconst id = `dev-bar-panel${useId()}`\n\n\treturn (\n\t\t<section\n\t\t\tdata-transparent=\"true\"\n\t\t\tdata-overrides-lucide-icons=\"true\"\n\t\t\tdata-expanded={dataAttribute(expanded)}\n\t\t\tdata-small-screen={dataAttribute(isSmallScreen)}\n\t\t\tclassName={className(null)}\n\t\t>\n\t\t\t<div ref={devBarContentRef} className={className('content')}>\n\t\t\t\t<div\n\t\t\t\t\tdata-expanded={true}\n\t\t\t\t\tid={id}\n\t\t\t\t\trole=\"dialog\"\n\t\t\t\t\tstyle={{ display: 'contents' }}\n\t\t\t\t>\n\t\t\t\t\t<div className={className('panels')}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</section>\n\t)\n}\n\ninterface DevPanelProps {\n\ticon: ReactNode\n\theading: ReactNode\n\tchildren: ReactNode\n\tpreview?: ReactNode\n}\n\nexport const DevPanel = ({ heading, icon, children, preview }: DevPanelProps) => {\n\tconst id = `cui-devBar-panel-${useId()}`\n\tconst dialogRef = useRef<HTMLDialogElement>(null)\n\tconst triggerRef = useRef<HTMLButtonElement>(null)\n\n\tconst handleOpen = useCallback(() => {\n\t\tdialogRef.current?.showModal()\n\t}, [])\n\n\tconst handleClose = useCallback(() => {\n\t\tdialogRef.current?.close()\n\t}, [])\n\n\tuseEffect(() => {\n\t\tconst dialog = dialogRef.current\n\t\tif (!dialog) return\n\n\t\tconst handleClickOutside = (event: MouseEvent) => {\n\t\t\tconst rect = dialog.getBoundingClientRect()\n\t\t\tconst isInDialog = (\n\t\t\t\trect.top <= event.clientY &&\n\t\t\t\tevent.clientY <= rect.top + rect.height &&\n\t\t\t\trect.left <= event.clientX &&\n\t\t\t\tevent.clientX <= rect.left + rect.width\n\t\t\t)\n\n\t\t\tif (!isInDialog) {\n\t\t\t\tdialog.close()\n\t\t\t}\n\t\t}\n\n\t\tdialog.addEventListener('click', handleClickOutside)\n\t\treturn () => dialog.removeEventListener('click', handleClickOutside)\n\t}, [])\n\n\tuseEffect(() => {\n\t\tconst handleEscape = (event: KeyboardEvent) => {\n\t\t\tif (event.key === 'Escape') {\n\t\t\t\thandleClose()\n\t\t\t}\n\t\t}\n\n\t\tdocument.addEventListener('keydown', handleEscape)\n\t\treturn () => document.removeEventListener('keydown', handleEscape)\n\t}, [handleClose])\n\n\treturn (\n\t\t<div className={className('trigger')}>\n\t\t\t<button\n\t\t\t\tref={triggerRef}\n\t\t\t\ttabIndex={0}\n\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\taria-controls={id}\n\t\t\t\tclassName={className('trigger-label')}\n\t\t\t\tonClick={handleOpen}\n\t\t\t>\n\t\t\t\t{icon}\n\t\t\t\t<span className={className('trigger-label-text')}>\n\t\t\t\t\t{preview ?? heading}\n\t\t\t\t</span>\n\t\t\t</button>\n\n\t\t\t<dialog ref={dialogRef} id={id} className={className('panel')}>\n\t\t\t\t<div className={className('panel-content')}>\n\t\t\t\t\t<div className={className('panel-header')}>\n\t\t\t\t\t\t<h2 className=\"h4\">{heading}</h2>\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\tonClick={handleClose}\n\t\t\t\t\t\t\tclassName={className('close-button')}\n\t\t\t\t\t\t\taria-label=\"Close\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t✕\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className={className('panel-body')}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</dialog>\n\t\t</div>\n\t)\n}\n"],"names":["useState","useWindowSize","useReferentiallyStableCallback","expanded","useEffect","useRef","useOnElementClickOutsideCallback","useId","jsxDEV","dataAttribute","this","useCallback"],"mappings":";;;;;;AASA,MAAM,YAAY,CAAC,QAAuB,MAAM,cAAc,GAAG,KAAK;AAE/D,MAAM,SAAS,CAAC;AAAA,EACtB,aAAa;AAAA,EACb;AACD,MAEO;AACN,QAAM,CAAC,UAAU,WAAW,IAAIA,MAAAA,SAAS,KAAK;AACxC,QAAA,gBAAgBC,WAAAA,gBAAgB,QAAQ;AAExC,QAAA,eAAeC,WAAAA,+BAA+B,MAAM;AAC7C,gBAAA,CAAAC,cAAY,CAACA,SAAQ;AAAA,EAAA,CACjC;AAEDC,QAAAA,UAAU,MAAM;AACf,aAAS,cAAc,OAAsB;AAC5C,UA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