@mittwald/flow-react-components 1.3.0-next.2 → 1.3.0-next.20
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/AGENTS.md +32 -0
- package/dist/assets/component-index.json +1 -1
- package/dist/assets/doc-properties.json +1 -1
- package/dist/css/all-layered.css +1 -1
- package/dist/css/all.css +1 -1
- package/dist/js/_virtual/_28.locale.mjs +10 -0
- package/dist/js/default.mjs +2 -1
- package/dist/js/flr-universal.mjs +2 -1
- package/dist/js/packages/components/src/components/Accordion/Accordion.mjs +23 -15
- package/dist/js/packages/components/src/components/Accordion/Accordion.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CartesianChart/CartesianChart.mjs +6 -2
- package/dist/js/packages/components/src/components/CartesianChart/CartesianChart.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CartesianChart/components/Area/Area.mjs +3 -1
- package/dist/js/packages/components/src/components/CartesianChart/components/Area/Area.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CartesianChart/components/Bar/Bar.mjs +12 -3
- package/dist/js/packages/components/src/components/CartesianChart/components/Bar/Bar.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CartesianChart/context.mjs +4 -1
- package/dist/js/packages/components/src/components/CartesianChart/context.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CartesianChart/hooks/useScopedStackId.mjs +16 -0
- package/dist/js/packages/components/src/components/CartesianChart/hooks/useScopedStackId.mjs.map +1 -0
- package/dist/js/packages/components/src/components/Combine/Combine.mjs +4 -1
- package/dist/js/packages/components/src/components/Combine/Combine.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Combine/Combine.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/DonutChart/DonutChart.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/FileDropZone/FileDropZone.mjs +2 -2
- package/dist/js/packages/components/src/components/FileDropZone/FileDropZone.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Icon/components/icons/IconAIHosting.mjs +19 -0
- package/dist/js/packages/components/src/components/Icon/components/icons/IconAIHosting.mjs.map +1 -0
- package/dist/js/packages/components/src/components/LightBox/components/LightBoxGallery/Controls.mjs +1 -1
- package/dist/js/packages/components/src/components/LightBox/components/LightBoxGallery/Controls.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/List.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/ListItemView/ListItemView.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Overlay/components/OverlayContent.mjs +37 -2
- package/dist/js/packages/components/src/components/Overlay/components/OverlayContent.mjs.map +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/PasswordCreationField.mjs +8 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/PasswordCreationField.mjs.map +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/components/PasswordGenerateButton/PasswordGenerateButton.mjs +2 -0
- package/dist/js/packages/components/src/components/PasswordCreationField/components/PasswordGenerateButton/PasswordGenerateButton.mjs.map +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/components/ValidationResultButton/ValidationResultButton.mjs +13 -7
- package/dist/js/packages/components/src/components/PasswordCreationField/components/ValidationResultButton/ValidationResultButton.mjs.map +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/components/ValidationResultButton/ValidationResultButton.module.mjs +9 -0
- package/dist/js/packages/components/src/components/PasswordCreationField/components/ValidationResultButton/ValidationResultButton.module.mjs.map +1 -0
- package/dist/js/packages/components/src/components/PasswordCreationField/components/ValidationResultEntry/ValidationResultEntry.mjs +12 -4
- package/dist/js/packages/components/src/components/PasswordCreationField/components/ValidationResultEntry/ValidationResultEntry.mjs.map +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/lib/ariaAnnounce.mjs +52 -0
- package/dist/js/packages/components/src/components/PasswordCreationField/lib/ariaAnnounce.mjs.map +1 -0
- package/dist/js/packages/components/src/components/PasswordCreationField/lib/generateValidationTranslation.mjs +1 -0
- package/dist/js/packages/components/src/components/PasswordCreationField/lib/generateValidationTranslation.mjs.map +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/lib/getStatusFromPolicyValidationResult.mjs +1 -0
- package/dist/js/packages/components/src/components/PasswordCreationField/lib/getStatusFromPolicyValidationResult.mjs.map +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/lib/usePolicyValidationResult.mjs +1 -0
- package/dist/js/packages/components/src/components/PasswordCreationField/lib/usePolicyValidationResult.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Popover/components/NonModalPopoverContent/NonModalPopoverContent.mjs +19 -11
- package/dist/js/packages/components/src/components/Popover/components/NonModalPopoverContent/NonModalPopoverContent.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Section/Section.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/TextArea/TextArea.mjs +14 -13
- package/dist/js/packages/components/src/components/TextArea/TextArea.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Tooltip/Tooltip.module.mjs.map +1 -1
- package/dist/js/packages/components/src/lib/files/acceptedFiles.mjs +34 -0
- package/dist/js/packages/components/src/lib/files/acceptedFiles.mjs.map +1 -0
- package/dist/js/packages/components/src/lib/hooks/dom/useKeepBrowserExtensionsInteractive.mjs +1 -1
- package/dist/js/packages/components/src/lib/hooks/dom/useKeepBrowserExtensionsInteractive.mjs.map +1 -1
- package/dist/types/components/CartesianChart/context.d.ts +6 -0
- package/dist/types/components/CartesianChart/hooks/useScopedStackId.d.ts +6 -0
- package/dist/types/components/Icon/components/icons/IconAIHosting.d.ts +4 -0
- package/dist/types/components/Icon/components/icons/index.d.ts +1 -0
- package/dist/types/components/PasswordCreationField/components/PasswordGenerateButton/PasswordGenerateButton.d.ts +0 -7
- package/dist/types/components/PasswordCreationField/components/ValidationResultButton/ValidationResultButton.d.ts +0 -9
- package/dist/types/components/PasswordCreationField/lib/ariaAnnounce.d.ts +1 -0
- package/dist/types/components/PasswordCreationField/lib/generateValidationTranslation.d.ts +0 -2
- package/dist/types/components/PasswordCreationField/lib/getStatusFromPolicyValidationResult.d.ts +0 -3
- package/dist/types/components/PasswordCreationField/lib/usePolicyValidationResult.d.ts +1 -7
- package/dist/types/lib/files/acceptedFiles.d.ts +1 -0
- package/dist/types/lib/hooks/dom/useKeepBrowserExtensionsInteractive.d.ts +1 -0
- package/package.json +10 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NonModalPopoverContent.mjs","names":[],"sources":["../../../../../../../../../src/components/Popover/components/NonModalPopoverContent/NonModalPopoverContent.tsx"],"sourcesContent":["import type { FC, PropsWithChildren, Ref, RefObject } from \"react\";\nimport { useEffect, useId, useRef, useState } from \"react\";\nimport clsx from \"clsx\";\nimport { useObjectRef, useOverlayPosition } from \"react-aria\";\nimport type { Placement } from \"react-aria\";\nimport styles from \"../../Popover.module.scss\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport { popoverViewportPadding } from \"../../viewportPadding\";\nimport { popoverWidthStyle } from \"../../widthStyle\";\n\nexport interface NonModalPopoverContentProps\n extends PropsWithChildren, PropsWithClassName {\n withTip?: boolean;\n isOpen?: boolean;\n width?: string | number;\n placement?: Placement;\n offset?: number;\n crossOffset?: number;\n /** Swallowed on purpose — the stylesheet overrides `max-height` here. */\n maxHeight?: number;\n shouldFlip?: boolean;\n shouldUpdatePosition?: boolean;\n arrowBoundaryOffset?: number;\n boundaryElement?: Element;\n /** The id react-aria's trigger points its `aria-controls` at. */\n id?: string;\n onOpenChange: (isOpen: boolean) => void;\n ref?: Ref<HTMLElement>;\n triggerRef: RefObject<Element | null>;\n}\n\n/*\n * `useOverlayPosition` recalculates when the window resizes, when a scroll\n * container scrolls, and when the anchor or the popover changes *size*. It never\n * notices the anchor merely *moving*, because a popover normally opens on a user\n * interaction, long after the page settled.\n *\n * This one opens itself, so it places itself into a page that is still filling\n * in — and anything appearing above the anchor then pushes the anchor out from\n * under it. Remotely that is the normal case, not an edge case: the host\n * materializes the page in pieces as they arrive over the connection.\n *\n * Observing the ancestors covers it. In block layout an element moves because\n * something around it changed size, and a resized ancestor is the one signal\n * every such reflow has in common. What it does not catch is an ancestor of\n * fixed height rearranging inside — rare, and the next scroll or resize\n * corrects it.\n */\nconst useRepositionWhenAnchorMoves = (\n anchorRef: RefObject<Element | null>,\n isOpen: boolean,\n updatePosition: () => void,\n): void => {\n useEffect(() => {\n // Read inside the effect. A coach mark that is open from its first render\n // renders before the anchor's ref is attached, and a ref filling in does not\n // re-render anything — so reading during render would see `null`, bail, and\n // leave nothing observing.\n const anchor = anchorRef.current;\n\n if (!isOpen || !anchor) {\n return;\n }\n\n const observer = new ResizeObserver(updatePosition);\n\n for (\n let element = anchor.parentElement;\n element;\n element = element.parentElement\n ) {\n observer.observe(element);\n }\n\n return () => observer.disconnect();\n }, [anchorRef, isOpen, updatePosition]);\n};\n\n/*\n * The non-modal popover deliberately skips react-aria's `usePopover`, which is\n * what a popover normally builds on. That hook couples three things Flow does\n * not want here: it locks page scrolling, it hides the rest of the page from\n * assistive tech, and — the reason this component exists — it closes the\n * popover on the first scroll, with no way to opt out.\n *\n * What is left is `useOverlayPosition` for the anchoring, public react-aria API.\n * The popover therefore tracks its trigger while the page scrolls, and its\n * content stays plain content: no role, no label, no focus of its own.\n *\n * It is not portalled either. A popover that is announced by nothing has to be\n * findable where it belongs, and a portal to the end of `<body>` puts it behind\n * the whole page in reading order — so it renders where it was written, right\n * next to what it points at. Being absolutely positioned it still takes no\n * space; what it does inherit is its surroundings, so an ancestor that clips\n * (`overflow: hidden`) or a stacking context can cut it off.\n */\nexport const NonModalPopoverContent: FC<NonModalPopoverContentProps> = (\n props,\n) => {\n const {\n children,\n className,\n withTip,\n isOpen = false,\n width,\n id,\n onOpenChange,\n ref,\n triggerRef,\n // Named one by one so that everything left over is a DOM prop and reaches\n // the element. Funnelling the rest into the positioning instead drops\n // `aria-*`, `data-*` and the like, which `Aria.Popover` forwards on the\n // modal path.\n placement: requestedPlacement,\n offset,\n crossOffset,\n maxHeight: ignoredMaxHeight,\n shouldFlip,\n shouldUpdatePosition,\n arrowBoundaryOffset,\n boundaryElement,\n ...rest\n } = props;\n\n void ignoredMaxHeight;\n\n const positionProps = {\n placement: requestedPlacement,\n offset,\n crossOffset,\n shouldFlip,\n shouldUpdatePosition,\n arrowBoundaryOffset,\n boundaryElement,\n };\n\n const overlayRef = useObjectRef(ref as Ref<HTMLDivElement>);\n const arrowRef = useRef<HTMLDivElement>(null);\n const [isEntering, setIsEntering] = useState(true);\n const detailsId = useId();\n\n const { overlayProps, arrowProps, placement, updatePosition } =\n useOverlayPosition({\n ...positionProps,\n targetRef: triggerRef,\n overlayRef,\n arrowRef,\n isOpen,\n offset: positionProps.offset ?? 8,\n containerPadding: popoverViewportPadding,\n });\n\n useRepositionWhenAnchorMoves(triggerRef, isOpen, updatePosition);\n\n /*\n * Nothing announces this popover, so the trigger points at it: `aria-details`\n * tells assistive tech that there is related content and offers a way over to\n * it — unlike `aria-describedby`, which would flatten the popover into a\n * string and put its buttons out of reach.\n *\n * Set on the trigger element itself, because that element belongs to whoever\n * rendered it. Whatever it carried before is restored on the way out.\n */\n useEffect(() => {\n const trigger = triggerRef.current;\n\n if (!isOpen || !trigger) {\n return;\n }\n\n const previous = trigger.getAttribute(\"aria-details\");\n trigger.setAttribute(\n \"aria-details\",\n previous ? `${previous} ${detailsId}` : detailsId,\n );\n\n return () => {\n if (previous === null) {\n trigger.removeAttribute(\"aria-details\");\n } else {\n trigger.setAttribute(\"aria-details\", previous);\n }\n };\n }, [isOpen, triggerRef, detailsId]);\n\n // Escape closes it. react-aria would do this through `useOverlay`, which is\n // part of the machinery this component leaves out.\n useEffect(() => {\n if (!isOpen) {\n return;\n }\n\n const closeOnEscape = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n onOpenChange(false);\n }\n };\n\n document.addEventListener(\"keydown\", closeOnEscape);\n return () => document.removeEventListener(\"keydown\", closeOnEscape);\n }, [isOpen, onOpenChange]);\n\n useEffect(() => {\n if (!isOpen) {\n setIsEntering(true);\n }\n }, [isOpen]);\n\n if (!isOpen) {\n return null;\n }\n\n /*\n * Until it has a placement, `useOverlayPosition` parks the popover in the top\n * left corner (`position: fixed; top: 0; left: 0`) — it has not measured the\n * anchor yet. Rendered on a server that corner is what ships, and the popover\n * sits there until hydration measures; an anchor given by id is resolved a\n * frame later still. Either way it is visibly in the wrong place first and\n * jumps to the anchor after, so keep it out of sight until it knows where it\n * belongs. It stays in the DOM, which is what its place in the reading order\n * and `aria-details` depend on.\n */\n const isPositioned = placement !== null;\n\n return (\n <div\n {...rest}\n {...overlayProps}\n id={id}\n ref={overlayRef}\n className={clsx(className, styles[\"non-modal\"])}\n data-placement={placement ?? undefined}\n data-entering={isEntering || undefined}\n onAnimationEnd={() => setIsEntering(false)}\n style={{\n ...overlayProps.style,\n /*\n * Two things `useOverlayPosition` adds for an overlay portalled to the\n * end of `<body>` and pinned to the viewport. This one renders where it\n * stands and scrolls with the page, so both are wrong here.\n *\n * `z-index: 100000` would put it in front of the whole application — it\n * scrolled over the docs site's sticky header. Claiming no stacking\n * level leaves that to the page: it still covers the ordinary content\n * around it, and app chrome that sets a `z-index` keeps its place above.\n *\n * The `max-height` it caps the overlay at is wrong here for the same\n * reason, but it is written straight onto the element and has to be\n * undone in CSS — see `.non-modal` in Popover.module.scss.\n */\n zIndex: undefined,\n ...popoverWidthStyle(width),\n ...(isPositioned ? {} : { visibility: \"hidden\" }),\n }}\n >\n {withTip && (\n <div\n {...arrowProps}\n ref={arrowRef}\n className={styles.tip}\n data-placement={placement ?? undefined}\n style={{\n // What <Aria.OverlayArrow /> contributes on top of `arrowProps`:\n // it lifts the tip out of the flow and centres it on the anchor.\n position: \"absolute\",\n transform:\n placement === \"top\" || placement === \"bottom\"\n ? \"translateX(-50%)\"\n : \"translateY(-50%)\",\n // `arrowProps.style` carries the offset along the popover's edge and\n // leaves the other axis `undefined` — which still overwrites. So the\n // edge the tip sits on is set last: spread first, it silently lost\n // `top: 100%` and the tip jumped to the popover's top edge, pointing\n // away from an anchor that was below it.\n ...arrowProps.style,\n ...(placement ? { [placement]: \"100%\" } : {}),\n }}\n >\n <svg width={16} height={16} viewBox=\"0 0 16 16\">\n <path d=\"M0 0 L8 8 L16 0\" />\n </svg>\n </div>\n )}\n <div className={styles.content} id={detailsId}>\n {children}\n </div>\n </div>\n );\n};\n\nexport default NonModalPopoverContent;\n"],"mappings":";;;;;;;;;;AAgDA,IAAM,gCACJ,WACA,QACA,mBACS;CACT,gBAAgB;EAKd,MAAM,SAAS,UAAU;EAEzB,IAAI,CAAC,UAAU,CAAC,QACd;EAGF,MAAM,WAAW,IAAI,eAAe,cAAc;EAElD,KACE,IAAI,UAAU,OAAO,eACrB,SACA,UAAU,QAAQ,eAElB,SAAS,QAAQ,OAAO;EAG1B,aAAa,SAAS,WAAW;CACnC,GAAG;EAAC;EAAW;EAAQ;CAAc,CAAC;AACxC;AAoBA,IAAa,0BACX,UACG;CACH,MAAM,EACJ,UACA,WACA,SACA,SAAS,OACT,OACA,IACA,cACA,KACA,YAKA,WAAW,oBACX,QACA,aACA,WAAW,kBACX,YACA,sBACA,qBACA,iBACA,GAAG,SACD;CAIJ,MAAM,gBAAgB;EACpB,WAAW;EACX;EACA;EACA;EACA;EACA;EACA;CACF;CAEA,MAAM,aAAa,aAAa,GAA0B;CAC1D,MAAM,WAAW,OAAuB,IAAI;CAC5C,MAAM,CAAC,YAAY,iBAAiB,SAAS,IAAI;CACjD,MAAM,YAAY,MAAM;CAExB,MAAM,EAAE,cAAc,YAAY,WAAW,mBAC3C,mBAAmB;EACjB,GAAG;EACH,WAAW;EACX;EACA;EACA;EACA,QAAQ,cAAc,UAAU;EAChC,kBAAkB;CACpB,CAAC;CAEH,6BAA6B,YAAY,QAAQ,cAAc;CAW/D,gBAAgB;EACd,MAAM,UAAU,WAAW;EAE3B,IAAI,CAAC,UAAU,CAAC,SACd;EAGF,MAAM,WAAW,QAAQ,aAAa,cAAc;EACpD,QAAQ,aACN,gBACA,WAAW,GAAG,SAAS,GAAG,cAAc,SAC1C;EAEA,aAAa;GACX,IAAI,aAAa,MACf,QAAQ,gBAAgB,cAAc;QAEtC,QAAQ,aAAa,gBAAgB,QAAQ;EAEjD;CACF,GAAG;EAAC;EAAQ;EAAY;CAAS,CAAC;CAIlC,gBAAgB;EACd,IAAI,CAAC,QACH;EAGF,MAAM,iBAAiB,UAAyB;GAC9C,IAAI,MAAM,QAAQ,UAChB,aAAa,KAAK;EAEtB;EAEA,SAAS,iBAAiB,WAAW,aAAa;EAClD,aAAa,SAAS,oBAAoB,WAAW,aAAa;CACpE,GAAG,CAAC,QAAQ,YAAY,CAAC;CAEzB,gBAAgB;EACd,IAAI,CAAC,QACH,cAAc,IAAI;CAEtB,GAAG,CAAC,MAAM,CAAC;CAEX,IAAI,CAAC,QACH,OAAO;CAaT,MAAM,eAAe,cAAc;CAEnC,OACE,qBAAC,OAAD;EACE,GAAI;EACJ,GAAI;EACA;EACJ,KAAK;EACL,WAAW,KAAK,WAAW,uBAAO,YAAY;EAC9C,kBAAgB,aAAa,KAAA;EAC7B,iBAAe,cAAc,KAAA;EAC7B,sBAAsB,cAAc,KAAK;EACzC,OAAO;GACL,GAAG,aAAa;GAehB,QAAQ,KAAA;GACR,GAAG,kBAAkB,KAAK;GAC1B,GAAI,eAAe,CAAC,IAAI,EAAE,YAAY,SAAS;EACjD;EA5BF,UAAA,CA8BG,WACC,oBAAC,OAAD;GACE,GAAI;GACJ,KAAK;GACL,WAAW,uBAAO;GAClB,kBAAgB,aAAa,KAAA;GAC7B,OAAO;IAGL,UAAU;IACV,WACE,cAAc,SAAS,cAAc,WACjC,qBACA;IAMN,GAAG,WAAW;IACd,GAAI,YAAY,GAAG,YAAY,OAAO,IAAI,CAAC;GAC7C;GAEA,UAAA,oBAAC,OAAD;IAAK,OAAO;IAAI,QAAQ;IAAI,SAAQ;IAClC,UAAA,oBAAC,QAAD,EAAM,GAAE,kBAAmB,CAAA;GACxB,CAAA;EACF,CAAA,GAEP,oBAAC,OAAD;GAAK,WAAW,uBAAO;GAAS,IAAI;GACjC;EACE,CAAA,CACF;;AAET"}
|
|
1
|
+
{"version":3,"file":"NonModalPopoverContent.mjs","names":[],"sources":["../../../../../../../../../src/components/Popover/components/NonModalPopoverContent/NonModalPopoverContent.tsx"],"sourcesContent":["import type { FC, PropsWithChildren, Ref, RefObject } from \"react\";\nimport { useEffect, useId, useRef } from \"react\";\nimport clsx from \"clsx\";\nimport { useObjectRef, useOverlayPosition } from \"react-aria\";\nimport type { Placement } from \"react-aria\";\nimport { useEnterAnimation, useExitAnimation } from \"@react-aria/utils\";\nimport styles from \"../../Popover.module.scss\";\nimport type { PropsWithClassName } from \"@/lib/types/props\";\nimport { popoverViewportPadding } from \"../../viewportPadding\";\nimport { popoverWidthStyle } from \"../../widthStyle\";\n\nexport interface NonModalPopoverContentProps\n extends PropsWithChildren, PropsWithClassName {\n withTip?: boolean;\n isOpen?: boolean;\n width?: string | number;\n placement?: Placement;\n offset?: number;\n crossOffset?: number;\n /** Swallowed on purpose — the stylesheet overrides `max-height` here. */\n maxHeight?: number;\n shouldFlip?: boolean;\n shouldUpdatePosition?: boolean;\n arrowBoundaryOffset?: number;\n boundaryElement?: Element;\n /** The id react-aria's trigger points its `aria-controls` at. */\n id?: string;\n onOpenChange: (isOpen: boolean) => void;\n ref?: Ref<HTMLElement>;\n triggerRef: RefObject<Element | null>;\n}\n\ninterface NonModalPopoverContentInnerProps extends Omit<\n NonModalPopoverContentProps,\n \"ref\"\n> {\n overlayRef: RefObject<HTMLDivElement | null>;\n isExiting: boolean;\n}\n\n/*\n * `useOverlayPosition` recalculates when the window resizes, when a scroll\n * container scrolls, and when the anchor or the popover changes *size*. It never\n * notices the anchor merely *moving*, because a popover normally opens on a user\n * interaction, long after the page settled.\n *\n * This one opens itself, so it places itself into a page that is still filling\n * in — and anything appearing above the anchor then pushes the anchor out from\n * under it. Remotely that is the normal case, not an edge case: the host\n * materializes the page in pieces as they arrive over the connection.\n *\n * Observing the ancestors covers it. In block layout an element moves because\n * something around it changed size, and a resized ancestor is the one signal\n * every such reflow has in common. What it does not catch is an ancestor of\n * fixed height rearranging inside — rare, and the next scroll or resize\n * corrects it.\n */\nconst useRepositionWhenAnchorMoves = (\n anchorRef: RefObject<Element | null>,\n isOpen: boolean,\n updatePosition: () => void,\n): void => {\n useEffect(() => {\n // Read inside the effect. A coach mark that is open from its first render\n // renders before the anchor's ref is attached, and a ref filling in does not\n // re-render anything — so reading during render would see `null`, bail, and\n // leave nothing observing.\n const anchor = anchorRef.current;\n\n if (!isOpen || !anchor) {\n return;\n }\n\n const observer = new ResizeObserver(updatePosition);\n\n for (\n let element = anchor.parentElement;\n element;\n element = element.parentElement\n ) {\n observer.observe(element);\n }\n\n return () => observer.disconnect();\n }, [anchorRef, isOpen, updatePosition]);\n};\n\n/*\n * The non-modal popover deliberately skips react-aria's `usePopover`, which is\n * what a popover normally builds on. That hook couples three things Flow does\n * not want here: it locks page scrolling, it hides the rest of the page from\n * assistive tech, and — the reason this component exists — it closes the\n * popover on the first scroll, with no way to opt out.\n *\n * What is left is `useOverlayPosition` for the anchoring, public react-aria API.\n * The popover therefore tracks its trigger while the page scrolls, and its\n * content stays plain content: no role, no label, no focus of its own.\n *\n * It is not portalled either. A popover that is announced by nothing has to be\n * findable where it belongs, and a portal to the end of `<body>` puts it behind\n * the whole page in reading order — so it renders where it was written, right\n * next to what it points at. Being absolutely positioned it still takes no\n * space; what it does inherit is its surroundings, so an ancestor that clips\n * (`overflow: hidden`) or a stacking context can cut it off.\n *\n * Mounting is split across two components for the same reason `Aria.Popover`\n * splits it: the closing animation has to outlive `isOpen`, so the element that\n * plays it cannot be unmounted by the render that closes it. This outer half\n * keeps the ref and the mount decision and survives across open and closed; the\n * inner half holds the positioning and remounts on every open, which is what\n * resets the entry animation.\n */\nexport const NonModalPopoverContent: FC<NonModalPopoverContentProps> = (\n props,\n) => {\n const { isOpen = false, ref, ...rest } = props;\n\n const overlayRef = useObjectRef(ref as Ref<HTMLDivElement>);\n\n const isExiting = useExitAnimation(overlayRef, isOpen);\n\n if (!isOpen && !isExiting) {\n return null;\n }\n\n return (\n <NonModalPopoverContentInner\n {...rest}\n overlayRef={overlayRef}\n isOpen={isOpen}\n isExiting={isExiting}\n />\n );\n};\n\nconst NonModalPopoverContentInner: FC<NonModalPopoverContentInnerProps> = (\n props,\n) => {\n const {\n children,\n className,\n withTip,\n isOpen = false,\n isExiting,\n width,\n id,\n onOpenChange,\n overlayRef,\n triggerRef,\n // Named one by one so that everything left over is a DOM prop and reaches\n // the element. Funnelling the rest into the positioning instead drops\n // `aria-*`, `data-*` and the like, which `Aria.Popover` forwards on the\n // modal path.\n placement: requestedPlacement,\n offset,\n crossOffset,\n maxHeight: ignoredMaxHeight,\n shouldFlip,\n shouldUpdatePosition,\n arrowBoundaryOffset,\n boundaryElement,\n ...rest\n } = props;\n\n void ignoredMaxHeight;\n\n const positionProps = {\n placement: requestedPlacement,\n offset,\n crossOffset,\n shouldFlip,\n shouldUpdatePosition,\n arrowBoundaryOffset,\n boundaryElement,\n };\n\n const arrowRef = useRef<HTMLDivElement>(null);\n const detailsId = useId();\n\n const { overlayProps, arrowProps, placement, updatePosition } =\n useOverlayPosition({\n ...positionProps,\n targetRef: triggerRef,\n overlayRef,\n arrowRef,\n isOpen,\n offset: positionProps.offset ?? 8,\n containerPadding: popoverViewportPadding,\n });\n\n useRepositionWhenAnchorMoves(triggerRef, isOpen, updatePosition);\n\n /*\n * Until it has a placement, `useOverlayPosition` parks the popover in the top\n * left corner (`position: fixed; top: 0; left: 0`) — it has not measured the\n * anchor yet. Rendered on a server that corner is what ships, and the popover\n * sits there until hydration measures; an anchor given by id is resolved a\n * frame later still. Either way it is visibly in the wrong place first and\n * jumps to the anchor after, so keep it out of sight until it knows where it\n * belongs. It stays in the DOM, which is what its place in the reading order\n * and `aria-details` depend on.\n */\n const isPositioned = placement !== null;\n\n // Held back until the popover knows where it belongs — an entry animation\n // that plays while the popover is still hidden is one the user never sees.\n const isEntering = useEnterAnimation(overlayRef, isPositioned);\n\n /*\n * Nothing announces this popover, so the trigger points at it: `aria-details`\n * tells assistive tech that there is related content and offers a way over to\n * it — unlike `aria-describedby`, which would flatten the popover into a\n * string and put its buttons out of reach.\n *\n * Set on the trigger element itself, because that element belongs to whoever\n * rendered it. Whatever it carried before is restored on the way out.\n */\n useEffect(() => {\n const trigger = triggerRef.current;\n\n if (!isOpen || !trigger) {\n return;\n }\n\n const previous = trigger.getAttribute(\"aria-details\");\n trigger.setAttribute(\n \"aria-details\",\n previous ? `${previous} ${detailsId}` : detailsId,\n );\n\n return () => {\n if (previous === null) {\n trigger.removeAttribute(\"aria-details\");\n } else {\n trigger.setAttribute(\"aria-details\", previous);\n }\n };\n }, [isOpen, triggerRef, detailsId]);\n\n // Escape closes it. react-aria would do this through `useOverlay`, which is\n // part of the machinery this component leaves out.\n useEffect(() => {\n if (!isOpen) {\n return;\n }\n\n const closeOnEscape = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") {\n onOpenChange(false);\n }\n };\n\n document.addEventListener(\"keydown\", closeOnEscape);\n return () => document.removeEventListener(\"keydown\", closeOnEscape);\n }, [isOpen, onOpenChange]);\n\n return (\n <div\n {...rest}\n {...overlayProps}\n id={id}\n ref={overlayRef}\n className={clsx(className, styles[\"non-modal\"])}\n data-placement={placement ?? undefined}\n data-entering={isEntering || undefined}\n data-exiting={isExiting || undefined}\n style={{\n ...overlayProps.style,\n /*\n * Two things `useOverlayPosition` adds for an overlay portalled to the\n * end of `<body>` and pinned to the viewport. This one renders where it\n * stands and scrolls with the page, so both are wrong here.\n *\n * `z-index: 100000` would put it in front of the whole application — it\n * scrolled over the docs site's sticky header. Claiming no stacking\n * level leaves that to the page: it still covers the ordinary content\n * around it, and app chrome that sets a `z-index` keeps its place above.\n *\n * The `max-height` it caps the overlay at is wrong here for the same\n * reason, but it is written straight onto the element and has to be\n * undone in CSS — see `.non-modal` in Popover.module.scss.\n */\n zIndex: undefined,\n ...popoverWidthStyle(width),\n ...(isPositioned ? {} : { visibility: \"hidden\" }),\n }}\n >\n {withTip && (\n <div\n {...arrowProps}\n ref={arrowRef}\n className={styles.tip}\n data-placement={placement ?? undefined}\n style={{\n // What <Aria.OverlayArrow /> contributes on top of `arrowProps`:\n // it lifts the tip out of the flow and centres it on the anchor.\n position: \"absolute\",\n transform:\n placement === \"top\" || placement === \"bottom\"\n ? \"translateX(-50%)\"\n : \"translateY(-50%)\",\n // `arrowProps.style` carries the offset along the popover's edge and\n // leaves the other axis `undefined` — which still overwrites. So the\n // edge the tip sits on is set last: spread first, it silently lost\n // `top: 100%` and the tip jumped to the popover's top edge, pointing\n // away from an anchor that was below it.\n ...arrowProps.style,\n ...(placement ? { [placement]: \"100%\" } : {}),\n }}\n >\n <svg width={16} height={16} viewBox=\"0 0 16 16\">\n <path d=\"M0 0 L8 8 L16 0\" />\n </svg>\n </div>\n )}\n <div className={styles.content} id={detailsId}>\n {children}\n </div>\n </div>\n );\n};\n\nexport default NonModalPopoverContent;\n"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Section.module.mjs","names":[],"sources":["../../../../../../../src/components/Section/Section.module.scss"],"sourcesContent":[".section {\n display: flex;\n flex-direction: column;\n row-gap: var(--section--spacing);\n
|
|
1
|
+
{"version":3,"file":"Section.module.mjs","names":[],"sources":["../../../../../../../src/components/Section/Section.module.scss"],"sourcesContent":[".section {\n display: flex;\n flex-direction: column;\n row-gap: var(--section--spacing);\n width: 100%;\n min-width: 0;\n\n > form {\n display: flex;\n flex-direction: column;\n row-gap: var(--section--spacing);\n }\n\n /* Children that render nothing still leave the element behind — the guard in\n Section.tsx only sees the child, not its output (a boundary returning null,\n an empty fragment, a map over an empty array). Collapse it so it neither\n draws its own separator nor claims section-to-section spacing, while\n staying in the sibling chain so the next section keeps exactly one\n separator. */\n &:empty {\n display: none;\n }\n\n + .section {\n margin-block-start: var(--section--section-to-section-spacing);\n }\n\n &:not(.hideSeparator) + .section {\n border-block-start: var(--separator--height) var(--border-style--default)\n var(--separator--color);\n padding-block-start: var(--section--section-to-section-spacing);\n }\n\n h2.heading:not(:first-child),\n h3.heading:not(:first-child) {\n margin-top: var(--section--sub-heading-spacing-m);\n }\n\n h4.heading:not(:first-child),\n h5.heading:not(:first-child),\n h6.heading:not(:first-child) {\n margin-top: var(--section--sub-heading-spacing-s);\n }\n}\n"],"mappings":""}
|
|
@@ -10,7 +10,7 @@ import { FieldDescription } from "../FieldDescription/FieldDescription.mjs";
|
|
|
10
10
|
import TextArea_module_default from "./TextArea.module.mjs";
|
|
11
11
|
import __locale_default from "../../../../../_virtual/_23.locale.mjs";
|
|
12
12
|
import clsx from "clsx";
|
|
13
|
-
import { useEffect, useState } from "react";
|
|
13
|
+
import { useEffect, useLayoutEffect, useState } from "react";
|
|
14
14
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
15
15
|
import { useObjectRef } from "@react-aria/utils";
|
|
16
16
|
import * as Aria from "react-aria-components";
|
|
@@ -18,8 +18,7 @@ import * as Aria from "react-aria-components";
|
|
|
18
18
|
/** @flr-generate all */
|
|
19
19
|
var TextArea = flowComponent("TextArea", (props) => {
|
|
20
20
|
const warnDeprecation = useWarnDeprecation();
|
|
21
|
-
const { children, placeholder, rows = 5, autoResizeMaxRows = rows, ref, allowVerticalResize, allowHorizontalResize, showCharacterCount, className, onChange, isReadOnly, ...rest } = useControlledHostValueProps(props, "");
|
|
22
|
-
const [charactersCount, setCharactersCount] = useState(props.defaultValue?.length ?? props.value?.length ?? 0);
|
|
21
|
+
const { children, placeholder, rows = 5, autoResizeMaxRows = rows, ref, allowVerticalResize, allowHorizontalResize, showCharacterCount, className, onChange, isReadOnly, value, ...rest } = useControlledHostValueProps(props, "");
|
|
23
22
|
if (allowHorizontalResize !== void 0) warnDeprecation("The 'allowHorizontalResize' prop is deprecated and will be removed in a future release. Use 'allowResize' instead.");
|
|
24
23
|
if (allowVerticalResize !== void 0) warnDeprecation("The 'allowVerticalResize' prop is deprecated and will be removed in a future release. Use 'allowResize' instead.");
|
|
25
24
|
const { FieldErrorView, FieldErrorCaptureContext, fieldPropsContext, fieldProps } = useFieldComponent(props, "TextArea");
|
|
@@ -30,11 +29,10 @@ var TextArea = flowComponent("TextArea", (props) => {
|
|
|
30
29
|
const inputClassName = clsx(TextArea_module_default.input, typeof allowResize === "boolean" && allowResize ? TextArea_module_default.resize : null, allowResize === "horizontal" ? TextArea_module_default.horizontalResize : allowResize === "vertical" ? TextArea_module_default.verticalResize : null);
|
|
31
30
|
const handleChange = (v) => {
|
|
32
31
|
if (isReadOnly) return;
|
|
33
|
-
if (showCharacterCount) setCharactersCount(v.length);
|
|
34
32
|
if (onChange) onChange(v);
|
|
35
33
|
};
|
|
36
34
|
const charactersCountDescription = useLocalizedStringFormatter(__locale_default, "TextArea").format("characters", {
|
|
37
|
-
count:
|
|
35
|
+
count: value.length,
|
|
38
36
|
maxCount: props.maxLength ?? 0
|
|
39
37
|
});
|
|
40
38
|
const localRef = useObjectRef(ref);
|
|
@@ -71,16 +69,20 @@ var TextArea = flowComponent("TextArea", (props) => {
|
|
|
71
69
|
window.removeEventListener("mouseup", handleMouseUp);
|
|
72
70
|
};
|
|
73
71
|
}, [resized]);
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
72
|
+
useLayoutEffect(() => {
|
|
73
|
+
const textArea = localRef.current;
|
|
74
|
+
if (!textArea || !autoResizable || verticallyResizable) return;
|
|
75
|
+
textArea.style.height = "0px";
|
|
76
|
+
textArea.style.height = `${textArea.scrollHeight + 2}px`;
|
|
77
|
+
}, [
|
|
78
|
+
value,
|
|
79
|
+
autoResizable,
|
|
80
|
+
verticallyResizable
|
|
81
|
+
]);
|
|
81
82
|
return /* @__PURE__ */ jsx(Aria.TextField, {
|
|
82
83
|
...rest,
|
|
83
84
|
...fieldProps,
|
|
85
|
+
value,
|
|
84
86
|
className: rootClassName,
|
|
85
87
|
onChange: handleChange,
|
|
86
88
|
children: /* @__PURE__ */ jsxs(PropsContextProvider, {
|
|
@@ -95,7 +97,6 @@ var TextArea = flowComponent("TextArea", (props) => {
|
|
|
95
97
|
placeholder,
|
|
96
98
|
className: inputClassName,
|
|
97
99
|
ref: localRef,
|
|
98
|
-
onChange: updateHeight,
|
|
99
100
|
style: {
|
|
100
101
|
caretColor: isReadOnly ? "transparent" : void 0,
|
|
101
102
|
minHeight: getHeight(rows),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea.mjs","names":[],"sources":["../../../../../../../src/components/TextArea/TextArea.tsx"],"sourcesContent":["import * as Aria from \"react-aria-components\";\nimport styles from \"./TextArea.module.scss\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { useObjectRef } from \"@react-aria/utils\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport clsx from \"clsx\";\nimport {
|
|
1
|
+
{"version":3,"file":"TextArea.mjs","names":[],"sources":["../../../../../../../src/components/TextArea/TextArea.tsx"],"sourcesContent":["import * as Aria from \"react-aria-components\";\nimport styles from \"./TextArea.module.scss\";\nimport type { FlowComponentProps } from \"@/lib/componentFactory/flowComponent\";\nimport { flowComponent } from \"@/lib/componentFactory/flowComponent\";\nimport { useObjectRef } from \"@react-aria/utils\";\nimport { useFieldComponent } from \"@/lib/hooks/useFieldComponent\";\nimport { PropsContextProvider } from \"@/lib/propsContext\";\nimport clsx from \"clsx\";\nimport {\n type PropsWithChildren,\n useEffect,\n useLayoutEffect,\n useState,\n} from \"react\";\nimport { useControlledHostValueProps } from \"@/lib/remote/useControlledHostValueProps\";\nimport { useLocalizedStringFormatter } from \"@/components/TranslationProvider/useLocalizedStringFormatter\";\nimport locales from \"./locales/*.locale.json\";\nimport { FieldDescription } from \"@/components/FieldDescription\";\nimport { useWarnDeprecation } from \"@/components/DeprecationWarningProvider\";\n\nexport interface TextAreaProps\n extends\n PropsWithChildren<Omit<Aria.TextFieldProps, \"children\">>,\n Pick<Aria.TextAreaProps, \"placeholder\" | \"rows\" | \"aria-hidden\">,\n FlowComponentProps<HTMLTextAreaElement> {\n /** Whether a character count should be displayed inside the field description. */\n showCharacterCount?: boolean;\n /**\n * Whether the text area should grow if its content gets longer than its\n * initial height.\n */\n autoResizeMaxRows?: number;\n /** Allows the user to manually resize the textArea horizontally. */\n allowResize?: boolean | \"horizontal\" | \"vertical\";\n /** @deprecated Use `allowResize` instead. */\n allowHorizontalResize?: boolean;\n /** @deprecated Use `allowResize` instead. */\n allowVerticalResize?: boolean;\n}\n\n/** @flr-generate all */\nexport const TextArea = flowComponent(\"TextArea\", (props) => {\n const warnDeprecation = useWarnDeprecation();\n const {\n children,\n placeholder,\n rows = 5,\n autoResizeMaxRows = rows,\n ref,\n allowVerticalResize,\n allowHorizontalResize,\n showCharacterCount,\n className,\n onChange,\n isReadOnly,\n value,\n ...rest\n } = useControlledHostValueProps(props, \"\");\n\n if (allowHorizontalResize !== undefined) {\n warnDeprecation(\n \"The 'allowHorizontalResize' prop is deprecated and will be removed in a future release. Use 'allowResize' instead.\",\n );\n }\n if (allowVerticalResize !== undefined) {\n warnDeprecation(\n \"The 'allowVerticalResize' prop is deprecated and will be removed in a future release. Use 'allowResize' instead.\",\n );\n }\n\n const {\n FieldErrorView,\n FieldErrorCaptureContext,\n fieldPropsContext,\n fieldProps,\n } = useFieldComponent(props, \"TextArea\");\n\n let { allowResize } = props;\n if (allowVerticalResize) {\n allowResize = \"vertical\";\n } else if (allowHorizontalResize) {\n allowResize = \"horizontal\";\n }\n\n const rootClassName = clsx(fieldProps.className, className);\n\n const inputClassName = clsx(\n styles.input,\n typeof allowResize === \"boolean\" && allowResize ? styles.resize : null,\n allowResize === \"horizontal\"\n ? styles.horizontalResize\n : allowResize === \"vertical\"\n ? styles.verticalResize\n : null,\n );\n\n const handleChange = (v: string) => {\n if (isReadOnly) {\n return;\n }\n\n if (onChange) {\n onChange(v);\n }\n };\n\n const translation = useLocalizedStringFormatter(locales, \"TextArea\");\n\n // Derived, so that a value the field never saw typed is counted as well.\n const charactersCountDescription = translation.format(\"characters\", {\n count: value.length,\n maxCount: props.maxLength ?? 0,\n });\n\n const localRef = useObjectRef(ref);\n\n const getHeight = (rows: number) => {\n return `calc(var(--line-height-m) * ${rows} + (var(--form-control--padding-y) * 2))`;\n };\n\n const [resized, setResized] = useState(false);\n\n const autoResizable = rows !== autoResizeMaxRows;\n\n const verticallyResizable =\n allowResize && (!autoResizable || (autoResizable && resized));\n\n useEffect(() => {\n const textarea = localRef.current;\n if (!textarea) return;\n\n const startHeight = textarea.offsetHeight;\n let tracking = false;\n\n const handleMouseDown = () => {\n tracking = true;\n };\n\n const handleMouseMove = () => {\n if (!tracking || resized) return;\n\n const currentHeight = textarea.offsetHeight;\n\n if (currentHeight !== startHeight) {\n setResized(true);\n tracking = false;\n }\n };\n\n const handleMouseUp = () => {\n tracking = false;\n };\n\n window.addEventListener(\"mousedown\", handleMouseDown);\n window.addEventListener(\"mousemove\", handleMouseMove);\n window.addEventListener(\"mouseup\", handleMouseUp);\n\n return () => {\n window.removeEventListener(\"mousedown\", handleMouseDown);\n window.removeEventListener(\"mousemove\", handleMouseMove);\n window.removeEventListener(\"mouseup\", handleMouseUp);\n };\n }, [resized]);\n\n /*\n * The height depends on the rendered content, so it cannot be a style. It is\n * synced to the value instead of to the `change` event, because a value the\n * field never saw typed — an initial value, or a draft loaded into a\n * controlled field — has to resize it just the same.\n */\n useLayoutEffect(() => {\n const textArea = localRef.current;\n if (!textArea || !autoResizable || verticallyResizable) {\n return;\n }\n // https://stackoverflow.com/a/60795884\n textArea.style.height = \"0px\";\n // + 2 to add border height\n textArea.style.height = `${textArea.scrollHeight + 2}px`;\n }, [value, autoResizable, verticallyResizable]);\n\n return (\n <Aria.TextField\n {...rest}\n {...fieldProps}\n value={value}\n className={rootClassName}\n onChange={handleChange}\n >\n <PropsContextProvider props={fieldPropsContext}>\n <FieldErrorCaptureContext>{children}</FieldErrorCaptureContext>\n <Aria.TextArea\n rows={rows}\n {...(isReadOnly ? { \"data-readonly\": true } : {})}\n aria-readonly={isReadOnly}\n aria-hidden={props[\"aria-hidden\"]}\n placeholder={placeholder}\n className={inputClassName}\n ref={localRef}\n style={{\n caretColor: isReadOnly ? \"transparent\" : undefined,\n minHeight: getHeight(rows),\n maxHeight: verticallyResizable\n ? undefined\n : getHeight(autoResizeMaxRows),\n }}\n />\n {showCharacterCount && (\n <FieldDescription>{charactersCountDescription}</FieldDescription>\n )}\n <FieldErrorView />\n </PropsContextProvider>\n </Aria.TextField>\n );\n});\n\nexport default TextArea;\n"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.module.mjs","names":[],"sources":["../../../../../../../src/components/Tooltip/Tooltip.module.scss"],"sourcesContent":[".tooltip {\n border-radius: var(--tooltip--corner-radius);\n background-color: var(--tooltip--background-color);\n color: var(--tooltip--color);\n font-size: var(--tooltip--font-size);\n padding-block: var(--tooltip--padding-y);\n padding-inline: var(--tooltip--padding-x);\n max-width: var(--tooltip--max-width);\n transform: translate3d(0, 0, 0);\n box-shadow: var(--tooltip--box-shadow);\n\n --translate-origin-length: var(--tooltip--tooltip-to-trigger-spacing) / 2;\n\n /* Placement */\n &[data-placement=\"top\"] {\n margin-bottom: var(--tooltip--tooltip-to-trigger-spacing);\n\n --translate-origin: translateY(var(--translate-origin-length));\n }\n\n &[data-placement=\"bottom\"] {\n margin-top: var(--tooltip--tooltip-to-trigger-spacing);\n\n --translate-origin: translateY(var(--translate-origin-length) * -1);\n\n .tip svg {\n transform: rotate(180deg);\n }\n }\n\n &[data-placement=\"right\"] {\n margin-inline-start: var(--tooltip--tooltip-to-trigger-spacing);\n\n --translate-origin: translateX(var(--translate-origin-length) * -1);\n\n .tip svg {\n transform: rotate(90deg);\n }\n }\n\n &[data-placement=\"left\"] {\n margin-inline-end: var(--tooltip--tooltip-to-trigger-spacing);\n\n --translate-origin: translateX(var(--translate-origin-length));\n\n .tip svg {\n transform: rotate(-90deg);\n }\n }\n\n /* Animation */\n\n &[data-entering] {\n animation: slide 200ms;\n }\n\n &[data-exiting] {\n animation: slide 200ms reverse ease-in;\n }\n\n .tip {\n width: var(--tooltip--tip-size);\n height: var(--tooltip--tip-size);\n\n svg {\n display: block;\n fill: var(--tooltip--background-color);\n }\n }\n}\n\n@keyframes slide {\n from {\n transform: var(--translate-origin);\n opacity: 0;\n }\n\n to {\n transform: translateY(0);\n opacity: 1;\n }\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"Tooltip.module.mjs","names":[],"sources":["../../../../../../../src/components/Tooltip/Tooltip.module.scss"],"sourcesContent":[".tooltip {\n border-radius: var(--tooltip--corner-radius);\n background-color: var(--tooltip--background-color);\n color: var(--tooltip--color);\n font-size: var(--tooltip--font-size);\n padding-block: var(--tooltip--padding-y);\n padding-inline: var(--tooltip--padding-x);\n max-width: var(--tooltip--max-width);\n transform: translate3d(0, 0, 0);\n box-shadow: var(--tooltip--box-shadow);\n\n --translate-origin-length: var(--tooltip--tooltip-to-trigger-spacing) / 2;\n\n /**\n * React Aria sets `data-placement` once it has computed a position, and\n * renders the overlay at `top: 0; left: 0` of the viewport until then. It\n * skips computing one when the tooltip mounts for its exit animation alone –\n * swapping quickly between neighbouring triggers does that – and never\n * retries afterwards, so such a tooltip stays parked in the corner for its\n * whole lifetime. Keep it out of sight instead. `visibility` rather than\n * `display`, so the overlay stays measurable for the positioning pass.\n */\n &:not([data-placement]) {\n visibility: hidden;\n }\n\n /* Placement */\n &[data-placement=\"top\"] {\n margin-bottom: var(--tooltip--tooltip-to-trigger-spacing);\n\n --translate-origin: translateY(var(--translate-origin-length));\n }\n\n &[data-placement=\"bottom\"] {\n margin-top: var(--tooltip--tooltip-to-trigger-spacing);\n\n --translate-origin: translateY(var(--translate-origin-length) * -1);\n\n .tip svg {\n transform: rotate(180deg);\n }\n }\n\n &[data-placement=\"right\"] {\n margin-inline-start: var(--tooltip--tooltip-to-trigger-spacing);\n\n --translate-origin: translateX(var(--translate-origin-length) * -1);\n\n .tip svg {\n transform: rotate(90deg);\n }\n }\n\n &[data-placement=\"left\"] {\n margin-inline-end: var(--tooltip--tooltip-to-trigger-spacing);\n\n --translate-origin: translateX(var(--translate-origin-length));\n\n .tip svg {\n transform: rotate(-90deg);\n }\n }\n\n /* Animation */\n\n &[data-entering] {\n animation: slide 200ms;\n }\n\n &[data-exiting] {\n animation: slide 200ms reverse ease-in;\n }\n\n .tip {\n width: var(--tooltip--tip-size);\n height: var(--tooltip--tip-size);\n\n svg {\n display: block;\n fill: var(--tooltip--background-color);\n }\n }\n}\n\n@keyframes slide {\n from {\n transform: var(--translate-origin);\n opacity: 0;\n }\n\n to {\n transform: translateY(0);\n opacity: 1;\n }\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
/* */
|
|
3
|
+
//#region src/lib/files/acceptedFiles.ts
|
|
4
|
+
/**
|
|
5
|
+
* Whether a file matches an `accept` attribute value — a comma separated list
|
|
6
|
+
* of MIME types (`image/png`), MIME wildcards (`image/*`) and file extensions
|
|
7
|
+
* (`.png`). A missing or empty list matches everything, the way the attribute
|
|
8
|
+
* itself does.
|
|
9
|
+
*
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
var matchesAccept = (file, accept) => {
|
|
13
|
+
const tokens = accept?.split(",").map((token) => token.trim().toLowerCase()).filter(Boolean) ?? [];
|
|
14
|
+
if (tokens.length === 0) return true;
|
|
15
|
+
const type = file.type.toLowerCase();
|
|
16
|
+
const name = file.name.toLowerCase();
|
|
17
|
+
return tokens.some((token) => {
|
|
18
|
+
if (token.startsWith(".")) return name.endsWith(token);
|
|
19
|
+
if (token.endsWith("/*")) return type.startsWith(token.slice(0, -1));
|
|
20
|
+
return type === token;
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* The files of a drop event that match `accept`. Non-file items (dragged text,
|
|
25
|
+
* directories) are skipped, and the filter runs on the drop item — so a file
|
|
26
|
+
* `accept` rejects is never read from disk.
|
|
27
|
+
*
|
|
28
|
+
* @internal
|
|
29
|
+
*/
|
|
30
|
+
var getAcceptedFiles = async (items, accept) => await Promise.all(items.filter((item) => item.kind === "file").filter((item) => matchesAccept(item, accept)).map(async (item) => await item.getFile()));
|
|
31
|
+
//#endregion
|
|
32
|
+
export { getAcceptedFiles, matchesAccept };
|
|
33
|
+
|
|
34
|
+
//# sourceMappingURL=acceptedFiles.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acceptedFiles.mjs","names":[],"sources":["../../../../../../../src/lib/files/acceptedFiles.ts"],"sourcesContent":["import type { DropItem } from \"@react-types/shared\";\n\n/**\n * Whether a file matches an `accept` attribute value — a comma separated list\n * of MIME types (`image/png`), MIME wildcards (`image/*`) and file extensions\n * (`.png`). A missing or empty list matches everything, the way the attribute\n * itself does.\n *\n * @internal\n */\nexport const matchesAccept = (\n file: Pick<File, \"name\" | \"type\">,\n accept?: string,\n): boolean => {\n const tokens =\n accept\n ?.split(\",\")\n .map((token) => token.trim().toLowerCase())\n .filter(Boolean) ?? [];\n\n if (tokens.length === 0) {\n return true;\n }\n\n const type = file.type.toLowerCase();\n const name = file.name.toLowerCase();\n\n return tokens.some((token) => {\n if (token.startsWith(\".\")) {\n return name.endsWith(token);\n }\n if (token.endsWith(\"/*\")) {\n return type.startsWith(token.slice(0, -1));\n }\n return type === token;\n });\n};\n\n/**\n * The files of a drop event that match `accept`. Non-file items (dragged text,\n * directories) are skipped, and the filter runs on the drop item — so a file\n * `accept` rejects is never read from disk.\n *\n * @internal\n */\nexport const getAcceptedFiles = async (\n items: readonly DropItem[],\n accept?: string,\n): Promise<File[]> =>\n await Promise.all(\n items\n .filter((item) => item.kind === \"file\")\n .filter((item) => matchesAccept(item, accept))\n .map(async (item) => await item.getFile()),\n );\n"],"mappings":";;;;;;;;;;;AAUA,IAAa,iBACX,MACA,WACY;CACZ,MAAM,SACJ,QACI,MAAM,GAAG,CAAC,CACX,KAAK,UAAU,MAAM,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,CAC1C,OAAO,OAAO,KAAK,CAAC;CAEzB,IAAI,OAAO,WAAW,GACpB,OAAO;CAGT,MAAM,OAAO,KAAK,KAAK,YAAY;CACnC,MAAM,OAAO,KAAK,KAAK,YAAY;CAEnC,OAAO,OAAO,MAAM,UAAU;EAC5B,IAAI,MAAM,WAAW,GAAG,GACtB,OAAO,KAAK,SAAS,KAAK;EAE5B,IAAI,MAAM,SAAS,IAAI,GACrB,OAAO,KAAK,WAAW,MAAM,MAAM,GAAG,EAAE,CAAC;EAE3C,OAAO,SAAS;CAClB,CAAC;AACH;;;;;;;;AASA,IAAa,mBAAmB,OAC9B,OACA,WAEA,MAAM,QAAQ,IACZ,MACG,QAAQ,SAAS,KAAK,SAAS,MAAM,CAAC,CACtC,QAAQ,SAAS,cAAc,MAAM,MAAM,CAAC,CAAC,CAC7C,IAAI,OAAO,SAAS,MAAM,KAAK,QAAQ,CAAC,CAC7C"}
|
package/dist/js/packages/components/src/lib/hooks/dom/useKeepBrowserExtensionsInteractive.mjs
CHANGED
|
@@ -59,6 +59,6 @@ var useKeepBrowserExtensionsInteractive = (isActive) => {
|
|
|
59
59
|
}, [isActive]);
|
|
60
60
|
};
|
|
61
61
|
//#endregion
|
|
62
|
-
export { useKeepBrowserExtensionsInteractive as default, useKeepBrowserExtensionsInteractive };
|
|
62
|
+
export { useKeepBrowserExtensionsInteractive as default, useKeepBrowserExtensionsInteractive, isBrowserExtensionNode };
|
|
63
63
|
|
|
64
64
|
//# sourceMappingURL=useKeepBrowserExtensionsInteractive.mjs.map
|
package/dist/js/packages/components/src/lib/hooks/dom/useKeepBrowserExtensionsInteractive.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useKeepBrowserExtensionsInteractive.mjs","names":[],"sources":["../../../../../../../../src/lib/hooks/dom/useKeepBrowserExtensionsInteractive.ts"],"sourcesContent":["import { useEffect } from \"react\";\n\n/**\n * Attribute react-aria checks to keep a node out of the `inert` / `aria-hidden`\n * isolation it applies to everything outside an open modal overlay.\n *\n * @see `isAlwaysVisibleNode` in `@react-aria/overlays` (`ariaHideOutside`)\n */\nconst keepInteractiveAttribute = \"data-react-aria-top-layer\";\n\nconst extensionUrlSchemes = [\n \"chrome-extension:\",\n \"moz-extension:\",\n \"safari-web-extension:\",\n \"safari-extension:\",\n];\n\
|
|
1
|
+
{"version":3,"file":"useKeepBrowserExtensionsInteractive.mjs","names":[],"sources":["../../../../../../../../src/lib/hooks/dom/useKeepBrowserExtensionsInteractive.ts"],"sourcesContent":["import { useEffect } from \"react\";\n\n/**\n * Attribute react-aria checks to keep a node out of the `inert` / `aria-hidden`\n * isolation it applies to everything outside an open modal overlay.\n *\n * @see `isAlwaysVisibleNode` in `@react-aria/overlays` (`ariaHideOutside`)\n */\nconst keepInteractiveAttribute = \"data-react-aria-top-layer\";\n\nconst extensionUrlSchemes = [\n \"chrome-extension:\",\n \"moz-extension:\",\n \"safari-web-extension:\",\n \"safari-extension:\",\n];\n\nexport const isBrowserExtensionNode = (element: Element): boolean => {\n if (element.tagName.includes(\"-\")) {\n return true;\n }\n if (element.shadowRoot !== null) {\n return true;\n }\n if (element instanceof HTMLIFrameElement) {\n const source = element.getAttribute(\"src\") ?? \"\";\n return extensionUrlSchemes.some((scheme) => source.startsWith(scheme));\n }\n return false;\n};\n\nconst keepInteractive = (element: Element): void => {\n if (!element.hasAttribute(keepInteractiveAttribute)) {\n element.setAttribute(keepInteractiveAttribute, \"\");\n }\n if (element instanceof HTMLElement && element.inert) {\n element.inert = false;\n }\n if (element.getAttribute(\"aria-hidden\") === \"true\") {\n element.removeAttribute(\"aria-hidden\");\n }\n};\n\n/**\n * While a modal overlay is open, react-aria isolates the rest of the document\n * by setting `inert` on every sibling of the modal (see `ariaHideOutside`) —\n * and it keeps doing so for nodes that appear afterwards via a\n * `MutationObserver`. That also catches UI a browser extension injects while\n * the modal is open, e.g. a password manager's autofill dropdown on a field, or\n * its \"save credentials\" popover. An `inert` node stays visible but cannot be\n * clicked, so the user sees the extension UI but cannot interact with it.\n *\n * This hook watches the document while `isActive` and re-enables such\n * extension-injected, document-level nodes, so browser extensions keep working\n * on top of modals. It targets the structural fingerprint of extension UI (see\n * {@link isBrowserExtensionNode}) rather than a fixed list of vendors.\n */\nexport const useKeepBrowserExtensionsInteractive = (\n isActive: boolean,\n): void => {\n useEffect(() => {\n if (!isActive || typeof MutationObserver === \"undefined\") {\n return;\n }\n\n const root = document.body;\n\n const process = (node: Node): void => {\n if (node instanceof Element && isBrowserExtensionNode(node)) {\n keepInteractive(node);\n }\n };\n\n for (const child of Array.from(root.children)) {\n process(child);\n }\n\n const observer = new MutationObserver((mutations) => {\n for (const mutation of mutations) {\n for (const node of Array.from(mutation.addedNodes)) {\n process(node);\n }\n }\n });\n observer.observe(root, { childList: true });\n\n return () => observer.disconnect();\n }, [isActive]);\n};\n\nexport default useKeepBrowserExtensionsInteractive;\n"],"mappings":";;;;;;;;;;AAQA,IAAM,2BAA2B;AAEjC,IAAM,sBAAsB;CAC1B;CACA;CACA;CACA;AACF;AAEA,IAAa,0BAA0B,YAA8B;CACnE,IAAI,QAAQ,QAAQ,SAAS,GAAG,GAC9B,OAAO;CAET,IAAI,QAAQ,eAAe,MACzB,OAAO;CAET,IAAI,mBAAmB,mBAAmB;EACxC,MAAM,SAAS,QAAQ,aAAa,KAAK,KAAK;EAC9C,OAAO,oBAAoB,MAAM,WAAW,OAAO,WAAW,MAAM,CAAC;CACvE;CACA,OAAO;AACT;AAEA,IAAM,mBAAmB,YAA2B;CAClD,IAAI,CAAC,QAAQ,aAAa,wBAAwB,GAChD,QAAQ,aAAa,0BAA0B,EAAE;CAEnD,IAAI,mBAAmB,eAAe,QAAQ,OAC5C,QAAQ,QAAQ;CAElB,IAAI,QAAQ,aAAa,aAAa,MAAM,QAC1C,QAAQ,gBAAgB,aAAa;AAEzC;;;;;;;;;;;;;;;AAgBA,IAAa,uCACX,aACS;CACT,gBAAgB;EACd,IAAI,CAAC,YAAY,OAAO,qBAAqB,aAC3C;EAGF,MAAM,OAAO,SAAS;EAEtB,MAAM,WAAW,SAAqB;GACpC,IAAI,gBAAgB,WAAW,uBAAuB,IAAI,GACxD,gBAAgB,IAAI;EAExB;EAEA,KAAK,MAAM,SAAS,MAAM,KAAK,KAAK,QAAQ,GAC1C,QAAQ,KAAK;EAGf,MAAM,WAAW,IAAI,kBAAkB,cAAc;GACnD,KAAK,MAAM,YAAY,WACrB,KAAK,MAAM,QAAQ,MAAM,KAAK,SAAS,UAAU,GAC/C,QAAQ,IAAI;EAGlB,CAAC;EACD,SAAS,QAAQ,MAAM,EAAE,WAAW,KAAK,CAAC;EAE1C,aAAa,SAAS,WAAW;CACnC,GAAG,CAAC,QAAQ,CAAC;AACf"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { CartesianChartLayout } from './types';
|
|
2
2
|
interface CartesianChartContext {
|
|
3
3
|
layout: CartesianChartLayout;
|
|
4
|
+
/**
|
|
5
|
+
* Prefix that scopes a stack ID to this chart. Recharts derives DOM IDs from
|
|
6
|
+
* the stack ID, so two charts on one page sharing a stack ID would otherwise
|
|
7
|
+
* share their clip paths.
|
|
8
|
+
*/
|
|
9
|
+
stackIdPrefix: string;
|
|
4
10
|
}
|
|
5
11
|
export declare const useCartesianChartContext: () => CartesianChartContext;
|
|
6
12
|
export declare const CartesianChartContextProvider: import('react').Provider<CartesianChartContext>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { StackId } from 'recharts/types/util/ChartUtils';
|
|
2
|
+
/**
|
|
3
|
+
* Scopes a stack ID to the surrounding chart, so that charts on the same page
|
|
4
|
+
* using the same stack ID do not share the DOM IDs Recharts derives from it.
|
|
5
|
+
*/
|
|
6
|
+
export declare const useScopedStackId: (stackId: StackId | undefined) => string | undefined;
|
|
@@ -54,6 +54,7 @@ export { IconUnorderedList } from './IconUnorderedList';
|
|
|
54
54
|
export { IconUpload } from './IconUpload';
|
|
55
55
|
export { IconView } from './IconView';
|
|
56
56
|
export { IconAI } from './IconAI';
|
|
57
|
+
export { IconAIHosting } from './IconAIHosting';
|
|
57
58
|
export { IconAnalytics } from './IconAnalytics';
|
|
58
59
|
export { IconApp } from './IconApp';
|
|
59
60
|
export { IconAutoresponder } from './IconAutoresponder';
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { ResolvedPolicyValidationResult } from '../../PasswordCreationField';
|
|
3
|
-
import { PropsWithClassName } from '../../../../lib/types/props';
|
|
4
|
-
interface Props extends PropsWithClassName {
|
|
5
|
-
policyValidationResult?: ResolvedPolicyValidationResult;
|
|
6
|
-
isDisabled?: boolean;
|
|
7
|
-
isEmptyValue: boolean;
|
|
8
|
-
}
|
|
9
|
-
export declare const ValidationResultButton: FC<Props>;
|
|
10
1
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
import { RuleValidationResult } from '../../../integrations/@mittwald/password-tools-js';
|
|
2
|
-
export declare const generateValidationTranslation: (r: Partial<RuleValidationResult>, shotVersion?: boolean) => [string, Record<string, string | number | boolean> | undefined];
|
|
3
1
|
export default generateValidationTranslation;
|
package/dist/types/components/PasswordCreationField/lib/getStatusFromPolicyValidationResult.d.ts
CHANGED
|
@@ -1,4 +1 @@
|
|
|
1
|
-
import { ResolvedPolicyValidationResult } from '../PasswordCreationField';
|
|
2
|
-
import { ComplexityStatus } from '../components/ComplexityIndicator/ComplexityIndicator';
|
|
3
|
-
export declare const getStatusFromPolicyValidationResult: (isValid: ResolvedPolicyValidationResult["isValid"], result: ResolvedPolicyValidationResult) => ComplexityStatus;
|
|
4
1
|
export default getStatusFromPolicyValidationResult;
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { ResolvedPolicyValidationResult } from '../PasswordCreationField';
|
|
3
|
-
export declare const usePolicyValidationResult: (validationPolicy: Policy, password: string, onValidationStart?: () => void, onValidationResult?: (data: {
|
|
4
|
-
password: string;
|
|
5
|
-
isValid: boolean;
|
|
6
|
-
results: ResolvedPolicyValidationResult;
|
|
7
|
-
}) => void) => void;
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mittwald/flow-react-components",
|
|
3
|
-
"version": "1.3.0-next.
|
|
3
|
+
"version": "1.3.0-next.20",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A React implementation of Flow, mittwald’s design system",
|
|
6
6
|
"homepage": "https://flow.mittwald.de",
|
|
@@ -83,9 +83,9 @@
|
|
|
83
83
|
"@internationalized/string-compiler": "^3.4.1",
|
|
84
84
|
"@lezer/common": "^1.5.2",
|
|
85
85
|
"@lezer/highlight": "^1.2.3",
|
|
86
|
-
"@mittwald/flow-icons": "^1.3.0-next.
|
|
86
|
+
"@mittwald/flow-icons": "^1.3.0-next.20",
|
|
87
87
|
"@mittwald/password-tools-js": "^3.0.0",
|
|
88
|
-
"@mittwald/react-tunnel": "^1.3.0-next.
|
|
88
|
+
"@mittwald/react-tunnel": "^1.3.0-next.20",
|
|
89
89
|
"@mittwald/react-use-promise": "^4.2.2",
|
|
90
90
|
"@react-aria/form": "^3.2.1",
|
|
91
91
|
"@react-aria/i18n": "^3.13.1",
|
|
@@ -138,12 +138,12 @@
|
|
|
138
138
|
"@internationalized/date": "^3.12.3",
|
|
139
139
|
"@lezer/generator": "^1.8.0",
|
|
140
140
|
"@lezer/lr": "^1.4.10",
|
|
141
|
-
"@mittwald/flow-core": "1.3.0-next.
|
|
142
|
-
"@mittwald/flow-design-tokens": "1.3.0-next.
|
|
143
|
-
"@mittwald/flow-icons-base": "1.3.0-next.
|
|
141
|
+
"@mittwald/flow-core": "1.3.0-next.20",
|
|
142
|
+
"@mittwald/flow-design-tokens": "1.3.0-next.20",
|
|
143
|
+
"@mittwald/flow-icons-base": "1.3.0-next.20",
|
|
144
144
|
"@mittwald/react-use-promise": "^4.2.2",
|
|
145
145
|
"@mittwald/remote-dom-react": "1.2.2-mittwald.10",
|
|
146
|
-
"@mittwald/typescript-config": "1.3.0-next.
|
|
146
|
+
"@mittwald/typescript-config": "1.3.0-next.20",
|
|
147
147
|
"@nx/storybook": "^22.7.6",
|
|
148
148
|
"@storybook/addon-a11y": "^10.5.10",
|
|
149
149
|
"@storybook/addon-actions": "^9.0.8",
|
|
@@ -153,7 +153,7 @@
|
|
|
153
153
|
"@storybook/react-vite": "^10.5.10",
|
|
154
154
|
"@tabler/icons-react": "^3.46.0",
|
|
155
155
|
"@teispace/next-themes": "^2.0.4",
|
|
156
|
-
"@types/node": "25.9.
|
|
156
|
+
"@types/node": "25.9.7",
|
|
157
157
|
"@typescript/native": "npm:typescript@^7.0.2",
|
|
158
158
|
"@vitejs/plugin-react": "5.2.0",
|
|
159
159
|
"@vitest/browser": "^4.1.11",
|
|
@@ -195,7 +195,7 @@
|
|
|
195
195
|
},
|
|
196
196
|
"peerDependencies": {
|
|
197
197
|
"@internationalized/date": "^3.12.2",
|
|
198
|
-
"@mittwald/flow-icons-pro": "1.3.0-next.
|
|
198
|
+
"@mittwald/flow-icons-pro": "1.3.0-next.20",
|
|
199
199
|
"@mittwald/react-use-promise": "^4.2.2",
|
|
200
200
|
"next": "^16.2.3",
|
|
201
201
|
"react": "^19.2.0",
|
|
@@ -219,5 +219,5 @@
|
|
|
219
219
|
"browserslist": [
|
|
220
220
|
"baseline widely available"
|
|
221
221
|
],
|
|
222
|
-
"gitHead": "
|
|
222
|
+
"gitHead": "89522e32233bb3f92accf31e4c338898bd13296c"
|
|
223
223
|
}
|