markdown-flow-ui 0.3.6 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/index8.cjs +1 -1
- package/dist/_virtual/index8.es.js +2 -2
- package/dist/_virtual/index9.cjs +1 -1
- package/dist/_virtual/index9.es.js +2 -2
- package/dist/assets/markdown-flow-ui.css +1 -1
- package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.cjs +3 -3
- package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.cjs.map +1 -1
- package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.es.js +145 -143
- package/dist/components/MarkdownFlowEditor/plugins/SyntaxHighlighter.es.js.map +1 -1
- package/dist/markdown-flow-ui-lib.css +1 -1
- package/dist/markdown-flow-ui.css +1 -1
- package/dist/node_modules/@braintree/sanitize-url/dist/index.cjs +1 -1
- package/dist/node_modules/@braintree/sanitize-url/dist/index.es.js +1 -1
- package/dist/node_modules/@radix-ui/react-arrow/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-arrow/dist/index.es.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.cjs +1 -1
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.es.js +92 -89
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.es.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-popper/dist/index.cjs +2 -0
- package/dist/node_modules/@radix-ui/react-popper/dist/index.cjs.map +1 -0
- package/dist/node_modules/@radix-ui/{react-tooltip/node_modules/@radix-ui/react-popper → react-popper}/dist/index.es.js +5 -5
- package/dist/node_modules/@radix-ui/react-popper/dist/index.es.js.map +1 -0
- package/dist/node_modules/@radix-ui/react-slot/dist/index.cjs +1 -1
- package/dist/node_modules/@radix-ui/react-slot/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-slot/dist/index.es.js +50 -47
- package/dist/node_modules/@radix-ui/react-slot/dist/index.es.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.cjs +1 -1
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.es.js +9 -9
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs +1 -1
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.es.js +10 -7
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.es.js.map +1 -1
- package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.cjs +1 -1
- package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.cjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.es.js +1 -1
- package/dist/node_modules/classnames/index.cjs +1 -1
- package/dist/node_modules/classnames/index.es.js +1 -1
- package/dist/node_modules/i18next/dist/esm/i18next.cjs +1 -1
- package/dist/node_modules/i18next/dist/esm/i18next.cjs.map +1 -1
- package/dist/node_modules/i18next/dist/esm/i18next.es.js +809 -900
- package/dist/node_modules/i18next/dist/esm/i18next.es.js.map +1 -1
- package/dist/node_modules/katex/dist/katex.cjs +14 -14
- package/dist/node_modules/katex/dist/katex.cjs.map +1 -1
- package/dist/node_modules/katex/dist/katex.es.js +1302 -1192
- package/dist/node_modules/katex/dist/katex.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/Icon.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/Icon.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/Icon.es.js +52 -29
- package/dist/node_modules/lucide-react/dist/esm/Icon.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/context.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/context.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/context.es.js +6 -0
- package/dist/node_modules/lucide-react/dist/esm/context.es.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.es.js +13 -16
- package/dist/node_modules/lucide-react/dist/esm/createLucideIcon.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/captions-off.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/captions-off.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/captions-off.es.js +16 -10
- package/dist/node_modules/lucide-react/dist/esm/icons/captions-off.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/captions.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/captions.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/captions.es.js +13 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/captions.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/check.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/check.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/check.es.js +8 -2
- package/dist/node_modules/lucide-react/dist/esm/icons/check.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.es.js +10 -4
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-left.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/chevrons-down.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/chevrons-down.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/chevrons-down.es.js +12 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/chevrons-down.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-check.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-check.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-check.es.js +14 -7
- package/dist/node_modules/lucide-react/dist/esm/icons/circle-check.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/copy.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/copy.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/copy.es.js +11 -5
- package/dist/node_modules/lucide-react/dist/esm/icons/copy.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.es.js +13 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/ellipsis-vertical.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/fast-forward.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/fast-forward.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/fast-forward.es.js +22 -7
- package/dist/node_modules/lucide-react/dist/esm/icons/fast-forward.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/file-type.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/file-type.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/file-type.es.js +20 -8
- package/dist/node_modules/lucide-react/dist/esm/icons/file-type.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/grip-horizontal.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/grip-horizontal.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/grip-horizontal.es.js +17 -11
- package/dist/node_modules/lucide-react/dist/esm/icons/grip-horizontal.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/image.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/image.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/image.es.js +14 -8
- package/dist/node_modules/lucide-react/dist/esm/icons/image.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/loader-circle.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/loader-circle.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/loader-circle.es.js +11 -4
- package/dist/node_modules/lucide-react/dist/esm/icons/loader-circle.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/maximize.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/maximize.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/maximize.es.js +15 -9
- package/dist/node_modules/lucide-react/dist/esm/icons/maximize.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/rewind.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/rewind.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/rewind.es.js +25 -7
- package/dist/node_modules/lucide-react/dist/esm/icons/rewind.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/scan-line.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/scan-line.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/scan-line.es.js +16 -10
- package/dist/node_modules/lucide-react/dist/esm/icons/scan-line.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-back.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-back.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-back.es.js +19 -7
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-back.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-forward.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-forward.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-forward.es.js +19 -7
- package/dist/node_modules/lucide-react/dist/esm/icons/skip-forward.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/square-check.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/square-check.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/square-check.es.js +14 -7
- package/dist/node_modules/lucide-react/dist/esm/icons/square-check.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/square-play.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/square-play.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/square-play.es.js +19 -6
- package/dist/node_modules/lucide-react/dist/esm/icons/square-play.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/text-cursor-input.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/text-cursor-input.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/text-cursor-input.es.js +15 -9
- package/dist/node_modules/lucide-react/dist/esm/icons/text-cursor-input.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/upload.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/upload.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/upload.es.js +13 -7
- package/dist/node_modules/lucide-react/dist/esm/icons/upload.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/volume-2.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/volume-2.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/volume-2.es.js +19 -13
- package/dist/node_modules/lucide-react/dist/esm/icons/volume-2.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/x.cjs +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/x.cjs.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/icons/x.es.js +13 -7
- package/dist/node_modules/lucide-react/dist/esm/icons/x.es.js.map +1 -1
- package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconForReact.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconForReact.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconForReact.es.js +18 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconForReact.es.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconNode.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconNode.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconNode.es.js +44 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/build/buildLucideIconNode.es.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/build/defaultAttributes.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/build/defaultAttributes.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/{defaultAttributes.es.js → shared/src/build/defaultAttributes.es.js} +4 -4
- package/dist/node_modules/lucide-react/dist/esm/shared/src/build/defaultAttributes.es.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.es.js +10 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/hasA11yProp.es.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.es.js +5 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.es.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.es.js +15 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toCamelCase.es.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.es.js +5 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toKebabCase.es.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toLucideIconData.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toLucideIconData.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toLucideIconData.es.js +15 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toLucideIconData.es.js.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.cjs +2 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.cjs.map +1 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.es.js +9 -0
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils/toPascalCase.es.js.map +1 -0
- package/dist/node_modules/micromark/lib/create-tokenizer.cjs +3 -3
- package/dist/node_modules/micromark/lib/create-tokenizer.cjs.map +1 -1
- package/dist/node_modules/micromark/lib/create-tokenizer.es.js +78 -76
- package/dist/node_modules/micromark/lib/create-tokenizer.es.js.map +1 -1
- package/dist/node_modules/micromark/lib/initialize/document.cjs +1 -1
- package/dist/node_modules/micromark/lib/initialize/document.cjs.map +1 -1
- package/dist/node_modules/micromark/lib/initialize/document.es.js +77 -75
- package/dist/node_modules/micromark/lib/initialize/document.es.js.map +1 -1
- package/dist/node_modules/micromark/lib/initialize/text.cjs +1 -1
- package/dist/node_modules/micromark/lib/initialize/text.cjs.map +1 -1
- package/dist/node_modules/micromark/lib/initialize/text.es.js +67 -64
- package/dist/node_modules/micromark/lib/initialize/text.es.js.map +1 -1
- package/dist/node_modules/micromark/lib/preprocess.cjs +1 -1
- package/dist/node_modules/micromark/lib/preprocess.cjs.map +1 -1
- package/dist/node_modules/micromark/lib/preprocess.es.js +19 -14
- package/dist/node_modules/micromark/lib/preprocess.es.js.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/attention.cjs +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/attention.cjs.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/attention.es.js +36 -32
- package/dist/node_modules/micromark-core-commonmark/lib/attention.es.js.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/code-fenced.cjs +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/code-fenced.cjs.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/code-fenced.es.js +49 -61
- package/dist/node_modules/micromark-core-commonmark/lib/code-fenced.es.js.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/code-indented.cjs +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/code-indented.cjs.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/code-indented.es.js +21 -27
- package/dist/node_modules/micromark-core-commonmark/lib/code-indented.es.js.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/heading-atx.cjs +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/heading-atx.cjs.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/heading-atx.es.js +18 -14
- package/dist/node_modules/micromark-core-commonmark/lib/heading-atx.es.js.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/html-flow.cjs +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/html-flow.cjs.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/html-flow.es.js +59 -71
- package/dist/node_modules/micromark-core-commonmark/lib/html-flow.es.js.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/label-end.cjs +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/label-end.cjs.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/label-end.es.js +87 -85
- package/dist/node_modules/micromark-core-commonmark/lib/label-end.es.js.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/label-start-image.cjs +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/label-start-image.cjs.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/label-start-image.es.js +11 -10
- package/dist/node_modules/micromark-core-commonmark/lib/label-start-image.es.js.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/label-start-link.cjs +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/label-start-link.cjs.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/label-start-link.es.js +12 -11
- package/dist/node_modules/micromark-core-commonmark/lib/label-start-link.es.js.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.cjs +2 -0
- package/dist/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.cjs.map +1 -0
- package/dist/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.es.js +18 -0
- package/dist/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.es.js.map +1 -0
- package/dist/node_modules/micromark-core-commonmark/lib/setext-underline.cjs +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/setext-underline.cjs.map +1 -1
- package/dist/node_modules/micromark-core-commonmark/lib/setext-underline.es.js +35 -33
- package/dist/node_modules/micromark-core-commonmark/lib/setext-underline.es.js.map +1 -1
- package/dist/node_modules/micromark-extension-gfm-table/lib/edit-map.cjs +1 -1
- package/dist/node_modules/micromark-extension-gfm-table/lib/edit-map.cjs.map +1 -1
- package/dist/node_modules/micromark-extension-gfm-table/lib/edit-map.es.js +32 -28
- package/dist/node_modules/micromark-extension-gfm-table/lib/edit-map.es.js.map +1 -1
- package/dist/node_modules/micromark-extension-gfm-table/lib/syntax.cjs +1 -1
- package/dist/node_modules/micromark-extension-gfm-table/lib/syntax.cjs.map +1 -1
- package/dist/node_modules/micromark-extension-gfm-table/lib/syntax.es.js +18 -14
- package/dist/node_modules/micromark-extension-gfm-table/lib/syntax.es.js.map +1 -1
- package/dist/node_modules/micromark-factory-space/index.cjs +1 -1
- package/dist/node_modules/micromark-factory-space/index.cjs.map +1 -1
- package/dist/node_modules/micromark-factory-space/index.es.js +24 -10
- package/dist/node_modules/micromark-factory-space/index.es.js.map +1 -1
- package/dist/node_modules/micromark-util-edit-map/index.cjs +2 -0
- package/dist/node_modules/micromark-util-edit-map/index.cjs.map +1 -0
- package/dist/node_modules/micromark-util-edit-map/index.es.js +83 -0
- package/dist/node_modules/micromark-util-edit-map/index.es.js.map +1 -0
- package/package.json +24 -17
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/primitive/dist/index.cjs +0 -2
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/primitive/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/primitive/dist/index.es.js +0 -50
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/primitive/dist/index.es.js.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-arrow/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-arrow/dist/index.es.js.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-context/dist/index.cjs +0 -2
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-context/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-context/dist/index.es.js +0 -82
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-context/dist/index.es.js.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-dismissable-layer/dist/index.cjs +0 -2
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-dismissable-layer/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-dismissable-layer/dist/index.es.js +0 -216
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-dismissable-layer/dist/index.es.js.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-focus-scope/dist/index.cjs +0 -2
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-focus-scope/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-focus-scope/dist/index.es.js +0 -105
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-focus-scope/dist/index.es.js.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-popper/dist/index.cjs +0 -2
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-popper/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-popper/dist/index.es.js.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-portal/dist/index.cjs +0 -2
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-portal/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-portal/dist/index.es.js +0 -18
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-portal/dist/index.es.js.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-primitive/dist/index.cjs +0 -2
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-primitive/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-primitive/dist/index.es.js +0 -39
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-primitive/dist/index.es.js.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.cjs +0 -2
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.es.js +0 -99
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.es.js.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs +0 -2
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-callback-ref/dist/index.es.js +0 -16
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-callback-ref/dist/index.es.js.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-controllable-state/dist/index.cjs +0 -2
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-controllable-state/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-controllable-state/dist/index.es.js +0 -70
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-use-controllable-state/dist/index.es.js.map +0 -1
- package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-primitive/dist/index.cjs +0 -2
- package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-primitive/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-primitive/dist/index.es.js +0 -39
- package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-primitive/dist/index.es.js.map +0 -1
- package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-slot/dist/index.cjs +0 -2
- package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-slot/dist/index.cjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-slot/dist/index.es.js +0 -99
- package/dist/node_modules/@radix-ui/react-visually-hidden/node_modules/@radix-ui/react-slot/dist/index.es.js.map +0 -1
- package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.cjs +0 -2
- package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.cjs.map +0 -1
- package/dist/node_modules/lucide-react/dist/esm/defaultAttributes.es.js.map +0 -1
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.cjs +0 -2
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.cjs.map +0 -1
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.es.js +0 -19
- package/dist/node_modules/lucide-react/dist/esm/shared/src/utils.es.js.map +0 -1
- /package/dist/node_modules/@radix-ui/{react-tooltip/node_modules/@radix-ui/react-arrow → react-arrow}/dist/index.cjs +0 -0
- /package/dist/node_modules/@radix-ui/{react-tooltip/node_modules/@radix-ui/react-arrow → react-arrow}/dist/index.es.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../../../../../node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-context/dist/index.mjs"],"sourcesContent":["var __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/create-context.tsx\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n// @__NO_SIDE_EFFECTS__\nfunction createContext2(rootComponentName, defaultContext) {\n const Context = React.createContext(defaultContext);\n Context.displayName = rootComponentName + \"Context\";\n const Provider = /* @__PURE__ */ __name((props) => {\n const { children, ...context } = props;\n const value = React.useMemo(() => context, Object.values(context));\n return /* @__PURE__ */ jsx(Context.Provider, { value, children });\n }, \"Provider\");\n Provider.displayName = rootComponentName + \"Provider\";\n function useContext2(consumerName, options = {}) {\n const { optional = false } = options;\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== void 0) return defaultContext;\n if (optional) return void 0;\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n __name(useContext2, \"useContext\");\n return [Provider, useContext2];\n}\n__name(createContext2, \"createContext\");\n// @__NO_SIDE_EFFECTS__\nfunction createContextScope(scopeName, createContextScopeDeps = []) {\n let defaultContexts = [];\n function createContext3(rootComponentName, defaultContext) {\n const BaseContext = React.createContext(defaultContext);\n BaseContext.displayName = rootComponentName + \"Context\";\n const index = defaultContexts.length;\n defaultContexts = [...defaultContexts, defaultContext];\n const Provider = /* @__PURE__ */ __name((props) => {\n const { scope, children, ...context } = props;\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n const value = React.useMemo(() => context, Object.values(context));\n return /* @__PURE__ */ jsx(Context.Provider, { value, children });\n }, \"Provider\");\n Provider.displayName = rootComponentName + \"Provider\";\n function useContext2(consumerName, scope, options = {}) {\n const { optional = false } = options;\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== void 0) return defaultContext;\n if (optional) return void 0;\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n __name(useContext2, \"useContext\");\n return [Provider, useContext2];\n }\n __name(createContext3, \"createContext\");\n const createScope = /* @__PURE__ */ __name(() => {\n const scopeContexts = defaultContexts.map((defaultContext) => {\n return React.createContext(defaultContext);\n });\n return /* @__PURE__ */ __name(function useScope(scope) {\n const contexts = scope?.[scopeName] || scopeContexts;\n return React.useMemo(\n () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),\n [scope, contexts]\n );\n }, \"useScope\");\n }, \"createScope\");\n createScope.scopeName = scopeName;\n return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];\n}\n__name(createContextScope, \"createContextScope\");\nfunction composeContextScopes(...scopes) {\n const baseScope = scopes[0];\n if (scopes.length === 1) return baseScope;\n const createScope = /* @__PURE__ */ __name(() => {\n const scopeHooks = scopes.map((createScope2) => ({\n useScope: createScope2(),\n scopeName: createScope2.scopeName\n }));\n return /* @__PURE__ */ __name(function useComposedScopes(overrideScopes) {\n const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {\n const scopeProps = useScope(overrideScopes);\n const currentScope = scopeProps[`__scope${scopeName}`];\n return { ...nextScopes2, ...currentScope };\n }, {});\n return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);\n }, \"useComposedScopes\");\n }, \"createScope\");\n createScope.scopeName = baseScope.scopeName;\n return createScope;\n}\n__name(composeContextScopes, \"composeContextScopes\");\nexport {\n createContext2 as createContext,\n createContextScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["__defProp","__name","target","value","createContext2","rootComponentName","defaultContext","Context","React","Provider","props","children","context","jsx","useContext2","consumerName","options","optional","createContextScope","scopeName","createContextScopeDeps","defaultContexts","createContext3","BaseContext","index","scope","createScope","scopeContexts","contexts","composeContextScopes","scopes","baseScope","scopeHooks","createScope2","overrideScopes","nextScopes","nextScopes2","useScope","currentScope"],"mappings":"kaAAA,IAAIA,EAAY,OAAO,eACnBC,EAAS,CAACC,EAAQC,IAAUH,EAAUE,EAAQ,OAAQ,CAAE,MAAAC,EAAO,aAAc,GAAM,EAMvF,SAASC,EAAeC,EAAmBC,EAAgB,CACzD,MAAMC,EAAUC,EAAM,cAAcF,CAAc,EAClDC,EAAQ,YAAcF,EAAoB,UAC1C,MAAMI,EAA2BR,EAAQS,GAAU,CACjD,KAAM,CAAE,SAAAC,EAAU,GAAGC,CAAO,EAAKF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rD,MAAO,CAAE,GAAGiB,EAAa,GAAGE,CAAY,CAC1C,EAAG,CAAA,CAAE,EACL,OAAO9B,EAAM,QAAQ,KAAO,CAAE,CAAC,UAAUuB,EAAU,SAAS,EAAE,EAAGI,CAAU,GAAK,CAACA,CAAU,CAAC,CAC9F,EAAG,mBAAmB,CACxB,EAAG,aAAa,EAChB,OAAAT,EAAY,UAAYK,EAAU,UAC3BL,CACT,CACAzB,EAAO4B,EAAsB,sBAAsB","x_google_ignoreList":[0]}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import * as p from "react";
|
|
2
|
-
import { jsx as P } from "react/jsx-runtime";
|
|
3
|
-
var h = Object.defineProperty, r = (e, c) => h(e, "name", { value: c, configurable: !0 });
|
|
4
|
-
// @__NO_SIDE_EFFECTS__
|
|
5
|
-
function b(e, c) {
|
|
6
|
-
const s = p.createContext(c);
|
|
7
|
-
s.displayName = e + "Context";
|
|
8
|
-
const a = /* @__PURE__ */ r((u) => {
|
|
9
|
-
const { children: t, ...o } = u, n = p.useMemo(() => o, Object.values(o));
|
|
10
|
-
return /* @__PURE__ */ P(s.Provider, { value: n, children: t });
|
|
11
|
-
}, "Provider");
|
|
12
|
-
a.displayName = e + "Provider";
|
|
13
|
-
function i(u, t = {}) {
|
|
14
|
-
const { optional: o = !1 } = t, n = p.useContext(s);
|
|
15
|
-
if (n) return n;
|
|
16
|
-
if (c !== void 0) return c;
|
|
17
|
-
if (!o)
|
|
18
|
-
throw new Error(`\`${u}\` must be used within \`${e}\``);
|
|
19
|
-
}
|
|
20
|
-
return r(i, "useContext"), [a, i];
|
|
21
|
-
}
|
|
22
|
-
r(b, "createContext");
|
|
23
|
-
// @__NO_SIDE_EFFECTS__
|
|
24
|
-
function $(e, c = []) {
|
|
25
|
-
let s = [];
|
|
26
|
-
function a(u, t) {
|
|
27
|
-
const o = p.createContext(t);
|
|
28
|
-
o.displayName = u + "Context";
|
|
29
|
-
const n = s.length;
|
|
30
|
-
s = [...s, t];
|
|
31
|
-
const d = /* @__PURE__ */ r((x) => {
|
|
32
|
-
const { scope: m, children: S, ...C } = x, l = m?.[e]?.[n] || o, f = p.useMemo(() => C, Object.values(C));
|
|
33
|
-
return /* @__PURE__ */ P(l.Provider, { value: f, children: S });
|
|
34
|
-
}, "Provider");
|
|
35
|
-
d.displayName = u + "Provider";
|
|
36
|
-
function v(x, m, S = {}) {
|
|
37
|
-
const { optional: C = !1 } = S, l = m?.[e]?.[n] || o, f = p.useContext(l);
|
|
38
|
-
if (f) return f;
|
|
39
|
-
if (t !== void 0) return t;
|
|
40
|
-
if (!C)
|
|
41
|
-
throw new Error(`\`${x}\` must be used within \`${u}\``);
|
|
42
|
-
}
|
|
43
|
-
return r(v, "useContext"), [d, v];
|
|
44
|
-
}
|
|
45
|
-
r(a, "createContext");
|
|
46
|
-
const i = /* @__PURE__ */ r(() => {
|
|
47
|
-
const u = s.map((t) => p.createContext(t));
|
|
48
|
-
return /* @__PURE__ */ r(function(o) {
|
|
49
|
-
const n = o?.[e] || u;
|
|
50
|
-
return p.useMemo(
|
|
51
|
-
() => ({ [`__scope${e}`]: { ...o, [e]: n } }),
|
|
52
|
-
[o, n]
|
|
53
|
-
);
|
|
54
|
-
}, "useScope");
|
|
55
|
-
}, "createScope");
|
|
56
|
-
return i.scopeName = e, [a, _(i, ...c)];
|
|
57
|
-
}
|
|
58
|
-
r($, "createContextScope");
|
|
59
|
-
function _(...e) {
|
|
60
|
-
const c = e[0];
|
|
61
|
-
if (e.length === 1) return c;
|
|
62
|
-
const s = /* @__PURE__ */ r(() => {
|
|
63
|
-
const a = e.map((i) => ({
|
|
64
|
-
useScope: i(),
|
|
65
|
-
scopeName: i.scopeName
|
|
66
|
-
}));
|
|
67
|
-
return /* @__PURE__ */ r(function(u) {
|
|
68
|
-
const t = a.reduce((o, { useScope: n, scopeName: d }) => {
|
|
69
|
-
const x = n(u)[`__scope${d}`];
|
|
70
|
-
return { ...o, ...x };
|
|
71
|
-
}, {});
|
|
72
|
-
return p.useMemo(() => ({ [`__scope${c.scopeName}`]: t }), [t]);
|
|
73
|
-
}, "useComposedScopes");
|
|
74
|
-
}, "createScope");
|
|
75
|
-
return s.scopeName = c.scopeName, s;
|
|
76
|
-
}
|
|
77
|
-
r(_, "composeContextScopes");
|
|
78
|
-
export {
|
|
79
|
-
b as createContext,
|
|
80
|
-
$ as createContextScope
|
|
81
|
-
};
|
|
82
|
-
//# sourceMappingURL=index.es.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../../../../../../../../node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-context/dist/index.mjs"],"sourcesContent":["var __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/create-context.tsx\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\n// @__NO_SIDE_EFFECTS__\nfunction createContext2(rootComponentName, defaultContext) {\n const Context = React.createContext(defaultContext);\n Context.displayName = rootComponentName + \"Context\";\n const Provider = /* @__PURE__ */ __name((props) => {\n const { children, ...context } = props;\n const value = React.useMemo(() => context, Object.values(context));\n return /* @__PURE__ */ jsx(Context.Provider, { value, children });\n }, \"Provider\");\n Provider.displayName = rootComponentName + \"Provider\";\n function useContext2(consumerName, options = {}) {\n const { optional = false } = options;\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== void 0) return defaultContext;\n if (optional) return void 0;\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n __name(useContext2, \"useContext\");\n return [Provider, useContext2];\n}\n__name(createContext2, \"createContext\");\n// @__NO_SIDE_EFFECTS__\nfunction createContextScope(scopeName, createContextScopeDeps = []) {\n let defaultContexts = [];\n function createContext3(rootComponentName, defaultContext) {\n const BaseContext = React.createContext(defaultContext);\n BaseContext.displayName = rootComponentName + \"Context\";\n const index = defaultContexts.length;\n defaultContexts = [...defaultContexts, defaultContext];\n const Provider = /* @__PURE__ */ __name((props) => {\n const { scope, children, ...context } = props;\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n const value = React.useMemo(() => context, Object.values(context));\n return /* @__PURE__ */ jsx(Context.Provider, { value, children });\n }, \"Provider\");\n Provider.displayName = rootComponentName + \"Provider\";\n function useContext2(consumerName, scope, options = {}) {\n const { optional = false } = options;\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== void 0) return defaultContext;\n if (optional) return void 0;\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n __name(useContext2, \"useContext\");\n return [Provider, useContext2];\n }\n __name(createContext3, \"createContext\");\n const createScope = /* @__PURE__ */ __name(() => {\n const scopeContexts = defaultContexts.map((defaultContext) => {\n return React.createContext(defaultContext);\n });\n return /* @__PURE__ */ __name(function useScope(scope) {\n const contexts = scope?.[scopeName] || scopeContexts;\n return React.useMemo(\n () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),\n [scope, contexts]\n );\n }, \"useScope\");\n }, \"createScope\");\n createScope.scopeName = scopeName;\n return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];\n}\n__name(createContextScope, \"createContextScope\");\nfunction composeContextScopes(...scopes) {\n const baseScope = scopes[0];\n if (scopes.length === 1) return baseScope;\n const createScope = /* @__PURE__ */ __name(() => {\n const scopeHooks = scopes.map((createScope2) => ({\n useScope: createScope2(),\n scopeName: createScope2.scopeName\n }));\n return /* @__PURE__ */ __name(function useComposedScopes(overrideScopes) {\n const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {\n const scopeProps = useScope(overrideScopes);\n const currentScope = scopeProps[`__scope${scopeName}`];\n return { ...nextScopes2, ...currentScope };\n }, {});\n return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);\n }, \"useComposedScopes\");\n }, \"createScope\");\n createScope.scopeName = baseScope.scopeName;\n return createScope;\n}\n__name(composeContextScopes, \"composeContextScopes\");\nexport {\n createContext2 as createContext,\n createContextScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["__defProp","__name","target","value","createContext2","rootComponentName","defaultContext","Context","React","Provider","props","children","context","jsx","useContext2","consumerName","options","optional","createContextScope","scopeName","createContextScopeDeps","defaultContexts","createContext3","BaseContext","index","scope","createScope","scopeContexts","contexts","composeContextScopes","scopes","baseScope","scopeHooks","createScope2","overrideScopes","nextScopes","nextScopes2","useScope","currentScope"],"mappings":";;AAAA,IAAIA,IAAY,OAAO,gBACnBC,IAAS,CAACC,GAAQC,MAAUH,EAAUE,GAAQ,QAAQ,EAAE,OAAAC,GAAO,cAAc,IAAM;AAAA;AAMvF,SAASC,EAAeC,GAAmBC,GAAgB;AACzD,QAAMC,IAAUC,EAAM,cAAcF,CAAc;AAClD,EAAAC,EAAQ,cAAcF,IAAoB;AAC1C,QAAMI,IAA2B,gBAAAR,EAAO,CAACS,MAAU;AACjD,UAAM,EAAE,UAAAC,GAAU,GAAGC,EAAO,IAAKF,GAC3BP,IAAQK,EAAM,QAAQ,MAAMI,GAAS,OAAO,OAAOA,CAAO,CAAC;AACjE,WAAuB,gBAAAC,EAAIN,EAAQ,UAAU,EAAE,OAAAJ,GAAO,UAAAQ,EAAQ,CAAE;AAAA,EAClE,GAAG,UAAU;AACb,EAAAF,EAAS,cAAcJ,IAAoB;AAC3C,WAASS,EAAYC,GAAcC,IAAU,IAAI;AAC/C,UAAM,EAAE,UAAAC,IAAW,GAAK,IAAKD,GACvBJ,IAAUJ,EAAM,WAAWD,CAAO;AACxC,QAAIK,EAAS,QAAOA;AACpB,QAAIN,MAAmB,OAAQ,QAAOA;AACtC,QAAI,CAAAW;AACJ,YAAM,IAAI,MAAM,KAAKF,CAAY,4BAA4BV,CAAiB,IAAI;AAAA,EACpF;AACA,SAAAJ,EAAOa,GAAa,YAAY,GACzB,CAACL,GAAUK,CAAW;AAC/B;AACAb,EAAOG,GAAgB,eAAe;AAAA;AAEtC,SAASc,EAAmB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AAQN,CAAS,KAAKQ;AACvC,aAAOnB,EAAM;AAAA,QACX,OAAO,EAAE,CAAC,UAAUW,CAAS,EAAE,GAAG,EAAE,GAAGM,GAAO,CAACN,CAAS,GAAGS,EAAQ;QACnE,CAACH,GAAOG,CAAQ;AAAA,MACxB;AAAA,IACI,GAAG,UAAU;AAAA,EACf,GAAG,aAAa;AAChB,SAAAF,EAAY,YAAYP,GACjB,CAACG,GAAgBO,EAAqBH,GAAa,GAAGN,CAAsB,CAAC;AACtF;AACAnB,EAAOiB,GAAoB,oBAAoB;AAC/C,SAASW,KAAwBC,GAAQ;AACvC,QAAMC,IAAYD,EAAO,CAAC;AAC1B,MAAIA,EAAO,WAAW,EAAG,QAAOC;AAChC,QAAML,IAA8B,gBAAAzB,EAAO,MAAM;AAC/C,UAAM+B,IAAaF,EAAO,IAAI,CAACG,OAAkB;AAAA,MAC/C,UAAUA,EAAY;AAAA,MACtB,WAAWA,EAAa;AAAA,IAC9B,EAAM;AACF,WAAuB,gBAAAhC,EAAO,SAA2BiC,GAAgB;AACvE,YAAMC,IAAaH,EAAW,OAAO,CAACI,GAAa,EAAE,UAAAC,GAAU,WAAAlB,QAAgB;AAE7E,cAAMmB,IADaD,EAASH,CAAc,EACV,UAAUf,CAAS,EAAE;AACrD,eAAO,EAAE,GAAGiB,GAAa,GAAGE,EAAY;AAAA,MAC1C,GAAG,CAAA,CAAE;AACL,aAAO9B,EAAM,QAAQ,OAAO,EAAE,CAAC,UAAUuB,EAAU,SAAS,EAAE,GAAGI,EAAU,IAAK,CAACA,CAAU,CAAC;AAAA,IAC9F,GAAG,mBAAmB;AAAA,EACxB,GAAG,aAAa;AAChB,SAAAT,EAAY,YAAYK,EAAU,WAC3BL;AACT;AACAzB,EAAO4B,GAAsB,sBAAsB;","x_google_ignoreList":[0]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const K=require("react"),g=require("../../primitive/dist/index.cjs"),U=require("../../react-primitive/dist/index.cjs"),X=require("../../../../../react-compose-refs/dist/index.cjs"),k=require("../../react-use-callback-ref/dist/index.cjs"),G=require("react/jsx-runtime");function J(s){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const e in s)if(e!=="default"){const c=Object.getOwnPropertyDescriptor(s,e);Object.defineProperty(t,e,c.get?c:{enumerable:!0,get:()=>s[e]})}}return t.default=s,Object.freeze(t)}const r=J(K);var Q=Object.defineProperty,u=(s,t)=>Q(s,"name",{value:t,configurable:!0}),I="dismissableLayer.update",V="dismissableLayer.pointerDownOutside",Y="dismissableLayer.focusOutside",N,j=r.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),A=r.forwardRef(u(function(t,e){const{disableOutsidePointerEvents:c=!1,deferPointerDownOutside:d=!1,onEscapeKeyDown:f,onPointerDownOutside:h,onFocusOutside:y,onInteractOutside:E,onDismiss:v,...b}=t,n=r.useContext(j),[a,P]=r.useState(null),l=a?.ownerDocument??globalThis?.document,[,O]=r.useState({}),w=X.useComposedRefs(e,P),p=Array.from(n.layers),[C]=[...n.layersWithOutsidePointerEventsDisabled].slice(-1),i=C?p.indexOf(C):-1,m=a?p.indexOf(a):-1,L=n.layersWithOutsidePointerEventsDisabled.size>0,D=m>=i,F=r.useRef(!1),$=H(o=>{h?.(o),E?.(o),o.defaultPrevented||v?.()},{ownerDocument:l,deferPointerDownOutside:d,isDeferredPointerDownOutsideRef:F,dismissableSurfaces:n.dismissableSurfaces,shouldHandlePointerDownOutside:r.useCallback(o=>{if(!(o instanceof Node))return!1;const S=[...n.branches].some(W=>W.contains(o));return D&&!S},[n.branches,D])}),B=z(o=>{if(d&&F.current)return;const S=o.target;[...n.branches].some(M=>M.contains(S))||(y?.(o),E?.(o),o.defaultPrevented||v?.())},l),_=a?m===p.length-1:!1,R=k.useCallbackRef(o=>{o.key==="Escape"&&(f?.(o),!o.defaultPrevented&&v&&(o.preventDefault(),v()))});return r.useEffect(()=>{if(_)return l.addEventListener("keydown",R,{capture:!0}),()=>l.removeEventListener("keydown",R,{capture:!0})},[l,_,R]),r.useEffect(()=>{if(a)return c&&(n.layersWithOutsidePointerEventsDisabled.size===0&&(N=l.body.style.pointerEvents,l.body.style.pointerEvents="none"),n.layersWithOutsidePointerEventsDisabled.add(a)),n.layers.add(a),T(),()=>{c&&(n.layersWithOutsidePointerEventsDisabled.delete(a),n.layersWithOutsidePointerEventsDisabled.size===0&&(l.body.style.pointerEvents=N))}},[a,l,c,n]),r.useEffect(()=>()=>{a&&(n.layers.delete(a),n.layersWithOutsidePointerEventsDisabled.delete(a),T())},[a,n]),r.useEffect(()=>{const o=u(()=>O({}),"handleUpdate");return document.addEventListener(I,o),()=>document.removeEventListener(I,o)},[]),G.jsx(U.Primitive.div,{...b,ref:w,style:{pointerEvents:L?D?"auto":"none":void 0,...t.style},onFocusCapture:g.composeEventHandlers(t.onFocusCapture,B.onFocusCapture),onBlurCapture:g.composeEventHandlers(t.onBlurCapture,B.onBlurCapture),onPointerDownCapture:g.composeEventHandlers(t.onPointerDownCapture,$.onPointerDownCapture)})},"DismissableLayer"));function q(){const s=r.useContext(j),[t,e]=r.useState(null);return r.useEffect(()=>{if(t)return s.dismissableSurfaces.add(t),()=>{s.dismissableSurfaces.delete(t)}},[t,s.dismissableSurfaces]),e}u(q,"useDismissableLayerSurface");var Z=u(()=>!0,"IS_TRUE");function H(s,t){const{ownerDocument:e=globalThis?.document,deferPointerDownOutside:c=!1,isDeferredPointerDownOutsideRef:d,dismissableSurfaces:f,shouldHandlePointerDownOutside:h=Z}=t,y=k.useCallbackRef(s),E=r.useRef(!1),v=r.useRef(!1),b=r.useRef(new Map),n=r.useRef(()=>{});return r.useEffect(()=>{function a(){v.current=!1,d.current=!1,b.current.clear()}u(a,"resetOutsideInteraction");function P(){return Array.from(b.current.values()).some(Boolean)}u(P,"isOutsideInteractionIntercepted");function l(i){if(!v.current)return;const m=i.target;m instanceof Node&&[...f].some(D=>D.contains(m))||b.current.set(i.type,!0),i.type==="click"&&window.setTimeout(()=>{v.current&&n.current()},0)}u(l,"handleInteractionCapture");function O(i){v.current&&b.current.set(i.type,!1)}u(O,"handleInteractionBubble");const w=u(i=>{if(i.target&&!E.current){let m=function(){e.removeEventListener("click",n.current);const D=P();a(),D||x(V,y,L,{discrete:!0})};if(u(m,"handleAndDispatchPointerDownOutsideEvent"),!h(i.target)){e.removeEventListener("click",n.current),a(),E.current=!1;return}const L={originalEvent:i};v.current=!0,d.current=c&&i.button===0,b.current.clear(),!c||i.button!==0?m():(e.removeEventListener("click",n.current),n.current=m,e.addEventListener("click",n.current,{once:!0}))}else e.removeEventListener("click",n.current),a();E.current=!1},"handlePointerDown"),p=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const i of p)e.addEventListener(i,l,!0),e.addEventListener(i,O);const C=window.setTimeout(()=>{e.addEventListener("pointerdown",w)},0);return()=>{window.clearTimeout(C),e.removeEventListener("pointerdown",w),e.removeEventListener("click",n.current);for(const i of p)e.removeEventListener(i,l,!0),e.removeEventListener(i,O)}},[e,y,c,d,f,h]),{onPointerDownCapture:u(()=>E.current=!0,"onPointerDownCapture")}}u(H,"usePointerDownOutside");function z(s,t=globalThis?.document){const e=k.useCallbackRef(s),c=r.useRef(!1);return r.useEffect(()=>{const d=u(f=>{f.target&&!c.current&&x(Y,e,{originalEvent:f},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",d),()=>t.removeEventListener("focusin",d)},[t,e]),{onFocusCapture:u(()=>c.current=!0,"onFocusCapture"),onBlurCapture:u(()=>c.current=!1,"onBlurCapture")}}u(z,"useFocusOutside");function T(){const s=new CustomEvent(I);document.dispatchEvent(s)}u(T,"dispatchUpdate");function x(s,t,e,{discrete:c}){const d=e.originalEvent.target,f=new CustomEvent(s,{bubbles:!1,cancelable:!0,detail:e});t&&d.addEventListener(s,t,{once:!0}),c?U.dispatchDiscreteCustomEvent(d,f):d.dispatchEvent(f)}u(x,"handleAndDispatchCustomEvent");exports.DismissableLayer=A;exports.Root=A;exports.useDismissableLayerSurface=q;
|
|
2
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../../../../../node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs"],"sourcesContent":["\"use client\";\nvar __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/dismissable-layer.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { Primitive, dispatchDiscreteCustomEvent } from \"@radix-ui/react-primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { jsx } from \"react/jsx-runtime\";\nvar CONTEXT_UPDATE = \"dismissableLayer.update\";\nvar POINTER_DOWN_OUTSIDE = \"dismissableLayer.pointerDownOutside\";\nvar FOCUS_OUTSIDE = \"dismissableLayer.focusOutside\";\nvar originalBodyPointerEvents;\nvar DismissableLayerContext = React.createContext({\n layers: /* @__PURE__ */ new Set(),\n layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),\n branches: /* @__PURE__ */ new Set(),\n // Outside elements that belong to a layer's own dismiss affordance (eg, a\n // dialog overlay). Pressing them should dismiss the layer regardless of\n // whether or not they stop propagation.\n //\n // See https://github.com/radix-ui/primitives/issues/3346\n dismissableSurfaces: /* @__PURE__ */ new Set()\n});\nvar DismissableLayer = /* @__PURE__ */ React.forwardRef(\n // blank line to reduce diff noise\n /* @__PURE__ */ __name(function DismissableLayer2(props, forwardedRef) {\n const {\n disableOutsidePointerEvents = false,\n deferPointerDownOutside = false,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n ...layerProps\n } = props;\n const context = React.useContext(DismissableLayerContext);\n const [node, setNode] = React.useState(null);\n const ownerDocument = node?.ownerDocument ?? globalThis?.document;\n const [, force] = React.useState({});\n const composedRefs = useComposedRefs(forwardedRef, setNode);\n const layers = Array.from(context.layers);\n const [highestLayerWithOutsidePointerEventsDisabled] = [\n ...context.layersWithOutsidePointerEventsDisabled\n ].slice(-1);\n const highestLayerWithOutsidePointerEventsDisabledIndex = highestLayerWithOutsidePointerEventsDisabled ? layers.indexOf(highestLayerWithOutsidePointerEventsDisabled) : -1;\n const index = node ? layers.indexOf(node) : -1;\n const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;\n const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;\n const isDeferredPointerDownOutsideRef = React.useRef(false);\n const pointerDownOutside = usePointerDownOutside(\n (event) => {\n onPointerDownOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n },\n {\n ownerDocument,\n deferPointerDownOutside,\n isDeferredPointerDownOutsideRef,\n dismissableSurfaces: context.dismissableSurfaces,\n shouldHandlePointerDownOutside: React.useCallback(\n (target) => {\n if (!(target instanceof Node)) {\n return false;\n }\n const isPointerDownOnBranch = [...context.branches].some(\n (branch) => branch.contains(target)\n );\n return isPointerEventsEnabled && !isPointerDownOnBranch;\n },\n [context.branches, isPointerEventsEnabled]\n )\n }\n );\n const focusOutside = useFocusOutside((event) => {\n if (deferPointerDownOutside && isDeferredPointerDownOutsideRef.current) {\n return;\n }\n const target = event.target;\n const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));\n if (isFocusInBranch) return;\n onFocusOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n const isHighestLayer = node ? index === layers.length - 1 : false;\n const handleKeyDown = useCallbackRef((event) => {\n if (event.key !== \"Escape\") {\n return;\n }\n onEscapeKeyDown?.(event);\n if (!event.defaultPrevented && onDismiss) {\n event.preventDefault();\n onDismiss();\n }\n });\n React.useEffect(() => {\n if (!isHighestLayer) {\n return;\n }\n ownerDocument.addEventListener(\"keydown\", handleKeyDown, { capture: true });\n return () => ownerDocument.removeEventListener(\"keydown\", handleKeyDown, { capture: true });\n }, [ownerDocument, isHighestLayer, handleKeyDown]);\n React.useEffect(() => {\n if (!node) return;\n if (disableOutsidePointerEvents) {\n if (context.layersWithOutsidePointerEventsDisabled.size === 0) {\n originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;\n ownerDocument.body.style.pointerEvents = \"none\";\n }\n context.layersWithOutsidePointerEventsDisabled.add(node);\n }\n context.layers.add(node);\n dispatchUpdate();\n return () => {\n if (disableOutsidePointerEvents) {\n context.layersWithOutsidePointerEventsDisabled.delete(node);\n if (context.layersWithOutsidePointerEventsDisabled.size === 0) {\n ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;\n }\n }\n };\n }, [node, ownerDocument, disableOutsidePointerEvents, context]);\n React.useEffect(() => {\n return () => {\n if (!node) return;\n context.layers.delete(node);\n context.layersWithOutsidePointerEventsDisabled.delete(node);\n dispatchUpdate();\n };\n }, [node, context]);\n React.useEffect(() => {\n const handleUpdate = /* @__PURE__ */ __name(() => force({}), \"handleUpdate\");\n document.addEventListener(CONTEXT_UPDATE, handleUpdate);\n return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);\n }, []);\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n ...layerProps,\n ref: composedRefs,\n style: {\n pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? \"auto\" : \"none\" : void 0,\n ...props.style\n },\n onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),\n onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),\n onPointerDownCapture: composeEventHandlers(\n props.onPointerDownCapture,\n pointerDownOutside.onPointerDownCapture\n )\n }\n );\n }, \"DismissableLayer\")\n);\nvar DismissableLayerBranch = /* @__PURE__ */ React.forwardRef(/* @__PURE__ */ __name(function DismissableLayerBranch2(props, forwardedRef) {\n const context = React.useContext(DismissableLayerContext);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n context.branches.add(node);\n return () => {\n context.branches.delete(node);\n };\n }\n }, [context.branches]);\n return /* @__PURE__ */ jsx(Primitive.div, { ...props, ref: composedRefs });\n}, \"DismissableLayerBranch\"));\nfunction useDismissableLayerSurface() {\n const context = React.useContext(DismissableLayerContext);\n const [node, setNode] = React.useState(null);\n React.useEffect(() => {\n if (!node) {\n return;\n }\n context.dismissableSurfaces.add(node);\n return () => {\n context.dismissableSurfaces.delete(node);\n };\n }, [node, context.dismissableSurfaces]);\n return setNode;\n}\n__name(useDismissableLayerSurface, \"useDismissableLayerSurface\");\nvar IS_TRUE = /* @__PURE__ */ __name(() => true, \"IS_TRUE\");\nfunction usePointerDownOutside(onPointerDownOutside, args) {\n const {\n ownerDocument = globalThis?.document,\n deferPointerDownOutside = false,\n isDeferredPointerDownOutsideRef,\n dismissableSurfaces,\n shouldHandlePointerDownOutside = IS_TRUE\n } = args;\n const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);\n const isPointerInsideReactTreeRef = React.useRef(false);\n const isPointerDownOutsideRef = React.useRef(false);\n const interceptedOutsideInteractionEventsRef = React.useRef(/* @__PURE__ */ new Map());\n const handleClickRef = React.useRef(() => {\n });\n React.useEffect(() => {\n function resetOutsideInteraction() {\n isPointerDownOutsideRef.current = false;\n isDeferredPointerDownOutsideRef.current = false;\n interceptedOutsideInteractionEventsRef.current.clear();\n }\n __name(resetOutsideInteraction, \"resetOutsideInteraction\");\n function isOutsideInteractionIntercepted() {\n return Array.from(interceptedOutsideInteractionEventsRef.current.values()).some(Boolean);\n }\n __name(isOutsideInteractionIntercepted, \"isOutsideInteractionIntercepted\");\n function handleInteractionCapture(event) {\n if (!isPointerDownOutsideRef.current) {\n return;\n }\n const target = event.target;\n const isDismissableSurface = target instanceof Node && [...dismissableSurfaces].some((surface) => surface.contains(target));\n if (!isDismissableSurface) {\n interceptedOutsideInteractionEventsRef.current.set(event.type, true);\n }\n if (event.type === \"click\") {\n window.setTimeout(() => {\n if (isPointerDownOutsideRef.current) {\n handleClickRef.current();\n }\n }, 0);\n }\n }\n __name(handleInteractionCapture, \"handleInteractionCapture\");\n function handleInteractionBubble(event) {\n if (isPointerDownOutsideRef.current) {\n interceptedOutsideInteractionEventsRef.current.set(event.type, false);\n }\n }\n __name(handleInteractionBubble, \"handleInteractionBubble\");\n const handlePointerDown = /* @__PURE__ */ __name((event) => {\n if (event.target && !isPointerInsideReactTreeRef.current) {\n let handleAndDispatchPointerDownOutsideEvent2 = function() {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n const wasOutsideInteractionIntercepted = isOutsideInteractionIntercepted();\n resetOutsideInteraction();\n if (!wasOutsideInteractionIntercepted) {\n handleAndDispatchCustomEvent(\n POINTER_DOWN_OUTSIDE,\n handlePointerDownOutside,\n eventDetail,\n { discrete: true }\n );\n }\n };\n var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2;\n __name(handleAndDispatchPointerDownOutsideEvent2, \"handleAndDispatchPointerDownOutsideEvent\");\n if (!shouldHandlePointerDownOutside(event.target)) {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n resetOutsideInteraction();\n isPointerInsideReactTreeRef.current = false;\n return;\n }\n const eventDetail = { originalEvent: event };\n isPointerDownOutsideRef.current = true;\n isDeferredPointerDownOutsideRef.current = deferPointerDownOutside && event.button === 0;\n interceptedOutsideInteractionEventsRef.current.clear();\n if (!deferPointerDownOutside || event.button !== 0) {\n handleAndDispatchPointerDownOutsideEvent2();\n } else {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;\n ownerDocument.addEventListener(\"click\", handleClickRef.current, { once: true });\n }\n } else {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n resetOutsideInteraction();\n }\n isPointerInsideReactTreeRef.current = false;\n }, \"handlePointerDown\");\n const outsideInteractionEvents = [\n \"pointerup\",\n \"mousedown\",\n \"mouseup\",\n \"touchstart\",\n \"touchend\",\n \"click\"\n ];\n for (const eventName of outsideInteractionEvents) {\n ownerDocument.addEventListener(eventName, handleInteractionCapture, true);\n ownerDocument.addEventListener(eventName, handleInteractionBubble);\n }\n const timerId = window.setTimeout(() => {\n ownerDocument.addEventListener(\"pointerdown\", handlePointerDown);\n }, 0);\n return () => {\n window.clearTimeout(timerId);\n ownerDocument.removeEventListener(\"pointerdown\", handlePointerDown);\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n for (const eventName of outsideInteractionEvents) {\n ownerDocument.removeEventListener(eventName, handleInteractionCapture, true);\n ownerDocument.removeEventListener(eventName, handleInteractionBubble);\n }\n };\n }, [\n ownerDocument,\n handlePointerDownOutside,\n deferPointerDownOutside,\n isDeferredPointerDownOutsideRef,\n dismissableSurfaces,\n shouldHandlePointerDownOutside\n ]);\n return {\n // ensures we check React component tree (not just DOM tree)\n onPointerDownCapture: /* @__PURE__ */ __name(() => isPointerInsideReactTreeRef.current = true, \"onPointerDownCapture\")\n };\n}\n__name(usePointerDownOutside, \"usePointerDownOutside\");\nfunction useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {\n const handleFocusOutside = useCallbackRef(onFocusOutside);\n const isFocusInsideReactTreeRef = React.useRef(false);\n React.useEffect(() => {\n const handleFocus = /* @__PURE__ */ __name((event) => {\n if (event.target && !isFocusInsideReactTreeRef.current) {\n const eventDetail = { originalEvent: event };\n handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {\n discrete: false\n });\n }\n }, \"handleFocus\");\n ownerDocument.addEventListener(\"focusin\", handleFocus);\n return () => ownerDocument.removeEventListener(\"focusin\", handleFocus);\n }, [ownerDocument, handleFocusOutside]);\n return {\n onFocusCapture: /* @__PURE__ */ __name(() => isFocusInsideReactTreeRef.current = true, \"onFocusCapture\"),\n onBlurCapture: /* @__PURE__ */ __name(() => isFocusInsideReactTreeRef.current = false, \"onBlurCapture\")\n };\n}\n__name(useFocusOutside, \"useFocusOutside\");\nfunction dispatchUpdate() {\n const event = new CustomEvent(CONTEXT_UPDATE);\n document.dispatchEvent(event);\n}\n__name(dispatchUpdate, \"dispatchUpdate\");\nfunction handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {\n const target = detail.originalEvent.target;\n const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });\n if (handler) target.addEventListener(name, handler, { once: true });\n if (discrete) {\n dispatchDiscreteCustomEvent(target, event);\n } else {\n target.dispatchEvent(event);\n }\n}\n__name(handleAndDispatchCustomEvent, \"handleAndDispatchCustomEvent\");\nexport {\n DismissableLayerBranch as Branch,\n DismissableLayer,\n DismissableLayerBranch,\n DismissableLayer as Root,\n useDismissableLayerSurface\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["__defProp","__name","target","value","CONTEXT_UPDATE","POINTER_DOWN_OUTSIDE","FOCUS_OUTSIDE","originalBodyPointerEvents","DismissableLayerContext","React","DismissableLayer","props","forwardedRef","disableOutsidePointerEvents","deferPointerDownOutside","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","layerProps","context","node","setNode","ownerDocument","force","composedRefs","useComposedRefs","layers","highestLayerWithOutsidePointerEventsDisabled","highestLayerWithOutsidePointerEventsDisabledIndex","index","isBodyPointerEventsDisabled","isPointerEventsEnabled","isDeferredPointerDownOutsideRef","pointerDownOutside","usePointerDownOutside","event","isPointerDownOnBranch","branch","focusOutside","useFocusOutside","isHighestLayer","handleKeyDown","useCallbackRef","dispatchUpdate","handleUpdate","jsx","Primitive","composeEventHandlers","useDismissableLayerSurface","IS_TRUE","args","dismissableSurfaces","shouldHandlePointerDownOutside","handlePointerDownOutside","isPointerInsideReactTreeRef","isPointerDownOutsideRef","interceptedOutsideInteractionEventsRef","handleClickRef","resetOutsideInteraction","isOutsideInteractionIntercepted","handleInteractionCapture","surface","handleInteractionBubble","handlePointerDown","handleAndDispatchPointerDownOutsideEvent2","wasOutsideInteractionIntercepted","handleAndDispatchCustomEvent","eventDetail","outsideInteractionEvents","eventName","timerId","handleFocusOutside","isFocusInsideReactTreeRef","handleFocus","name","handler","detail","discrete","dispatchDiscreteCustomEvent"],"mappings":"unBACA,IAAIA,EAAY,OAAO,eACnBC,EAAS,CAACC,EAAQC,IAAUH,EAAUE,EAAQ,OAAQ,CAAE,MAAAC,EAAO,aAAc,GAAM,EASnFC,EAAiB,0BACjBC,EAAuB,sCACvBC,EAAgB,gCAChBC,EACAC,EAA0BC,EAAM,cAAc,CAChD,OAAwB,IAAI,IAC5B,uCAAwD,IAAI,IAC5D,SAA0B,IAAI,IAM9B,oBAAqC,IAAI,GAC3C,CAAC,EACGC,EAAmCD,EAAM,WAE3BR,EAAO,SAA2BU,EAAOC,EAAc,CACrE,KAAM,CACJ,4BAAAC,EAA8B,GAC9B,wBAAAC,EAA0B,GAC1B,gBAAAC,EACA,qBAAAC,EACA,eAAAC,EACA,kBAAAC,EACA,UAAAC,EACA,GAAGC,CACT,EAAQT,EACEU,EAAUZ,EAAM,WAAWD,CAAuB,EAClD,CAACc,EAAMC,CAAO,EAAId,EAAM,SAAS,IAAI,EACrCe,EAAgBF,GAAM,eAAiB,YAAY,SACnD,CAAA,CAAGG,CAAK,EAAIhB,EAAM,SAAS,CAAA,CAAE,EAC7BiB,EAAeC,EAAAA,gBAAgBf,EAAcW,CAAO,EACpDK,EAAS,MAAM,KAAKP,EAAQ,MAAM,EAClC,CAACQ,CAA4C,EAAI,CACrD,GAAGR,EAAQ,sCACjB,EAAM,MAAM,EAAE,EACJS,EAAoDD,EAA+CD,EAAO,QAAQC,CAA4C,EAAI,GAClKE,EAAQT,EAAOM,EAAO,QAAQN,CAAI,EAAI,GACtCU,EAA8BX,EAAQ,uCAAuC,KAAO,EACpFY,EAAyBF,GAASD,EAClCI,EAAkCzB,EAAM,OAAO,EAAK,EACpD0B,EAAqBC,EACxBC,GAAU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AAQ,IAAI,YAAYuC,EAAM,CAAE,QAAS,GAAO,WAAY,GAAM,OAAAE,EAAQ,EAC5ED,GAAS3E,EAAO,iBAAiB0E,EAAMC,EAAS,CAAE,KAAM,GAAM,EAC9DE,EACFC,EAAAA,4BAA4B9E,EAAQmC,CAAK,EAEzCnC,EAAO,cAAcmC,CAAK,CAE9B,CACApC,EAAOmE,EAA8B,8BAA8B","x_google_ignoreList":[0]}
|
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
import * as s from "react";
|
|
2
|
-
import { composeEventHandlers as S } from "../../primitive/dist/index.es.js";
|
|
3
|
-
import { Primitive as K, dispatchDiscreteCustomEvent as M } from "../../react-primitive/dist/index.es.js";
|
|
4
|
-
import { useComposedRefs as X } from "../../../../../react-compose-refs/dist/index.es.js";
|
|
5
|
-
import { useCallbackRef as F } from "../../react-use-callback-ref/dist/index.es.js";
|
|
6
|
-
import { jsx as q } from "react/jsx-runtime";
|
|
7
|
-
var G = Object.defineProperty, a = (u, n) => G(u, "name", { value: n, configurable: !0 }), g = "dismissableLayer.update", J = "dismissableLayer.pointerDownOutside", Q = "dismissableLayer.focusOutside", _, N = s.createContext({
|
|
8
|
-
layers: /* @__PURE__ */ new Set(),
|
|
9
|
-
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
10
|
-
branches: /* @__PURE__ */ new Set(),
|
|
11
|
-
// Outside elements that belong to a layer's own dismiss affordance (eg, a
|
|
12
|
-
// dialog overlay). Pressing them should dismiss the layer regardless of
|
|
13
|
-
// whether or not they stop propagation.
|
|
14
|
-
//
|
|
15
|
-
// See https://github.com/radix-ui/primitives/issues/3346
|
|
16
|
-
dismissableSurfaces: /* @__PURE__ */ new Set()
|
|
17
|
-
}), se = /* @__PURE__ */ s.forwardRef(
|
|
18
|
-
// blank line to reduce diff noise
|
|
19
|
-
/* @__PURE__ */ a(function(n, t) {
|
|
20
|
-
const {
|
|
21
|
-
disableOutsidePointerEvents: c = !1,
|
|
22
|
-
deferPointerDownOutside: d = !1,
|
|
23
|
-
onEscapeKeyDown: f,
|
|
24
|
-
onPointerDownOutside: b,
|
|
25
|
-
onFocusOutside: y,
|
|
26
|
-
onInteractOutside: E,
|
|
27
|
-
onDismiss: m,
|
|
28
|
-
...D
|
|
29
|
-
} = n, e = s.useContext(N), [o, w] = s.useState(null), l = o?.ownerDocument ?? globalThis?.document, [, O] = s.useState({}), P = X(t, w), h = Array.from(e.layers), [C] = [
|
|
30
|
-
...e.layersWithOutsidePointerEventsDisabled
|
|
31
|
-
].slice(-1), r = C ? h.indexOf(C) : -1, v = o ? h.indexOf(o) : -1, L = e.layersWithOutsidePointerEventsDisabled.size > 0, p = v >= r, B = s.useRef(!1), z = A(
|
|
32
|
-
(i) => {
|
|
33
|
-
b?.(i), E?.(i), i.defaultPrevented || m?.();
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
ownerDocument: l,
|
|
37
|
-
deferPointerDownOutside: d,
|
|
38
|
-
isDeferredPointerDownOutsideRef: B,
|
|
39
|
-
dismissableSurfaces: e.dismissableSurfaces,
|
|
40
|
-
shouldHandlePointerDownOutside: s.useCallback(
|
|
41
|
-
(i) => {
|
|
42
|
-
if (!(i instanceof Node))
|
|
43
|
-
return !1;
|
|
44
|
-
const R = [...e.branches].some(
|
|
45
|
-
(U) => U.contains(i)
|
|
46
|
-
);
|
|
47
|
-
return p && !R;
|
|
48
|
-
},
|
|
49
|
-
[e.branches, p]
|
|
50
|
-
)
|
|
51
|
-
}
|
|
52
|
-
), x = H((i) => {
|
|
53
|
-
if (d && B.current)
|
|
54
|
-
return;
|
|
55
|
-
const R = i.target;
|
|
56
|
-
[...e.branches].some((j) => j.contains(R)) || (y?.(i), E?.(i), i.defaultPrevented || m?.());
|
|
57
|
-
}, l), W = o ? v === h.length - 1 : !1, I = F((i) => {
|
|
58
|
-
i.key === "Escape" && (f?.(i), !i.defaultPrevented && m && (i.preventDefault(), m()));
|
|
59
|
-
});
|
|
60
|
-
return s.useEffect(() => {
|
|
61
|
-
if (W)
|
|
62
|
-
return l.addEventListener("keydown", I, { capture: !0 }), () => l.removeEventListener("keydown", I, { capture: !0 });
|
|
63
|
-
}, [l, W, I]), s.useEffect(() => {
|
|
64
|
-
if (o)
|
|
65
|
-
return c && (e.layersWithOutsidePointerEventsDisabled.size === 0 && (_ = l.body.style.pointerEvents, l.body.style.pointerEvents = "none"), e.layersWithOutsidePointerEventsDisabled.add(o)), e.layers.add(o), T(), () => {
|
|
66
|
-
c && (e.layersWithOutsidePointerEventsDisabled.delete(o), e.layersWithOutsidePointerEventsDisabled.size === 0 && (l.body.style.pointerEvents = _));
|
|
67
|
-
};
|
|
68
|
-
}, [o, l, c, e]), s.useEffect(() => () => {
|
|
69
|
-
o && (e.layers.delete(o), e.layersWithOutsidePointerEventsDisabled.delete(o), T());
|
|
70
|
-
}, [o, e]), s.useEffect(() => {
|
|
71
|
-
const i = /* @__PURE__ */ a(() => O({}), "handleUpdate");
|
|
72
|
-
return document.addEventListener(g, i), () => document.removeEventListener(g, i);
|
|
73
|
-
}, []), /* @__PURE__ */ q(
|
|
74
|
-
K.div,
|
|
75
|
-
{
|
|
76
|
-
...D,
|
|
77
|
-
ref: P,
|
|
78
|
-
style: {
|
|
79
|
-
pointerEvents: L ? p ? "auto" : "none" : void 0,
|
|
80
|
-
...n.style
|
|
81
|
-
},
|
|
82
|
-
onFocusCapture: S(n.onFocusCapture, x.onFocusCapture),
|
|
83
|
-
onBlurCapture: S(n.onBlurCapture, x.onBlurCapture),
|
|
84
|
-
onPointerDownCapture: S(
|
|
85
|
-
n.onPointerDownCapture,
|
|
86
|
-
z.onPointerDownCapture
|
|
87
|
-
)
|
|
88
|
-
}
|
|
89
|
-
);
|
|
90
|
-
}, "DismissableLayer")
|
|
91
|
-
);
|
|
92
|
-
function V() {
|
|
93
|
-
const u = s.useContext(N), [n, t] = s.useState(null);
|
|
94
|
-
return s.useEffect(() => {
|
|
95
|
-
if (n)
|
|
96
|
-
return u.dismissableSurfaces.add(n), () => {
|
|
97
|
-
u.dismissableSurfaces.delete(n);
|
|
98
|
-
};
|
|
99
|
-
}, [n, u.dismissableSurfaces]), t;
|
|
100
|
-
}
|
|
101
|
-
a(V, "useDismissableLayerSurface");
|
|
102
|
-
var Y = /* @__PURE__ */ a(() => !0, "IS_TRUE");
|
|
103
|
-
function A(u, n) {
|
|
104
|
-
const {
|
|
105
|
-
ownerDocument: t = globalThis?.document,
|
|
106
|
-
deferPointerDownOutside: c = !1,
|
|
107
|
-
isDeferredPointerDownOutsideRef: d,
|
|
108
|
-
dismissableSurfaces: f,
|
|
109
|
-
shouldHandlePointerDownOutside: b = Y
|
|
110
|
-
} = n, y = F(u), E = s.useRef(!1), m = s.useRef(!1), D = s.useRef(/* @__PURE__ */ new Map()), e = s.useRef(() => {
|
|
111
|
-
});
|
|
112
|
-
return s.useEffect(() => {
|
|
113
|
-
function o() {
|
|
114
|
-
m.current = !1, d.current = !1, D.current.clear();
|
|
115
|
-
}
|
|
116
|
-
a(o, "resetOutsideInteraction");
|
|
117
|
-
function w() {
|
|
118
|
-
return Array.from(D.current.values()).some(Boolean);
|
|
119
|
-
}
|
|
120
|
-
a(w, "isOutsideInteractionIntercepted");
|
|
121
|
-
function l(r) {
|
|
122
|
-
if (!m.current)
|
|
123
|
-
return;
|
|
124
|
-
const v = r.target;
|
|
125
|
-
v instanceof Node && [...f].some((p) => p.contains(v)) || D.current.set(r.type, !0), r.type === "click" && window.setTimeout(() => {
|
|
126
|
-
m.current && e.current();
|
|
127
|
-
}, 0);
|
|
128
|
-
}
|
|
129
|
-
a(l, "handleInteractionCapture");
|
|
130
|
-
function O(r) {
|
|
131
|
-
m.current && D.current.set(r.type, !1);
|
|
132
|
-
}
|
|
133
|
-
a(O, "handleInteractionBubble");
|
|
134
|
-
const P = /* @__PURE__ */ a((r) => {
|
|
135
|
-
if (r.target && !E.current) {
|
|
136
|
-
let v = function() {
|
|
137
|
-
t.removeEventListener("click", e.current);
|
|
138
|
-
const p = w();
|
|
139
|
-
o(), p || k(
|
|
140
|
-
J,
|
|
141
|
-
y,
|
|
142
|
-
L,
|
|
143
|
-
{ discrete: !0 }
|
|
144
|
-
);
|
|
145
|
-
};
|
|
146
|
-
if (a(v, "handleAndDispatchPointerDownOutsideEvent"), !b(r.target)) {
|
|
147
|
-
t.removeEventListener("click", e.current), o(), E.current = !1;
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
const L = { originalEvent: r };
|
|
151
|
-
m.current = !0, d.current = c && r.button === 0, D.current.clear(), !c || r.button !== 0 ? v() : (t.removeEventListener("click", e.current), e.current = v, t.addEventListener("click", e.current, { once: !0 }));
|
|
152
|
-
} else
|
|
153
|
-
t.removeEventListener("click", e.current), o();
|
|
154
|
-
E.current = !1;
|
|
155
|
-
}, "handlePointerDown"), h = [
|
|
156
|
-
"pointerup",
|
|
157
|
-
"mousedown",
|
|
158
|
-
"mouseup",
|
|
159
|
-
"touchstart",
|
|
160
|
-
"touchend",
|
|
161
|
-
"click"
|
|
162
|
-
];
|
|
163
|
-
for (const r of h)
|
|
164
|
-
t.addEventListener(r, l, !0), t.addEventListener(r, O);
|
|
165
|
-
const C = window.setTimeout(() => {
|
|
166
|
-
t.addEventListener("pointerdown", P);
|
|
167
|
-
}, 0);
|
|
168
|
-
return () => {
|
|
169
|
-
window.clearTimeout(C), t.removeEventListener("pointerdown", P), t.removeEventListener("click", e.current);
|
|
170
|
-
for (const r of h)
|
|
171
|
-
t.removeEventListener(r, l, !0), t.removeEventListener(r, O);
|
|
172
|
-
};
|
|
173
|
-
}, [
|
|
174
|
-
t,
|
|
175
|
-
y,
|
|
176
|
-
c,
|
|
177
|
-
d,
|
|
178
|
-
f,
|
|
179
|
-
b
|
|
180
|
-
]), {
|
|
181
|
-
// ensures we check React component tree (not just DOM tree)
|
|
182
|
-
onPointerDownCapture: /* @__PURE__ */ a(() => E.current = !0, "onPointerDownCapture")
|
|
183
|
-
};
|
|
184
|
-
}
|
|
185
|
-
a(A, "usePointerDownOutside");
|
|
186
|
-
function H(u, n = globalThis?.document) {
|
|
187
|
-
const t = F(u), c = s.useRef(!1);
|
|
188
|
-
return s.useEffect(() => {
|
|
189
|
-
const d = /* @__PURE__ */ a((f) => {
|
|
190
|
-
f.target && !c.current && k(Q, t, { originalEvent: f }, {
|
|
191
|
-
discrete: !1
|
|
192
|
-
});
|
|
193
|
-
}, "handleFocus");
|
|
194
|
-
return n.addEventListener("focusin", d), () => n.removeEventListener("focusin", d);
|
|
195
|
-
}, [n, t]), {
|
|
196
|
-
onFocusCapture: /* @__PURE__ */ a(() => c.current = !0, "onFocusCapture"),
|
|
197
|
-
onBlurCapture: /* @__PURE__ */ a(() => c.current = !1, "onBlurCapture")
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
a(H, "useFocusOutside");
|
|
201
|
-
function T() {
|
|
202
|
-
const u = new CustomEvent(g);
|
|
203
|
-
document.dispatchEvent(u);
|
|
204
|
-
}
|
|
205
|
-
a(T, "dispatchUpdate");
|
|
206
|
-
function k(u, n, t, { discrete: c }) {
|
|
207
|
-
const d = t.originalEvent.target, f = new CustomEvent(u, { bubbles: !1, cancelable: !0, detail: t });
|
|
208
|
-
n && d.addEventListener(u, n, { once: !0 }), c ? M(d, f) : d.dispatchEvent(f);
|
|
209
|
-
}
|
|
210
|
-
a(k, "handleAndDispatchCustomEvent");
|
|
211
|
-
export {
|
|
212
|
-
se as DismissableLayer,
|
|
213
|
-
se as Root,
|
|
214
|
-
V as useDismissableLayerSurface
|
|
215
|
-
};
|
|
216
|
-
//# sourceMappingURL=index.es.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../../../../../../../../node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs"],"sourcesContent":["\"use client\";\nvar __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/dismissable-layer.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { Primitive, dispatchDiscreteCustomEvent } from \"@radix-ui/react-primitive\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { jsx } from \"react/jsx-runtime\";\nvar CONTEXT_UPDATE = \"dismissableLayer.update\";\nvar POINTER_DOWN_OUTSIDE = \"dismissableLayer.pointerDownOutside\";\nvar FOCUS_OUTSIDE = \"dismissableLayer.focusOutside\";\nvar originalBodyPointerEvents;\nvar DismissableLayerContext = React.createContext({\n layers: /* @__PURE__ */ new Set(),\n layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),\n branches: /* @__PURE__ */ new Set(),\n // Outside elements that belong to a layer's own dismiss affordance (eg, a\n // dialog overlay). Pressing them should dismiss the layer regardless of\n // whether or not they stop propagation.\n //\n // See https://github.com/radix-ui/primitives/issues/3346\n dismissableSurfaces: /* @__PURE__ */ new Set()\n});\nvar DismissableLayer = /* @__PURE__ */ React.forwardRef(\n // blank line to reduce diff noise\n /* @__PURE__ */ __name(function DismissableLayer2(props, forwardedRef) {\n const {\n disableOutsidePointerEvents = false,\n deferPointerDownOutside = false,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n ...layerProps\n } = props;\n const context = React.useContext(DismissableLayerContext);\n const [node, setNode] = React.useState(null);\n const ownerDocument = node?.ownerDocument ?? globalThis?.document;\n const [, force] = React.useState({});\n const composedRefs = useComposedRefs(forwardedRef, setNode);\n const layers = Array.from(context.layers);\n const [highestLayerWithOutsidePointerEventsDisabled] = [\n ...context.layersWithOutsidePointerEventsDisabled\n ].slice(-1);\n const highestLayerWithOutsidePointerEventsDisabledIndex = highestLayerWithOutsidePointerEventsDisabled ? layers.indexOf(highestLayerWithOutsidePointerEventsDisabled) : -1;\n const index = node ? layers.indexOf(node) : -1;\n const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0;\n const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex;\n const isDeferredPointerDownOutsideRef = React.useRef(false);\n const pointerDownOutside = usePointerDownOutside(\n (event) => {\n onPointerDownOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n },\n {\n ownerDocument,\n deferPointerDownOutside,\n isDeferredPointerDownOutsideRef,\n dismissableSurfaces: context.dismissableSurfaces,\n shouldHandlePointerDownOutside: React.useCallback(\n (target) => {\n if (!(target instanceof Node)) {\n return false;\n }\n const isPointerDownOnBranch = [...context.branches].some(\n (branch) => branch.contains(target)\n );\n return isPointerEventsEnabled && !isPointerDownOnBranch;\n },\n [context.branches, isPointerEventsEnabled]\n )\n }\n );\n const focusOutside = useFocusOutside((event) => {\n if (deferPointerDownOutside && isDeferredPointerDownOutsideRef.current) {\n return;\n }\n const target = event.target;\n const isFocusInBranch = [...context.branches].some((branch) => branch.contains(target));\n if (isFocusInBranch) return;\n onFocusOutside?.(event);\n onInteractOutside?.(event);\n if (!event.defaultPrevented) onDismiss?.();\n }, ownerDocument);\n const isHighestLayer = node ? index === layers.length - 1 : false;\n const handleKeyDown = useCallbackRef((event) => {\n if (event.key !== \"Escape\") {\n return;\n }\n onEscapeKeyDown?.(event);\n if (!event.defaultPrevented && onDismiss) {\n event.preventDefault();\n onDismiss();\n }\n });\n React.useEffect(() => {\n if (!isHighestLayer) {\n return;\n }\n ownerDocument.addEventListener(\"keydown\", handleKeyDown, { capture: true });\n return () => ownerDocument.removeEventListener(\"keydown\", handleKeyDown, { capture: true });\n }, [ownerDocument, isHighestLayer, handleKeyDown]);\n React.useEffect(() => {\n if (!node) return;\n if (disableOutsidePointerEvents) {\n if (context.layersWithOutsidePointerEventsDisabled.size === 0) {\n originalBodyPointerEvents = ownerDocument.body.style.pointerEvents;\n ownerDocument.body.style.pointerEvents = \"none\";\n }\n context.layersWithOutsidePointerEventsDisabled.add(node);\n }\n context.layers.add(node);\n dispatchUpdate();\n return () => {\n if (disableOutsidePointerEvents) {\n context.layersWithOutsidePointerEventsDisabled.delete(node);\n if (context.layersWithOutsidePointerEventsDisabled.size === 0) {\n ownerDocument.body.style.pointerEvents = originalBodyPointerEvents;\n }\n }\n };\n }, [node, ownerDocument, disableOutsidePointerEvents, context]);\n React.useEffect(() => {\n return () => {\n if (!node) return;\n context.layers.delete(node);\n context.layersWithOutsidePointerEventsDisabled.delete(node);\n dispatchUpdate();\n };\n }, [node, context]);\n React.useEffect(() => {\n const handleUpdate = /* @__PURE__ */ __name(() => force({}), \"handleUpdate\");\n document.addEventListener(CONTEXT_UPDATE, handleUpdate);\n return () => document.removeEventListener(CONTEXT_UPDATE, handleUpdate);\n }, []);\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n ...layerProps,\n ref: composedRefs,\n style: {\n pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? \"auto\" : \"none\" : void 0,\n ...props.style\n },\n onFocusCapture: composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture),\n onBlurCapture: composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture),\n onPointerDownCapture: composeEventHandlers(\n props.onPointerDownCapture,\n pointerDownOutside.onPointerDownCapture\n )\n }\n );\n }, \"DismissableLayer\")\n);\nvar DismissableLayerBranch = /* @__PURE__ */ React.forwardRef(/* @__PURE__ */ __name(function DismissableLayerBranch2(props, forwardedRef) {\n const context = React.useContext(DismissableLayerContext);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n context.branches.add(node);\n return () => {\n context.branches.delete(node);\n };\n }\n }, [context.branches]);\n return /* @__PURE__ */ jsx(Primitive.div, { ...props, ref: composedRefs });\n}, \"DismissableLayerBranch\"));\nfunction useDismissableLayerSurface() {\n const context = React.useContext(DismissableLayerContext);\n const [node, setNode] = React.useState(null);\n React.useEffect(() => {\n if (!node) {\n return;\n }\n context.dismissableSurfaces.add(node);\n return () => {\n context.dismissableSurfaces.delete(node);\n };\n }, [node, context.dismissableSurfaces]);\n return setNode;\n}\n__name(useDismissableLayerSurface, \"useDismissableLayerSurface\");\nvar IS_TRUE = /* @__PURE__ */ __name(() => true, \"IS_TRUE\");\nfunction usePointerDownOutside(onPointerDownOutside, args) {\n const {\n ownerDocument = globalThis?.document,\n deferPointerDownOutside = false,\n isDeferredPointerDownOutsideRef,\n dismissableSurfaces,\n shouldHandlePointerDownOutside = IS_TRUE\n } = args;\n const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);\n const isPointerInsideReactTreeRef = React.useRef(false);\n const isPointerDownOutsideRef = React.useRef(false);\n const interceptedOutsideInteractionEventsRef = React.useRef(/* @__PURE__ */ new Map());\n const handleClickRef = React.useRef(() => {\n });\n React.useEffect(() => {\n function resetOutsideInteraction() {\n isPointerDownOutsideRef.current = false;\n isDeferredPointerDownOutsideRef.current = false;\n interceptedOutsideInteractionEventsRef.current.clear();\n }\n __name(resetOutsideInteraction, \"resetOutsideInteraction\");\n function isOutsideInteractionIntercepted() {\n return Array.from(interceptedOutsideInteractionEventsRef.current.values()).some(Boolean);\n }\n __name(isOutsideInteractionIntercepted, \"isOutsideInteractionIntercepted\");\n function handleInteractionCapture(event) {\n if (!isPointerDownOutsideRef.current) {\n return;\n }\n const target = event.target;\n const isDismissableSurface = target instanceof Node && [...dismissableSurfaces].some((surface) => surface.contains(target));\n if (!isDismissableSurface) {\n interceptedOutsideInteractionEventsRef.current.set(event.type, true);\n }\n if (event.type === \"click\") {\n window.setTimeout(() => {\n if (isPointerDownOutsideRef.current) {\n handleClickRef.current();\n }\n }, 0);\n }\n }\n __name(handleInteractionCapture, \"handleInteractionCapture\");\n function handleInteractionBubble(event) {\n if (isPointerDownOutsideRef.current) {\n interceptedOutsideInteractionEventsRef.current.set(event.type, false);\n }\n }\n __name(handleInteractionBubble, \"handleInteractionBubble\");\n const handlePointerDown = /* @__PURE__ */ __name((event) => {\n if (event.target && !isPointerInsideReactTreeRef.current) {\n let handleAndDispatchPointerDownOutsideEvent2 = function() {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n const wasOutsideInteractionIntercepted = isOutsideInteractionIntercepted();\n resetOutsideInteraction();\n if (!wasOutsideInteractionIntercepted) {\n handleAndDispatchCustomEvent(\n POINTER_DOWN_OUTSIDE,\n handlePointerDownOutside,\n eventDetail,\n { discrete: true }\n );\n }\n };\n var handleAndDispatchPointerDownOutsideEvent = handleAndDispatchPointerDownOutsideEvent2;\n __name(handleAndDispatchPointerDownOutsideEvent2, \"handleAndDispatchPointerDownOutsideEvent\");\n if (!shouldHandlePointerDownOutside(event.target)) {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n resetOutsideInteraction();\n isPointerInsideReactTreeRef.current = false;\n return;\n }\n const eventDetail = { originalEvent: event };\n isPointerDownOutsideRef.current = true;\n isDeferredPointerDownOutsideRef.current = deferPointerDownOutside && event.button === 0;\n interceptedOutsideInteractionEventsRef.current.clear();\n if (!deferPointerDownOutside || event.button !== 0) {\n handleAndDispatchPointerDownOutsideEvent2();\n } else {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n handleClickRef.current = handleAndDispatchPointerDownOutsideEvent2;\n ownerDocument.addEventListener(\"click\", handleClickRef.current, { once: true });\n }\n } else {\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n resetOutsideInteraction();\n }\n isPointerInsideReactTreeRef.current = false;\n }, \"handlePointerDown\");\n const outsideInteractionEvents = [\n \"pointerup\",\n \"mousedown\",\n \"mouseup\",\n \"touchstart\",\n \"touchend\",\n \"click\"\n ];\n for (const eventName of outsideInteractionEvents) {\n ownerDocument.addEventListener(eventName, handleInteractionCapture, true);\n ownerDocument.addEventListener(eventName, handleInteractionBubble);\n }\n const timerId = window.setTimeout(() => {\n ownerDocument.addEventListener(\"pointerdown\", handlePointerDown);\n }, 0);\n return () => {\n window.clearTimeout(timerId);\n ownerDocument.removeEventListener(\"pointerdown\", handlePointerDown);\n ownerDocument.removeEventListener(\"click\", handleClickRef.current);\n for (const eventName of outsideInteractionEvents) {\n ownerDocument.removeEventListener(eventName, handleInteractionCapture, true);\n ownerDocument.removeEventListener(eventName, handleInteractionBubble);\n }\n };\n }, [\n ownerDocument,\n handlePointerDownOutside,\n deferPointerDownOutside,\n isDeferredPointerDownOutsideRef,\n dismissableSurfaces,\n shouldHandlePointerDownOutside\n ]);\n return {\n // ensures we check React component tree (not just DOM tree)\n onPointerDownCapture: /* @__PURE__ */ __name(() => isPointerInsideReactTreeRef.current = true, \"onPointerDownCapture\")\n };\n}\n__name(usePointerDownOutside, \"usePointerDownOutside\");\nfunction useFocusOutside(onFocusOutside, ownerDocument = globalThis?.document) {\n const handleFocusOutside = useCallbackRef(onFocusOutside);\n const isFocusInsideReactTreeRef = React.useRef(false);\n React.useEffect(() => {\n const handleFocus = /* @__PURE__ */ __name((event) => {\n if (event.target && !isFocusInsideReactTreeRef.current) {\n const eventDetail = { originalEvent: event };\n handleAndDispatchCustomEvent(FOCUS_OUTSIDE, handleFocusOutside, eventDetail, {\n discrete: false\n });\n }\n }, \"handleFocus\");\n ownerDocument.addEventListener(\"focusin\", handleFocus);\n return () => ownerDocument.removeEventListener(\"focusin\", handleFocus);\n }, [ownerDocument, handleFocusOutside]);\n return {\n onFocusCapture: /* @__PURE__ */ __name(() => isFocusInsideReactTreeRef.current = true, \"onFocusCapture\"),\n onBlurCapture: /* @__PURE__ */ __name(() => isFocusInsideReactTreeRef.current = false, \"onBlurCapture\")\n };\n}\n__name(useFocusOutside, \"useFocusOutside\");\nfunction dispatchUpdate() {\n const event = new CustomEvent(CONTEXT_UPDATE);\n document.dispatchEvent(event);\n}\n__name(dispatchUpdate, \"dispatchUpdate\");\nfunction handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {\n const target = detail.originalEvent.target;\n const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });\n if (handler) target.addEventListener(name, handler, { once: true });\n if (discrete) {\n dispatchDiscreteCustomEvent(target, event);\n } else {\n target.dispatchEvent(event);\n }\n}\n__name(handleAndDispatchCustomEvent, \"handleAndDispatchCustomEvent\");\nexport {\n DismissableLayerBranch as Branch,\n DismissableLayer,\n DismissableLayerBranch,\n DismissableLayer as Root,\n useDismissableLayerSurface\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["__defProp","__name","target","value","CONTEXT_UPDATE","POINTER_DOWN_OUTSIDE","FOCUS_OUTSIDE","originalBodyPointerEvents","DismissableLayerContext","React","DismissableLayer","props","forwardedRef","disableOutsidePointerEvents","deferPointerDownOutside","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","layerProps","context","node","setNode","ownerDocument","force","composedRefs","useComposedRefs","layers","highestLayerWithOutsidePointerEventsDisabled","highestLayerWithOutsidePointerEventsDisabledIndex","index","isBodyPointerEventsDisabled","isPointerEventsEnabled","isDeferredPointerDownOutsideRef","pointerDownOutside","usePointerDownOutside","event","isPointerDownOnBranch","branch","focusOutside","useFocusOutside","isHighestLayer","handleKeyDown","useCallbackRef","dispatchUpdate","handleUpdate","jsx","Primitive","composeEventHandlers","useDismissableLayerSurface","IS_TRUE","args","dismissableSurfaces","shouldHandlePointerDownOutside","handlePointerDownOutside","isPointerInsideReactTreeRef","isPointerDownOutsideRef","interceptedOutsideInteractionEventsRef","handleClickRef","resetOutsideInteraction","isOutsideInteractionIntercepted","handleInteractionCapture","surface","handleInteractionBubble","handlePointerDown","handleAndDispatchPointerDownOutsideEvent2","wasOutsideInteractionIntercepted","handleAndDispatchCustomEvent","eventDetail","outsideInteractionEvents","eventName","timerId","handleFocusOutside","isFocusInsideReactTreeRef","handleFocus","name","handler","detail","discrete","dispatchDiscreteCustomEvent"],"mappings":";;;;;;AACA,IAAIA,IAAY,OAAO,gBACnBC,IAAS,CAACC,GAAQC,MAAUH,EAAUE,GAAQ,QAAQ,EAAE,OAAAC,GAAO,cAAc,IAAM,GASnFC,IAAiB,2BACjBC,IAAuB,uCACvBC,IAAgB,iC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;AAChB,WAAAb,EAAc,iBAAiB,WAAWmD,CAAW,GAC9C,MAAMnD,EAAc,oBAAoB,WAAWmD,CAAW;AAAA,EACvE,GAAG,CAACnD,GAAeiD,CAAkB,CAAC,GAC/B;AAAA,IACL,gBAAgC,gBAAAxE,EAAO,MAAMyE,EAA0B,UAAU,IAAM,gBAAgB;AAAA,IACvG,eAA+B,gBAAAzE,EAAO,MAAMyE,EAA0B,UAAU,IAAO,eAAe;AAAA,EAC1G;AACA;AACAzE,EAAOwC,GAAiB,iBAAiB;AACzC,SAASI,IAAiB;AACxB,QAAMR,IAAQ,IAAI,YAAYjC,CAAc;AAC5C,WAAS,cAAciC,CAAK;AAC9B;AACApC,EAAO4C,GAAgB,gBAAgB;AACvC,SAASuB,EAA6BQ,GAAMC,GAASC,GAAQ,EAAE,UAAAC,EAAQ,GAAI;AACzE,QAAM7E,IAAS4E,EAAO,cAAc,QAC9BzC,IAAQ,IAAI,YAAYuC,GAAM,EAAE,SAAS,IAAO,YAAY,IAAM,QAAAE,GAAQ;AAChF,EAAID,KAAS3E,EAAO,iBAAiB0E,GAAMC,GAAS,EAAE,MAAM,IAAM,GAC9DE,IACFC,EAA4B9E,GAAQmC,CAAK,IAEzCnC,EAAO,cAAcmC,CAAK;AAE9B;AACApC,EAAOmE,GAA8B,8BAA8B;","x_google_ignoreList":[0]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("react"),h=require("react/jsx-runtime");function F(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const c=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,c.get?c:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const o=F(v);var g=Object.defineProperty,n=(e,t)=>g(e,"name",{value:t,configurable:!0}),d=o.createContext(null);function f({registry:e,children:t}){return e?h.jsx(d.Provider,{value:e,children:t}):t}n(f,"FocusScopeBranchProvider");function l(){const[e,t]=o.useState([]),r=o.useMemo(()=>({add:n(c=>t(i=>i.includes(c)?i:[...i,c]),"add"),remove:n(c=>t(i=>i.filter(s=>s!==c)),"remove")}),[]);return{nodes:e,registry:r}}n(l,"useFocusScopeBranchRegistry");function p(e){const t=o.useContext(d);o.useEffect(()=>{if(!(!e||!t))return t.add(e),()=>t.remove(e)},[e,t])}n(p,"useFocusScopeBranch");function E(e,{select:t=!1}={}){const r=document.activeElement;for(const c of e)if(y(c,{select:t}),document.activeElement!==r)return}n(E,"focusFirst");function N(e){const t=b(e),r=u(t,e),c=u(t.reverse(),e);return[r,c]}n(N,"getTabbableEdges");function b(e){const t=[],c=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n(i=>{const s=i.tagName==="INPUT"&&i.type==="hidden";return i.disabled||i.hidden||s?NodeFilter.FILTER_SKIP:i.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;c.nextNode();)t.push(c.currentNode);return t}n(b,"getTabbableCandidates");function u(e,t){const r=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const c of e)if(!(r?!c.checkVisibility({checkVisibilityCSS:!0}):m(c,{upTo:t})))return c}n(u,"findVisible");function m(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}n(m,"isHidden");function S(e){return e.tagName==="INPUT"&&typeof e.select=="function"}n(S,"isSelectableInput");function y(e,{select:t=!1}={}){if(e&&e.focus){const c=(e.ownerDocument??document).activeElement;e.focus({preventScroll:!0}),e!==c&&S(e)&&t&&e.select()}}n(y,"focus");function k(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=a(e,t),e.unshift(t)},remove(t){e=a(e,t),e[0]?.resume()}}}n(k,"createFocusScopesStack");function a(e,t){const r=[...e],c=r.indexOf(t);return c!==-1&&r.splice(c,1),r}n(a,"arrayRemove");function P(e){return e.filter(t=>t.tagName!=="A")}n(P,"removeLinks");exports.FocusScopeBranchProvider=f;exports.useFocusScopeBranch=p;exports.useFocusScopeBranchRegistry=l;
|
|
2
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../../../../../node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-focus-scope/dist/index.mjs"],"sourcesContent":["\"use client\";\nvar __defProp = Object.defineProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\n\n// src/focus-scope.tsx\nimport * as React from \"react\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { jsx } from \"react/jsx-runtime\";\nvar AUTOFOCUS_ON_MOUNT = \"focusScope.autoFocusOnMount\";\nvar AUTOFOCUS_ON_UNMOUNT = \"focusScope.autoFocusOnUnmount\";\nvar EVENT_OPTIONS = { bubbles: false, cancelable: true };\nvar FocusScope = /* @__PURE__ */ React.forwardRef(\n /* @__PURE__ */ __name(function FocusScope2(props, forwardedRef) {\n const {\n loop = false,\n trapped = false,\n branches,\n onMountAutoFocus: onMountAutoFocusProp,\n onUnmountAutoFocus: onUnmountAutoFocusProp,\n ...scopeProps\n } = props;\n const [container, setContainer] = React.useState(null);\n const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);\n const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);\n const lastFocusedElementRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, setContainer);\n const branchesRef = React.useRef(branches);\n React.useEffect(() => {\n branchesRef.current = branches;\n });\n const isTargetInScope = React.useCallback(\n (target) => {\n if (!target) return false;\n if (container?.contains(target)) return true;\n return Boolean(branchesRef.current?.some((branch) => branch.contains(target)));\n },\n [container]\n );\n const focusScope = React.useRef({\n paused: false,\n pause() {\n this.paused = true;\n },\n resume() {\n this.paused = false;\n }\n }).current;\n React.useEffect(() => {\n if (trapped) {\n let handleFocusIn2 = function(event) {\n if (focusScope.paused || !container) return;\n const target = event.target;\n if (isTargetInScope(target)) {\n lastFocusedElementRef.current = target;\n } else {\n focus(lastFocusedElementRef.current, { select: true });\n }\n }, handleFocusOut2 = function(event) {\n if (focusScope.paused || !container) return;\n const relatedTarget = event.relatedTarget;\n if (relatedTarget === null) return;\n if (!isTargetInScope(relatedTarget)) {\n focus(lastFocusedElementRef.current, { select: true });\n }\n }, handleMutations2 = function(mutations) {\n const focusedElement = document.activeElement;\n if (focusedElement !== document.body) return;\n for (const mutation of mutations) {\n if (mutation.removedNodes.length > 0) focus(container);\n }\n };\n var handleFocusIn = handleFocusIn2, handleFocusOut = handleFocusOut2, handleMutations = handleMutations2;\n __name(handleFocusIn2, \"handleFocusIn\");\n __name(handleFocusOut2, \"handleFocusOut\");\n __name(handleMutations2, \"handleMutations\");\n document.addEventListener(\"focusin\", handleFocusIn2);\n document.addEventListener(\"focusout\", handleFocusOut2);\n const mutationObserver = new MutationObserver(handleMutations2);\n if (container) mutationObserver.observe(container, { childList: true, subtree: true });\n return () => {\n document.removeEventListener(\"focusin\", handleFocusIn2);\n document.removeEventListener(\"focusout\", handleFocusOut2);\n mutationObserver.disconnect();\n };\n }\n }, [trapped, container, focusScope.paused, isTargetInScope]);\n React.useEffect(() => {\n if (container) {\n focusScopesStack.add(focusScope);\n const previouslyFocusedElement = document.activeElement;\n const hasFocusedCandidate = container.contains(previouslyFocusedElement);\n if (!hasFocusedCandidate) {\n const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);\n container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);\n container.dispatchEvent(mountEvent);\n if (!mountEvent.defaultPrevented) {\n focusFirst(removeLinks(getTabbableCandidates(container)), { select: true });\n if (document.activeElement === previouslyFocusedElement) {\n focus(container);\n }\n }\n }\n return () => {\n container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);\n const ownerDocument = container.ownerDocument;\n const UnmountEvent = CustomEvent;\n setTimeout(() => {\n const unmountEvent = new UnmountEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);\n container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);\n container.dispatchEvent(unmountEvent);\n if (!unmountEvent.defaultPrevented) {\n focus(previouslyFocusedElement ?? ownerDocument.body, { select: true });\n }\n container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);\n focusScopesStack.remove(focusScope);\n }, 0);\n };\n }\n }, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);\n const handleKeyDown = React.useCallback(\n (event) => {\n if (!loop && !trapped) return;\n if (focusScope.paused) return;\n const isTabKey = event.key === \"Tab\" && !event.altKey && !event.ctrlKey && !event.metaKey;\n const focusedElement = document.activeElement;\n if (isTabKey && focusedElement) {\n const container2 = event.currentTarget;\n const [first, last] = getTabbableEdges(container2);\n const hasTabbableElementsInside = first && last;\n if (!hasTabbableElementsInside) {\n if (focusedElement === container2) event.preventDefault();\n } else {\n if (!event.shiftKey && focusedElement === last) {\n event.preventDefault();\n if (loop) focus(first, { select: true });\n } else if (event.shiftKey && focusedElement === first) {\n event.preventDefault();\n if (loop) focus(last, { select: true });\n }\n }\n }\n },\n [loop, trapped, focusScope.paused]\n );\n return /* @__PURE__ */ jsx(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });\n }, \"FocusScope\")\n);\nvar FocusScopeBranchContext = React.createContext(null);\nfunction FocusScopeBranchProvider({ registry, children }) {\n if (!registry) {\n return children;\n }\n return /* @__PURE__ */ jsx(FocusScopeBranchContext.Provider, { value: registry, children });\n}\n__name(FocusScopeBranchProvider, \"FocusScopeBranchProvider\");\nfunction useFocusScopeBranchRegistry() {\n const [nodes, setNodes] = React.useState([]);\n const registry = React.useMemo(\n () => ({\n add: /* @__PURE__ */ __name((node) => setNodes((prev) => prev.includes(node) ? prev : [...prev, node]), \"add\"),\n remove: /* @__PURE__ */ __name((node) => setNodes((prev) => prev.filter((current) => current !== node)), \"remove\")\n }),\n []\n );\n return { nodes, registry };\n}\n__name(useFocusScopeBranchRegistry, \"useFocusScopeBranchRegistry\");\nfunction useFocusScopeBranch(node) {\n const registry = React.useContext(FocusScopeBranchContext);\n React.useEffect(() => {\n if (!node || !registry) return;\n registry.add(node);\n return () => registry.remove(node);\n }, [node, registry]);\n}\n__name(useFocusScopeBranch, \"useFocusScopeBranch\");\nfunction focusFirst(candidates, { select = false } = {}) {\n const previouslyFocusedElement = document.activeElement;\n for (const candidate of candidates) {\n focus(candidate, { select });\n if (document.activeElement !== previouslyFocusedElement) return;\n }\n}\n__name(focusFirst, \"focusFirst\");\nfunction getTabbableEdges(container) {\n const candidates = getTabbableCandidates(container);\n const first = findVisible(candidates, container);\n const last = findVisible(candidates.reverse(), container);\n return [first, last];\n}\n__name(getTabbableEdges, \"getTabbableEdges\");\nfunction getTabbableCandidates(container) {\n const nodes = [];\n const document2 = container.ownerDocument;\n const walker = document2.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {\n acceptNode: /* @__PURE__ */ __name((node) => {\n const isHiddenInput = node.tagName === \"INPUT\" && node.type === \"hidden\";\n if (node.disabled || node.hidden || isHiddenInput) {\n return NodeFilter.FILTER_SKIP;\n }\n return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n }, \"acceptNode\")\n });\n while (walker.nextNode()) {\n nodes.push(walker.currentNode);\n }\n return nodes;\n}\n__name(getTabbableCandidates, \"getTabbableCandidates\");\nfunction findVisible(elements, container) {\n const canUseCheckVisibility = typeof container.checkVisibility === \"function\" && container.checkVisibility({ checkVisibilityCSS: true });\n for (const element of elements) {\n const hidden = canUseCheckVisibility ? !element.checkVisibility({ checkVisibilityCSS: true }) : isHidden(element, { upTo: container });\n if (!hidden) {\n return element;\n }\n }\n}\n__name(findVisible, \"findVisible\");\nfunction isHidden(node, { upTo }) {\n if (getComputedStyle(node).visibility === \"hidden\") return true;\n while (node) {\n if (upTo !== void 0 && node === upTo) return false;\n if (getComputedStyle(node).display === \"none\") return true;\n node = node.parentElement;\n }\n return false;\n}\n__name(isHidden, \"isHidden\");\nfunction isSelectableInput(element) {\n return element.tagName === \"INPUT\" && typeof element.select === \"function\";\n}\n__name(isSelectableInput, \"isSelectableInput\");\nfunction focus(element, { select = false } = {}) {\n if (element && element.focus) {\n const ownerDocument = element.ownerDocument ?? document;\n const previouslyFocusedElement = ownerDocument.activeElement;\n element.focus({ preventScroll: true });\n if (element !== previouslyFocusedElement && isSelectableInput(element) && select)\n element.select();\n }\n}\n__name(focus, \"focus\");\nvar focusScopesStack = createFocusScopesStack();\nfunction createFocusScopesStack() {\n let stack = [];\n return {\n add(focusScope) {\n const activeFocusScope = stack[0];\n if (focusScope !== activeFocusScope) {\n activeFocusScope?.pause();\n }\n stack = arrayRemove(stack, focusScope);\n stack.unshift(focusScope);\n },\n remove(focusScope) {\n stack = arrayRemove(stack, focusScope);\n stack[0]?.resume();\n }\n };\n}\n__name(createFocusScopesStack, \"createFocusScopesStack\");\nfunction arrayRemove(array, item) {\n const updatedArray = [...array];\n const index = updatedArray.indexOf(item);\n if (index !== -1) {\n updatedArray.splice(index, 1);\n }\n return updatedArray;\n}\n__name(arrayRemove, \"arrayRemove\");\nfunction removeLinks(items) {\n return items.filter((item) => item.tagName !== \"A\");\n}\n__name(removeLinks, \"removeLinks\");\nexport {\n FocusScope,\n FocusScopeBranchProvider,\n FocusScope as Root,\n useFocusScopeBranch,\n useFocusScopeBranchRegistry\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["__defProp","__name","target","value","FocusScopeBranchContext","React","FocusScopeBranchProvider","registry","children","jsx","useFocusScopeBranchRegistry","nodes","setNodes","node","prev","current","useFocusScopeBranch","focusFirst","candidates","select","previouslyFocusedElement","candidate","focus","getTabbableEdges","container","getTabbableCandidates","first","findVisible","last","walker","isHiddenInput","elements","canUseCheckVisibility","element","isHidden","upTo","isSelectableInput","createFocusScopesStack","stack","focusScope","activeFocusScope","arrayRemove","array","item","updatedArray","index","removeLinks","items"],"mappings":"kaACA,IAAIA,EAAY,OAAO,eACnBC,EAAS,CAACC,EAAQC,IAAUH,EAAUE,EAAQ,OAAQ,CAAE,MAAAC,EAAO,aAAc,GAAM,EAmJnFC,EAA0BC,EAAM,cAAc,IAAI,EACtD,SAASC,EAAyB,CAAE,SAAAC,EAAU,SAAAC,GAAY,CACxD,OAAKD,EAGkBE,EAAAA,IAAIL,EAAwB,SAAU,CAAE,MAAOG,EAAU,SAAAC,EAAU,EAFjFA,CAGX,CACAP,EAAOK,EAA0B,0BAA0B,EAC3D,SAASI,GAA8B,CACrC,KAAM,CAACC,EAAOC,CAAQ,EAAIP,EAAM,SAAS,CAAA,CAAE,EACrCE,EAAWF,EAAM,QACrB,KAAO,CACL,IAAqBJ,EAAQY,GAASD,EAAUE,GAASA,EAAK,SAASD,CAAI,EAAIC,EAAO,CAAC,GAAGA,EAAMD,CAAI,CAAC,EAAG,KAAK,EAC7G,OAAwBZ,EAAQY,GAASD,EAAUE,GAASA,EAAK,OAAQC,GAAYA,IAAYF,CAAI,CAAC,EAAG,QAAQ,CACvH,GACI,CAAA,CACJ,EACE,MAAO,CAAE,MAAAF,EAAO,SAAAJ,CAAQ,CAC1B,CACAN,EAAOS,EAA6B,6BAA6B,EACjE,SAASM,EAAoBH,EAAM,CACjC,MAAMN,EAAWF,EAAM,WAAWD,CAAuB,EACzDC,EAAM,UAAU,IAAM,CACpB,GAAI,GAACQ,GAAQ,CAACN,GACd,OAAAA,EAAS,IAAIM,CAAI,EACV,IAAMN,EAAS,OAAOM,CAAI,CACnC,EAAG,CAACA,EAAMN,CAAQ,CAAC,CACrB,CACAN,EAAOe,EAAqB,qBAAqB,EACjD,SAASC,EAAWC,EAA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AAY,GAAG,CACpD,CACA1C,EAAO6C,EAAa,aAAa","x_google_ignoreList":[0]}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import * as o from "react";
|
|
2
|
-
import { jsx as b } from "react/jsx-runtime";
|
|
3
|
-
var v = Object.defineProperty, r = (e, t) => v(e, "name", { value: t, configurable: !0 }), d = o.createContext(null);
|
|
4
|
-
function S({ registry: e, children: t }) {
|
|
5
|
-
return e ? /* @__PURE__ */ b(d.Provider, { value: e, children: t }) : t;
|
|
6
|
-
}
|
|
7
|
-
r(S, "FocusScopeBranchProvider");
|
|
8
|
-
function y() {
|
|
9
|
-
const [e, t] = o.useState([]), i = o.useMemo(
|
|
10
|
-
() => ({
|
|
11
|
-
add: /* @__PURE__ */ r((c) => t((n) => n.includes(c) ? n : [...n, c]), "add"),
|
|
12
|
-
remove: /* @__PURE__ */ r((c) => t((n) => n.filter((s) => s !== c)), "remove")
|
|
13
|
-
}),
|
|
14
|
-
[]
|
|
15
|
-
);
|
|
16
|
-
return { nodes: e, registry: i };
|
|
17
|
-
}
|
|
18
|
-
r(y, "useFocusScopeBranchRegistry");
|
|
19
|
-
function h(e) {
|
|
20
|
-
const t = o.useContext(d);
|
|
21
|
-
o.useEffect(() => {
|
|
22
|
-
if (!(!e || !t))
|
|
23
|
-
return t.add(e), () => t.remove(e);
|
|
24
|
-
}, [e, t]);
|
|
25
|
-
}
|
|
26
|
-
r(h, "useFocusScopeBranch");
|
|
27
|
-
function F(e, { select: t = !1 } = {}) {
|
|
28
|
-
const i = document.activeElement;
|
|
29
|
-
for (const c of e)
|
|
30
|
-
if (p(c, { select: t }), document.activeElement !== i) return;
|
|
31
|
-
}
|
|
32
|
-
r(F, "focusFirst");
|
|
33
|
-
function E(e) {
|
|
34
|
-
const t = f(e), i = u(t, e), c = u(t.reverse(), e);
|
|
35
|
-
return [i, c];
|
|
36
|
-
}
|
|
37
|
-
r(E, "getTabbableEdges");
|
|
38
|
-
function f(e) {
|
|
39
|
-
const t = [], c = e.ownerDocument.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
40
|
-
acceptNode: /* @__PURE__ */ r((n) => {
|
|
41
|
-
const s = n.tagName === "INPUT" && n.type === "hidden";
|
|
42
|
-
return n.disabled || n.hidden || s ? NodeFilter.FILTER_SKIP : n.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
43
|
-
}, "acceptNode")
|
|
44
|
-
});
|
|
45
|
-
for (; c.nextNode(); )
|
|
46
|
-
t.push(c.currentNode);
|
|
47
|
-
return t;
|
|
48
|
-
}
|
|
49
|
-
r(f, "getTabbableCandidates");
|
|
50
|
-
function u(e, t) {
|
|
51
|
-
const i = typeof t.checkVisibility == "function" && t.checkVisibility({ checkVisibilityCSS: !0 });
|
|
52
|
-
for (const c of e)
|
|
53
|
-
if (!(i ? !c.checkVisibility({ checkVisibilityCSS: !0 }) : l(c, { upTo: t })))
|
|
54
|
-
return c;
|
|
55
|
-
}
|
|
56
|
-
r(u, "findVisible");
|
|
57
|
-
function l(e, { upTo: t }) {
|
|
58
|
-
if (getComputedStyle(e).visibility === "hidden") return !0;
|
|
59
|
-
for (; e; ) {
|
|
60
|
-
if (t !== void 0 && e === t) return !1;
|
|
61
|
-
if (getComputedStyle(e).display === "none") return !0;
|
|
62
|
-
e = e.parentElement;
|
|
63
|
-
}
|
|
64
|
-
return !1;
|
|
65
|
-
}
|
|
66
|
-
r(l, "isHidden");
|
|
67
|
-
function m(e) {
|
|
68
|
-
return e.tagName === "INPUT" && typeof e.select == "function";
|
|
69
|
-
}
|
|
70
|
-
r(m, "isSelectableInput");
|
|
71
|
-
function p(e, { select: t = !1 } = {}) {
|
|
72
|
-
if (e && e.focus) {
|
|
73
|
-
const c = (e.ownerDocument ?? document).activeElement;
|
|
74
|
-
e.focus({ preventScroll: !0 }), e !== c && m(e) && t && e.select();
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
r(p, "focus");
|
|
78
|
-
function g() {
|
|
79
|
-
let e = [];
|
|
80
|
-
return {
|
|
81
|
-
add(t) {
|
|
82
|
-
const i = e[0];
|
|
83
|
-
t !== i && i?.pause(), e = a(e, t), e.unshift(t);
|
|
84
|
-
},
|
|
85
|
-
remove(t) {
|
|
86
|
-
e = a(e, t), e[0]?.resume();
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
r(g, "createFocusScopesStack");
|
|
91
|
-
function a(e, t) {
|
|
92
|
-
const i = [...e], c = i.indexOf(t);
|
|
93
|
-
return c !== -1 && i.splice(c, 1), i;
|
|
94
|
-
}
|
|
95
|
-
r(a, "arrayRemove");
|
|
96
|
-
function N(e) {
|
|
97
|
-
return e.filter((t) => t.tagName !== "A");
|
|
98
|
-
}
|
|
99
|
-
r(N, "removeLinks");
|
|
100
|
-
export {
|
|
101
|
-
S as FocusScopeBranchProvider,
|
|
102
|
-
h as useFocusScopeBranch,
|
|
103
|
-
y as useFocusScopeBranchRegistry
|
|
104
|
-
};
|
|
105
|
-
//# sourceMappingURL=index.es.js.map
|