@fluentui/react-positioning 0.0.0-nightly-20240314-0406.1 → 0.0.0-nightly-20240315-0408.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -7
- package/lib/utils/getReactFiberFromNode.js.map +1 -1
- package/lib-commonjs/constants.js +3 -3
- package/lib-commonjs/constants.js.map +1 -1
- package/lib-commonjs/createArrowStyles.js +3 -3
- package/lib-commonjs/createArrowStyles.js.map +1 -1
- package/lib-commonjs/index.js +9 -9
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/middleware/matchTargetSize.js +3 -3
- package/lib-commonjs/middleware/matchTargetSize.js.map +1 -1
- package/lib-commonjs/middleware/maxSize.js +3 -3
- package/lib-commonjs/middleware/maxSize.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
@@ -1,20 +1,20 @@
|
|
1
1
|
# Change Log - @fluentui/react-positioning
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Fri, 15 Mar 2024 04:24:56 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
-
## [0.0.0-nightly-
|
7
|
+
## [0.0.0-nightly-20240315-0408.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v0.0.0-nightly-20240315-0408.1)
|
8
8
|
|
9
|
-
|
10
|
-
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.14.0..@fluentui/react-positioning_v0.0.0-nightly-
|
9
|
+
Fri, 15 Mar 2024 04:24:56 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.14.0..@fluentui/react-positioning_v0.0.0-nightly-20240315-0408.1)
|
11
11
|
|
12
12
|
### Changes
|
13
13
|
|
14
14
|
- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
|
15
|
-
- Bump @fluentui/react-shared-contexts to v0.0.0-nightly-
|
16
|
-
- Bump @fluentui/react-theme to v0.0.0-nightly-
|
17
|
-
- Bump @fluentui/react-utilities to v0.0.0-nightly-
|
15
|
+
- Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20240315-0408.1 ([commit](https://github.com/microsoft/fluentui/commit/e039505b45ad657244113509cf6693af6eb2ff42) by beachball)
|
16
|
+
- Bump @fluentui/react-theme to v0.0.0-nightly-20240315-0408.1 ([commit](https://github.com/microsoft/fluentui/commit/e039505b45ad657244113509cf6693af6eb2ff42) by beachball)
|
17
|
+
- Bump @fluentui/react-utilities to v0.0.0-nightly-20240315-0408.1 ([commit](https://github.com/microsoft/fluentui/commit/e039505b45ad657244113509cf6693af6eb2ff42) by beachball)
|
18
18
|
|
19
19
|
## [9.14.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.14.0)
|
20
20
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["getReactFiberFromNode.ts"],"sourcesContent":["import * as React from 'react';\n\n// ========================================================\n// react/packages/shared/ReactTypes.js\n// ========================================================\n\ntype ReactEventResponder<E, C> = {\n $$typeof: Symbol | number;\n displayName: string;\n targetEventTypes: null | string[];\n rootEventTypes: null | string[];\n getInitialState: null | ((props: Object) => Object);\n onEvent: null | ((event: E, context: C, props: Object, state: Object) => void);\n onRootEvent: null | ((event: E, context: C, props: Object, state: Object) => void);\n onMount: null | ((context: C, props: Object, state: Object) => void);\n onUnmount: null | ((context: C, props: Object, state: Object) => void);\n};\n\ntype ReactEventResponderInstance<E, C> = {\n fiber: Object;\n props: Object;\n responder: ReactEventResponder<E, C>;\n rootEventTypes: null | Set<string>;\n state: Object;\n};\n\n// ========================================================\n// react/packages/react-reconciler/src/ReactFiberHooks.js\n// ========================================================\n\nexport type HookType =\n | 'useState'\n | 'useReducer'\n | 'useContext'\n | 'useRef'\n | 'useEffect'\n | 'useLayoutEffect'\n | 'useCallback'\n | 'useMemo'\n | 'useImperativeHandle'\n | 'useDebugValue'\n | 'useResponder';\n\ntype ReactProviderType<T> = {\n $$typeof: Symbol | number;\n _context: ReactContext<T>;\n};\n\ntype ReactContext<T> = {\n $$typeof: Symbol | number;\n Consumer: ReactContext<T>;\n Provider: ReactProviderType<T>;\n\n _calculateChangedBits: ((a: T, b: T) => number) | null;\n\n _currentValue: T;\n _currentValue2: T;\n _threadCount: number;\n\n // DEV only\n _currentRenderer?: Object | null;\n _currentRenderer2?: Object | null;\n};\n\ntype ContextDependency<T> = {\n context: ReactContext<T>;\n observedBits: number;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n next: ContextDependency<any> | null;\n};\n\nenum WorkTag {\n FunctionComponent = 0,\n ClassComponent = 1,\n IndeterminateComponent = 2, // Before we know whether it is function or class\n HostRoot = 3, // Root of a host tree. Could be nested inside another node.\n HostPortal = 4, // A subtree. Could be an entry point to a different renderer.\n HostComponent = 5,\n HostText = 6,\n Fragment = 7,\n Mode = 8,\n ContextConsumer = 9,\n ContextProvider = 10,\n ForwardRef = 11,\n Profiler = 12,\n SuspenseComponent = 13,\n MemoComponent = 14,\n SimpleMemoComponent = 15,\n LazyComponent = 16,\n IncompleteClassComponent = 17,\n DehydratedFragment = 18,\n SuspenseListComponent = 19,\n FundamentalComponent = 20,\n ScopeComponent = 21,\n}\n\ntype Source = {\n fileName: string;\n lineNumber: number;\n};\n\ntype ExpirationTime = number;\n\ntype Dependencies = {\n expirationTime: ExpirationTime;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n firstContext: ContextDependency<any> | null;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n responders: Map<ReactEventResponder<any, any>, ReactEventResponderInstance<any, any>> | null;\n};\n\n// ========================================================\n// react/packages/react-reconciler/src/ReactFiber.js\n// ========================================================\n\n// A Fiber is work on a Component that needs to be done or was done. There can\n// be more than one per component.\n\nexport type Fiber = {\n // These first fields are conceptually members of an Instance. This used to\n // be split into a separate type and intersected with the other Fiber fields,\n // but until Flow fixes its intersection bugs, we've merged them into a\n // single type.\n\n // An Instance is shared between all versions of a component. We can easily\n // break this out into a separate object to avoid copying so much to the\n // alternate versions of the tree. We put this on a single object for now to\n // minimize the number of objects created during the initial render.\n\n // Tag identifying the type of fiber.\n tag: WorkTag;\n\n // Unique identifier of this child.\n key: null | string;\n\n // The value of element.type which is used to preserve the identity during\n // reconciliation of this child.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n elementType: any;\n\n // The resolved function/class/ associated with this fiber.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n type: any;\n\n // The local state associated with this fiber.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n stateNode: any;\n\n // Conceptual aliases\n // parent : Instance -> return The parent happens to be the same as the\n // return fiber since we've merged the fiber and instance.\n\n // Remaining fields belong to Fiber\n\n // The Fiber to return to after finishing processing this one.\n // This is effectively the parent, but there can be multiple parents (two)\n // so this is only the parent of the thing we're currently processing.\n // It is conceptually the same as the return address of a stack frame.\n return: Fiber | null;\n\n // Singly Linked List Tree Structure.\n child: Fiber | null;\n sibling: Fiber | null;\n index: number;\n\n // The ref last used to attach this node.\n // I'll avoid adding an owner field for prod and model that as functions.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref: React.Ref<any>;\n\n // Input is the data coming into process this fiber. Arguments. Props.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n pendingProps: any; // This type will be more specific once we overload the tag.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n memoizedProps: any; // The props used to create the output.\n\n // A queue of state updates and callbacks.\n // updateQueue: UpdateQueue<any> | null,\n\n // The state used to create the output\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n memoizedState: any;\n\n // Dependencies (contexts, events) for this fiber, if it has any\n dependencies: Dependencies | null;\n\n // // Bitfield that describes properties about the fiber and its subtree. E.g.\n // // the ConcurrentMode flag indicates whether the subtree should be async-by-\n // // default. When a fiber is created, it inherits the mode of its\n // // parent. Additional flags can be set at creation time, but after that the\n // // value should remain unchanged throughout the fiber's lifetime, particularly\n // // before its child fibers are created.\n // mode: TypeOfMode\n //\n // // Effect\n // effectTag: SideEffectTag\n\n // Singly linked list fast path to the next fiber with side-effects.\n nextEffect: Fiber | null;\n\n // The first and last fiber with side-effect within this subtree. This allows\n // us to reuse a slice of the linked list when we reuse the work done within\n // this fiber.\n firstEffect: Fiber | null;\n lastEffect: Fiber | null;\n\n // Represents a time in the future by which this work should be completed.\n // Does not include work found in its subtree.\n expirationTime: ExpirationTime;\n\n // This is used to quickly determine if a subtree has no pending changes.\n childExpirationTime: ExpirationTime;\n\n // This is a pooled version of a Fiber. Every fiber that gets updated will\n // eventually have a pair. There are cases when we can clean up pairs to save\n // memory if we need to.\n alternate: Fiber | null;\n\n // Time spent rendering this Fiber and its descendants for the current update.\n // This tells us how well the tree makes use of sCU for memoization.\n // It is reset to 0 each time we render and only updated when we don't bailout.\n // This field is only set when the enableProfilerTimer flag is enabled.\n actualDuration?: number;\n\n // If the Fiber is currently active in the \"render\" phase,\n // This marks the time at which the work began.\n // This field is only set when the enableProfilerTimer flag is enabled.\n actualStartTime?: number;\n\n // Duration of the most recent render time for this Fiber.\n // This value is not updated when we bailout for memoization purposes.\n // This field is only set when the enableProfilerTimer flag is enabled.\n selfBaseDuration?: number;\n\n // Sum of base times for all descendants of this Fiber.\n // This value bubbles up during the \"complete\" phase.\n // This field is only set when the enableProfilerTimer flag is enabled.\n treeBaseDuration?: number;\n\n // Conceptual aliases\n // workInProgress : Fiber -> alternate The alternate used for reuse happens\n // to be the same as work in progress.\n // __DEV__ only\n _debugID?: number;\n _debugSource?: Source | null;\n _debugOwner?: Fiber | null;\n _debugIsCurrentlyTiming?: boolean;\n _debugNeedsRemount?: boolean;\n\n // Used to verify that the order of hooks does not change between renders.\n _debugHookTypes?: HookType[] | null;\n};\n\nexport function getReactFiberFromNode(elm: Node | undefined): Fiber | null {\n if (!elm) {\n return null;\n }\n\n for (const k in elm) {\n // React 16 uses \"__reactInternalInstance$\" prefix\n // React 17 uses \"__reactFiber$\" prefix\n // https://github.com/facebook/react/pull/18377\n if (k.indexOf('__reactInternalInstance$') === 0 || k.indexOf('__reactFiber$') === 0) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return elm[k];\n }\n }\n\n throw new Error('getReactFiber(): Failed to find a React Fiber on a node');\n}\n"],"names":["React","WorkTag","FunctionComponent","ClassComponent","IndeterminateComponent","HostRoot","HostPortal","HostComponent","HostText","Fragment","Mode","ContextConsumer","ContextProvider","ForwardRef","Profiler","SuspenseComponent","MemoComponent","SimpleMemoComponent","LazyComponent","IncompleteClassComponent","DehydratedFragment","SuspenseListComponent","FundamentalComponent","ScopeComponent","getReactFiberFromNode","elm","k","indexOf","Error"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;IAuE/B;UAAKC,OAAO;IAAPA,QAAAA,QACHC,uBAAoB,KAApBA;IADGD,QAAAA,QAEHE,oBAAiB,KAAjBA;IAFGF,QAAAA,QAGHG,4BAAyB,KAAzBA;IAHGH,QAAAA,QAIHI,cAAW,KAAXA;IAJGJ,QAAAA,QAKHK,gBAAa,KAAbA;IALGL,QAAAA,QAMHM,mBAAgB,KAAhBA;IANGN,QAAAA,QAOHO,cAAW,KAAXA;IAPGP,QAAAA,QAQHQ,cAAW,KAAXA;IARGR,QAAAA,QASHS,UAAO,KAAPA;IATGT,QAAAA,QAUHU,qBAAkB,KAAlBA;IAVGV,QAAAA,QAWHW,qBAAkB,MAAlBA;IAXGX,QAAAA,QAYHY,gBAAa,MAAbA;IAZGZ,QAAAA,QAaHa,cAAW,MAAXA;IAbGb,QAAAA,QAcHc,uBAAoB,MAApBA;IAdGd,QAAAA,QAeHe,mBAAgB,MAAhBA;IAfGf,QAAAA,QAgBHgB,yBAAsB,MAAtBA;IAhBGhB,QAAAA,QAiBHiB,mBAAgB,MAAhBA;IAjBGjB,QAAAA,QAkBHkB,8BAA2B,MAA3BA;IAlBGlB,QAAAA,QAmBHmB,wBAAqB,MAArBA;IAnBGnB,QAAAA,QAoBHoB,2BAAwB,MAAxBA;IApBGpB,QAAAA,QAqBHqB,0BAAuB,MAAvBA;IArBGrB,QAAAA,QAsBHsB,oBAAiB,MAAjBA;GAtBGtB,YAAAA;AAsLL,OAAO,SAASuB,sBAAsBC,GAAqB;IACzD,IAAI,CAACA,KAAK;QACR,OAAO;IACT;IAEA,IAAK,MAAMC,KAAKD,IAAK;QACnB,kDAAkD;QAClD,uCAAuC;QACvC,+CAA+C;QAC/C,IAAIC,EAAEC,OAAO,CAAC,gCAAgC,KAAKD,EAAEC,OAAO,CAAC,qBAAqB,GAAG;YACnF,6DAA6D;YAC7D,aAAa;YACb,OAAOF,GAAG,CAACC,EAAE;QACf;IACF;IAEA,MAAM,IAAIE,MAAM;AAClB"}
|
1
|
+
{"version":3,"sources":["getReactFiberFromNode.ts"],"sourcesContent":["import * as React from 'react';\n\n// ========================================================\n// react/packages/shared/ReactTypes.js\n// ========================================================\n\ntype ReactEventResponder<E, C> = {\n $$typeof: Symbol | number;\n displayName: string;\n targetEventTypes: null | string[];\n rootEventTypes: null | string[];\n getInitialState: null | ((props: Object) => Object);\n onEvent: null | ((event: E, context: C, props: Object, state: Object) => void);\n onRootEvent: null | ((event: E, context: C, props: Object, state: Object) => void);\n onMount: null | ((context: C, props: Object, state: Object) => void);\n onUnmount: null | ((context: C, props: Object, state: Object) => void);\n};\n\ntype ReactEventResponderInstance<E, C> = {\n fiber: Object;\n props: Object;\n responder: ReactEventResponder<E, C>;\n rootEventTypes: null | Set<string>;\n state: Object;\n};\n\n// ========================================================\n// react/packages/react-reconciler/src/ReactFiberHooks.js\n// ========================================================\n\nexport type HookType =\n | 'useState'\n | 'useReducer'\n | 'useContext'\n | 'useRef'\n | 'useEffect'\n | 'useLayoutEffect'\n | 'useCallback'\n | 'useMemo'\n | 'useImperativeHandle'\n | 'useDebugValue'\n | 'useResponder';\n\ntype ReactProviderType<T> = {\n $$typeof: Symbol | number;\n _context: ReactContext<T>;\n};\n\ntype ReactContext<T> = {\n $$typeof: Symbol | number;\n Consumer: ReactContext<T>;\n Provider: ReactProviderType<T>;\n\n _calculateChangedBits: ((a: T, b: T) => number) | null;\n\n _currentValue: T;\n _currentValue2: T;\n _threadCount: number;\n\n // DEV only\n _currentRenderer?: Object | null;\n _currentRenderer2?: Object | null;\n};\n\ntype ContextDependency<T> = {\n context: ReactContext<T>;\n observedBits: number;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n next: ContextDependency<any> | null;\n};\n\nenum WorkTag {\n FunctionComponent = 0,\n ClassComponent = 1,\n IndeterminateComponent = 2, // Before we know whether it is function or class\n HostRoot = 3, // Root of a host tree. Could be nested inside another node.\n HostPortal = 4, // A subtree. Could be an entry point to a different renderer.\n HostComponent = 5,\n HostText = 6,\n Fragment = 7,\n Mode = 8,\n ContextConsumer = 9,\n ContextProvider = 10,\n ForwardRef = 11,\n Profiler = 12,\n SuspenseComponent = 13,\n MemoComponent = 14,\n SimpleMemoComponent = 15,\n LazyComponent = 16,\n IncompleteClassComponent = 17,\n DehydratedFragment = 18,\n SuspenseListComponent = 19,\n FundamentalComponent = 20,\n ScopeComponent = 21,\n}\n\ntype Source = {\n fileName: string;\n lineNumber: number;\n};\n\ntype ExpirationTime = number;\n\ntype Dependencies = {\n expirationTime: ExpirationTime;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n firstContext: ContextDependency<any> | null;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n responders: Map<ReactEventResponder<any, any>, ReactEventResponderInstance<any, any>> | null;\n};\n\n// ========================================================\n// react/packages/react-reconciler/src/ReactFiber.js\n// ========================================================\n\n// A Fiber is work on a Component that needs to be done or was done. There can\n// be more than one per component.\n\nexport type Fiber = {\n // These first fields are conceptually members of an Instance. This used to\n // be split into a separate type and intersected with the other Fiber fields,\n // but until Flow fixes its intersection bugs, we've merged them into a\n // single type.\n\n // An Instance is shared between all versions of a component. We can easily\n // break this out into a separate object to avoid copying so much to the\n // alternate versions of the tree. We put this on a single object for now to\n // minimize the number of objects created during the initial render.\n\n // Tag identifying the type of fiber.\n tag: WorkTag;\n\n // Unique identifier of this child.\n key: null | string;\n\n // The value of element.type which is used to preserve the identity during\n // reconciliation of this child.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n elementType: any;\n\n // The resolved function/class/ associated with this fiber.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n type: any;\n\n // The local state associated with this fiber.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n stateNode: any;\n\n // Conceptual aliases\n // parent : Instance -> return The parent happens to be the same as the\n // return fiber since we've merged the fiber and instance.\n\n // Remaining fields belong to Fiber\n\n // The Fiber to return to after finishing processing this one.\n // This is effectively the parent, but there can be multiple parents (two)\n // so this is only the parent of the thing we're currently processing.\n // It is conceptually the same as the return address of a stack frame.\n return: Fiber | null;\n\n // Singly Linked List Tree Structure.\n child: Fiber | null;\n sibling: Fiber | null;\n index: number;\n\n // The ref last used to attach this node.\n // I'll avoid adding an owner field for prod and model that as functions.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref: React.Ref<any>;\n\n // Input is the data coming into process this fiber. Arguments. Props.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n pendingProps: any; // This type will be more specific once we overload the tag.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n memoizedProps: any; // The props used to create the output.\n\n // A queue of state updates and callbacks.\n // updateQueue: UpdateQueue<any> | null,\n\n // The state used to create the output\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n memoizedState: any;\n\n // Dependencies (contexts, events) for this fiber, if it has any\n dependencies: Dependencies | null;\n\n // // Bitfield that describes properties about the fiber and its subtree. E.g.\n // // the ConcurrentMode flag indicates whether the subtree should be async-by-\n // // default. When a fiber is created, it inherits the mode of its\n // // parent. Additional flags can be set at creation time, but after that the\n // // value should remain unchanged throughout the fiber's lifetime, particularly\n // // before its child fibers are created.\n // mode: TypeOfMode\n //\n // // Effect\n // effectTag: SideEffectTag\n\n // Singly linked list fast path to the next fiber with side-effects.\n nextEffect: Fiber | null;\n\n // The first and last fiber with side-effect within this subtree. This allows\n // us to reuse a slice of the linked list when we reuse the work done within\n // this fiber.\n firstEffect: Fiber | null;\n lastEffect: Fiber | null;\n\n // Represents a time in the future by which this work should be completed.\n // Does not include work found in its subtree.\n expirationTime: ExpirationTime;\n\n // This is used to quickly determine if a subtree has no pending changes.\n childExpirationTime: ExpirationTime;\n\n // This is a pooled version of a Fiber. Every fiber that gets updated will\n // eventually have a pair. There are cases when we can clean up pairs to save\n // memory if we need to.\n alternate: Fiber | null;\n\n // Time spent rendering this Fiber and its descendants for the current update.\n // This tells us how well the tree makes use of sCU for memoization.\n // It is reset to 0 each time we render and only updated when we don't bailout.\n // This field is only set when the enableProfilerTimer flag is enabled.\n actualDuration?: number;\n\n // If the Fiber is currently active in the \"render\" phase,\n // This marks the time at which the work began.\n // This field is only set when the enableProfilerTimer flag is enabled.\n actualStartTime?: number;\n\n // Duration of the most recent render time for this Fiber.\n // This value is not updated when we bailout for memoization purposes.\n // This field is only set when the enableProfilerTimer flag is enabled.\n selfBaseDuration?: number;\n\n // Sum of base times for all descendants of this Fiber.\n // This value bubbles up during the \"complete\" phase.\n // This field is only set when the enableProfilerTimer flag is enabled.\n treeBaseDuration?: number;\n\n // Conceptual aliases\n // workInProgress : Fiber -> alternate The alternate used for reuse happens\n // to be the same as work in progress.\n // __DEV__ only\n _debugID?: number;\n _debugSource?: Source | null;\n _debugOwner?: Fiber | null;\n _debugIsCurrentlyTiming?: boolean;\n _debugNeedsRemount?: boolean;\n\n // Used to verify that the order of hooks does not change between renders.\n _debugHookTypes?: HookType[] | null;\n};\n\nexport function getReactFiberFromNode(elm: Node | undefined): Fiber | null {\n if (!elm) {\n return null;\n }\n\n for (const k in elm) {\n // React 16 uses \"__reactInternalInstance$\" prefix\n // React 17 uses \"__reactFiber$\" prefix\n // https://github.com/facebook/react/pull/18377\n if (k.indexOf('__reactInternalInstance$') === 0 || k.indexOf('__reactFiber$') === 0) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return elm[k];\n }\n }\n\n throw new Error('getReactFiber(): Failed to find a React Fiber on a node');\n}\n"],"names":["React","WorkTag","getReactFiberFromNode","elm","k","indexOf","Error"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;;UAuE1BC;;;;;;;;;;;;;;;;;;;;;;;GAAAA,YAAAA;AAsLL,OAAO,SAASC,sBAAsBC,GAAqB;IACzD,IAAI,CAACA,KAAK;QACR,OAAO;IACT;IAEA,IAAK,MAAMC,KAAKD,IAAK;QACnB,kDAAkD;QAClD,uCAAuC;QACvC,+CAA+C;QAC/C,IAAIC,EAAEC,OAAO,CAAC,gCAAgC,KAAKD,EAAEC,OAAO,CAAC,qBAAqB,GAAG;YACnF,6DAA6D;YAC7D,aAAa;YACb,OAAOF,GAAG,CAACC,EAAE;QACf;IACF;IAEA,MAAM,IAAIE,MAAM;AAClB"}
|
@@ -9,15 +9,15 @@ function _export(target, all) {
|
|
9
9
|
});
|
10
10
|
}
|
11
11
|
_export(exports, {
|
12
|
-
DATA_POSITIONING_INTERSECTING: function() {
|
13
|
-
return DATA_POSITIONING_INTERSECTING;
|
14
|
-
},
|
15
12
|
DATA_POSITIONING_ESCAPED: function() {
|
16
13
|
return DATA_POSITIONING_ESCAPED;
|
17
14
|
},
|
18
15
|
DATA_POSITIONING_HIDDEN: function() {
|
19
16
|
return DATA_POSITIONING_HIDDEN;
|
20
17
|
},
|
18
|
+
DATA_POSITIONING_INTERSECTING: function() {
|
19
|
+
return DATA_POSITIONING_INTERSECTING;
|
20
|
+
},
|
21
21
|
DATA_POSITIONING_PLACEMENT: function() {
|
22
22
|
return DATA_POSITIONING_PLACEMENT;
|
23
23
|
},
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["constants.js"],"sourcesContent":["export const DATA_POSITIONING_INTERSECTING = 'data-popper-is-intersecting';\nexport const DATA_POSITIONING_ESCAPED = 'data-popper-escaped';\nexport const DATA_POSITIONING_HIDDEN = 'data-popper-reference-hidden';\nexport const DATA_POSITIONING_PLACEMENT = 'data-popper-placement';\nexport const POSITIONING_END_EVENT = 'fui-positioningend';\n"],"names":["
|
1
|
+
{"version":3,"sources":["constants.js"],"sourcesContent":["export const DATA_POSITIONING_INTERSECTING = 'data-popper-is-intersecting';\nexport const DATA_POSITIONING_ESCAPED = 'data-popper-escaped';\nexport const DATA_POSITIONING_HIDDEN = 'data-popper-reference-hidden';\nexport const DATA_POSITIONING_PLACEMENT = 'data-popper-placement';\nexport const POSITIONING_END_EVENT = 'fui-positioningend';\n"],"names":["DATA_POSITIONING_ESCAPED","DATA_POSITIONING_HIDDEN","DATA_POSITIONING_INTERSECTING","DATA_POSITIONING_PLACEMENT","POSITIONING_END_EVENT"],"mappings":";;;;;;;;;;;IACaA,wBAAwB;eAAxBA;;IACAC,uBAAuB;eAAvBA;;IAFAC,6BAA6B;eAA7BA;;IAGAC,0BAA0B;eAA1BA;;IACAC,qBAAqB;eAArBA;;;AAJN,MAAMF,gCAAgC;AACtC,MAAMF,2BAA2B;AACjC,MAAMC,0BAA0B;AAChC,MAAME,6BAA6B;AACnC,MAAMC,wBAAwB"}
|
@@ -9,11 +9,11 @@ function _export(target, all) {
|
|
9
9
|
});
|
10
10
|
}
|
11
11
|
_export(exports, {
|
12
|
-
createArrowStyles: function() {
|
13
|
-
return createArrowStyles;
|
14
|
-
},
|
15
12
|
createArrowHeightStyles: function() {
|
16
13
|
return createArrowHeightStyles;
|
14
|
+
},
|
15
|
+
createArrowStyles: function() {
|
16
|
+
return createArrowStyles;
|
17
17
|
}
|
18
18
|
});
|
19
19
|
const _react = require("@griffel/react");
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["createArrowStyles.js"],"sourcesContent":["import { shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\n/**\n * @internal\n * Helper that creates a makeStyles rule for an arrow element.\n * For runtime arrow size toggling simply create extra classnames to apply to the arrow element\n *\n * ```ts\n * makeStyles({\n * arrowWithSize: createArrowStyles({ arrowHeight: 6 }),\n *\n * arrowWithoutSize: createArrowStyles({ arrowHeight: undefined }),\n * mediumArrow: createArrowHeightStyles(4),\n * smallArrow: createArrowHeightStyles(2),\n * })\n * ...\n *\n * state.arrowWithSize.className = styles.arrowWithSize;\n * state.arrowWithoutSize.className = mergeClasses(\n * styles.arrowWithoutSize,\n * state.smallArrow && styles.smallArrow,\n * state.mediumArrow && styles.mediumArrow,\n * )\n * ```\n */ export function createArrowStyles(options) {\n const { arrowHeight, borderWidth = '1px', borderStyle = 'solid', borderColor = tokens.colorTransparentStroke } = options;\n return {\n position: 'absolute',\n backgroundColor: 'inherit',\n visibility: 'hidden',\n zIndex: -1,\n ...arrowHeight && createArrowHeightStyles(arrowHeight),\n '::before': {\n content: '\"\"',\n visibility: 'visible',\n position: 'absolute',\n boxSizing: 'border-box',\n width: 'inherit',\n height: 'inherit',\n backgroundColor: 'inherit',\n ...shorthands.borderRight(`${borderWidth} /* @noflip */`, `${borderStyle} /* @noflip */`, `${borderColor} /* @noflip */`),\n ...shorthands.borderBottom(borderWidth, borderStyle, borderColor),\n borderBottomRightRadius: tokens.borderRadiusSmall,\n transform: 'rotate(var(--fui-positioning-angle)) translate(0, 50%) rotate(45deg) /* @noflip */'\n },\n // Popper sets data-popper-placement on the root element, which is used to align the arrow\n ':global([data-popper-placement^=\"top\"])': {\n bottom: `-${borderWidth}`,\n '--fui-positioning-angle': '0'\n },\n ':global([data-popper-placement^=\"right\"])': {\n left: `-${borderWidth} /* @noflip */`,\n '--fui-positioning-angle': '90deg'\n },\n ':global([data-popper-placement^=\"bottom\"])': {\n top: `-${borderWidth}`,\n '--fui-positioning-angle': '180deg'\n },\n ':global([data-popper-placement^=\"left\"])': {\n right: `-${borderWidth} /* @noflip */`,\n '--fui-positioning-angle': '270deg'\n }\n };\n}\n/**\n * @internal\n * Creates CSS styles to size the arrow created by createArrowStyles to the given height.\n *\n * Use this when you need to create classes for several different arrow sizes. If you only need a\n * constant arrow size, you can pass the `arrowHeight` param to createArrowStyles instead.\n */ export function createArrowHeightStyles(arrowHeight) {\n // The arrow is a square rotated 45 degrees to have its bottom and right edges form a right triangle.\n // Multiply the triangle's height by sqrt(2) to get length of its edges.\n const edgeLength = `${1.414 * arrowHeight}px`;\n return {\n width: edgeLength,\n height: edgeLength\n };\n}\n"],"names":["
|
1
|
+
{"version":3,"sources":["createArrowStyles.js"],"sourcesContent":["import { shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\n/**\n * @internal\n * Helper that creates a makeStyles rule for an arrow element.\n * For runtime arrow size toggling simply create extra classnames to apply to the arrow element\n *\n * ```ts\n * makeStyles({\n * arrowWithSize: createArrowStyles({ arrowHeight: 6 }),\n *\n * arrowWithoutSize: createArrowStyles({ arrowHeight: undefined }),\n * mediumArrow: createArrowHeightStyles(4),\n * smallArrow: createArrowHeightStyles(2),\n * })\n * ...\n *\n * state.arrowWithSize.className = styles.arrowWithSize;\n * state.arrowWithoutSize.className = mergeClasses(\n * styles.arrowWithoutSize,\n * state.smallArrow && styles.smallArrow,\n * state.mediumArrow && styles.mediumArrow,\n * )\n * ```\n */ export function createArrowStyles(options) {\n const { arrowHeight, borderWidth = '1px', borderStyle = 'solid', borderColor = tokens.colorTransparentStroke } = options;\n return {\n position: 'absolute',\n backgroundColor: 'inherit',\n visibility: 'hidden',\n zIndex: -1,\n ...arrowHeight && createArrowHeightStyles(arrowHeight),\n '::before': {\n content: '\"\"',\n visibility: 'visible',\n position: 'absolute',\n boxSizing: 'border-box',\n width: 'inherit',\n height: 'inherit',\n backgroundColor: 'inherit',\n ...shorthands.borderRight(`${borderWidth} /* @noflip */`, `${borderStyle} /* @noflip */`, `${borderColor} /* @noflip */`),\n ...shorthands.borderBottom(borderWidth, borderStyle, borderColor),\n borderBottomRightRadius: tokens.borderRadiusSmall,\n transform: 'rotate(var(--fui-positioning-angle)) translate(0, 50%) rotate(45deg) /* @noflip */'\n },\n // Popper sets data-popper-placement on the root element, which is used to align the arrow\n ':global([data-popper-placement^=\"top\"])': {\n bottom: `-${borderWidth}`,\n '--fui-positioning-angle': '0'\n },\n ':global([data-popper-placement^=\"right\"])': {\n left: `-${borderWidth} /* @noflip */`,\n '--fui-positioning-angle': '90deg'\n },\n ':global([data-popper-placement^=\"bottom\"])': {\n top: `-${borderWidth}`,\n '--fui-positioning-angle': '180deg'\n },\n ':global([data-popper-placement^=\"left\"])': {\n right: `-${borderWidth} /* @noflip */`,\n '--fui-positioning-angle': '270deg'\n }\n };\n}\n/**\n * @internal\n * Creates CSS styles to size the arrow created by createArrowStyles to the given height.\n *\n * Use this when you need to create classes for several different arrow sizes. If you only need a\n * constant arrow size, you can pass the `arrowHeight` param to createArrowStyles instead.\n */ export function createArrowHeightStyles(arrowHeight) {\n // The arrow is a square rotated 45 degrees to have its bottom and right edges form a right triangle.\n // Multiply the triangle's height by sqrt(2) to get length of its edges.\n const edgeLength = `${1.414 * arrowHeight}px`;\n return {\n width: edgeLength,\n height: edgeLength\n };\n}\n"],"names":["createArrowHeightStyles","createArrowStyles","options","arrowHeight","borderWidth","borderStyle","borderColor","tokens","colorTransparentStroke","position","backgroundColor","visibility","zIndex","content","boxSizing","width","height","shorthands","borderRight","borderBottom","borderBottomRightRadius","borderRadiusSmall","transform","bottom","left","top","right","edgeLength"],"mappings":";;;;;;;;;;;IAsEoBA,uBAAuB;eAAvBA;;IA9CAC,iBAAiB;eAAjBA;;;uBAxBO;4BACJ;AAuBZ,SAASA,kBAAkBC,OAAO;IACzC,MAAM,EAAEC,WAAW,EAAEC,cAAc,KAAK,EAAEC,cAAc,OAAO,EAAEC,cAAcC,kBAAM,CAACC,sBAAsB,EAAE,GAAGN;IACjH,OAAO;QACHO,UAAU;QACVC,iBAAiB;QACjBC,YAAY;QACZC,QAAQ,CAAC;QACT,GAAGT,eAAeH,wBAAwBG,YAAY;QACtD,YAAY;YACRU,SAAS;YACTF,YAAY;YACZF,UAAU;YACVK,WAAW;YACXC,OAAO;YACPC,QAAQ;YACRN,iBAAiB;YACjB,GAAGO,iBAAU,CAACC,WAAW,CAAC,CAAC,EAAEd,YAAY,cAAc,CAAC,EAAE,CAAC,EAAEC,YAAY,cAAc,CAAC,EAAE,CAAC,EAAEC,YAAY,cAAc,CAAC,CAAC;YACzH,GAAGW,iBAAU,CAACE,YAAY,CAACf,aAAaC,aAAaC,YAAY;YACjEc,yBAAyBb,kBAAM,CAACc,iBAAiB;YACjDC,WAAW;QACf;QACA,0FAA0F;QAC1F,2CAA2C;YACvCC,QAAQ,CAAC,CAAC,EAAEnB,YAAY,CAAC;YACzB,2BAA2B;QAC/B;QACA,6CAA6C;YACzCoB,MAAM,CAAC,CAAC,EAAEpB,YAAY,cAAc,CAAC;YACrC,2BAA2B;QAC/B;QACA,8CAA8C;YAC1CqB,KAAK,CAAC,CAAC,EAAErB,YAAY,CAAC;YACtB,2BAA2B;QAC/B;QACA,4CAA4C;YACxCsB,OAAO,CAAC,CAAC,EAAEtB,YAAY,cAAc,CAAC;YACtC,2BAA2B;QAC/B;IACJ;AACJ;AAOW,SAASJ,wBAAwBG,WAAW;IACnD,qGAAqG;IACrG,wEAAwE;IACxE,MAAMwB,aAAa,CAAC,EAAE,QAAQxB,YAAY,EAAE,CAAC;IAC7C,OAAO;QACHY,OAAOY;QACPX,QAAQW;IACZ;AACJ"}
|
package/lib-commonjs/index.js
CHANGED
@@ -9,9 +9,6 @@ function _export(target, all) {
|
|
9
9
|
});
|
10
10
|
}
|
11
11
|
_export(exports, {
|
12
|
-
createVirtualElementFromClick: function() {
|
13
|
-
return _createVirtualElementFromClick.createVirtualElementFromClick;
|
14
|
-
},
|
15
12
|
createArrowHeightStyles: function() {
|
16
13
|
return _createArrowStyles.createArrowHeightStyles;
|
17
14
|
},
|
@@ -21,17 +18,20 @@ _export(exports, {
|
|
21
18
|
createSlideStyles: function() {
|
22
19
|
return _createSlideStyles.createSlideStyles;
|
23
20
|
},
|
24
|
-
|
25
|
-
return
|
21
|
+
createVirtualElementFromClick: function() {
|
22
|
+
return _createVirtualElementFromClick.createVirtualElementFromClick;
|
26
23
|
},
|
27
|
-
|
28
|
-
return
|
24
|
+
mergeArrowOffset: function() {
|
25
|
+
return _index.mergeArrowOffset;
|
29
26
|
},
|
30
27
|
resolvePositioningShorthand: function() {
|
31
28
|
return _index.resolvePositioningShorthand;
|
32
29
|
},
|
33
|
-
|
34
|
-
return
|
30
|
+
usePositioning: function() {
|
31
|
+
return _usePositioning.usePositioning;
|
32
|
+
},
|
33
|
+
usePositioningMouseTarget: function() {
|
34
|
+
return _usePositioningMouseTarget.usePositioningMouseTarget;
|
35
35
|
}
|
36
36
|
});
|
37
37
|
const _createVirtualElementFromClick = require("./createVirtualElementFromClick");
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["index.js"],"sourcesContent":["export { createVirtualElementFromClick } from './createVirtualElementFromClick';\nexport { createArrowHeightStyles, createArrowStyles } from './createArrowStyles';\nexport { createSlideStyles } from './createSlideStyles';\nexport { usePositioning } from './usePositioning';\nexport { usePositioningMouseTarget } from './usePositioningMouseTarget';\nexport { resolvePositioningShorthand, mergeArrowOffset } from './utils/index';\n"],"names":["
|
1
|
+
{"version":3,"sources":["index.js"],"sourcesContent":["export { createVirtualElementFromClick } from './createVirtualElementFromClick';\nexport { createArrowHeightStyles, createArrowStyles } from './createArrowStyles';\nexport { createSlideStyles } from './createSlideStyles';\nexport { usePositioning } from './usePositioning';\nexport { usePositioningMouseTarget } from './usePositioningMouseTarget';\nexport { resolvePositioningShorthand, mergeArrowOffset } from './utils/index';\n"],"names":["createArrowHeightStyles","createArrowStyles","createSlideStyles","createVirtualElementFromClick","mergeArrowOffset","resolvePositioningShorthand","usePositioning","usePositioningMouseTarget"],"mappings":";;;;;;;;;;;IACSA,uBAAuB;eAAvBA,0CAAuB;;IAAEC,iBAAiB;eAAjBA,oCAAiB;;IAC1CC,iBAAiB;eAAjBA,oCAAiB;;IAFjBC,6BAA6B;eAA7BA,4DAA6B;;IAKAC,gBAAgB;eAAhBA,uBAAgB;;IAA7CC,2BAA2B;eAA3BA,kCAA2B;;IAF3BC,cAAc;eAAdA,8BAAc;;IACdC,yBAAyB;eAAzBA,oDAAyB;;;+CAJY;mCACa;mCACzB;gCACH;2CACW;uBACoB"}
|
@@ -9,11 +9,11 @@ function _export(target, all) {
|
|
9
9
|
});
|
10
10
|
}
|
11
11
|
_export(exports, {
|
12
|
-
matchTargetSizeCssVar: function() {
|
13
|
-
return matchTargetSizeCssVar;
|
14
|
-
},
|
15
12
|
matchTargetSize: function() {
|
16
13
|
return matchTargetSize;
|
14
|
+
},
|
15
|
+
matchTargetSizeCssVar: function() {
|
16
|
+
return matchTargetSizeCssVar;
|
17
17
|
}
|
18
18
|
});
|
19
19
|
const matchTargetSizeCssVar = '--fui-match-target-size';
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["matchTargetSize.js"],"sourcesContent":["export const matchTargetSizeCssVar = '--fui-match-target-size';\nexport function matchTargetSize() {\n return {\n name: 'matchTargetSize',\n fn: async (middlewareArguments)=>{\n const { rects: { reference: referenceRect, floating: floatingRect }, elements: { floating: floatingElement }, middlewareData: { matchTargetSize: { matchTargetSizeAttempt = false } = {} } } = middlewareArguments;\n if (referenceRect.width === floatingRect.width || matchTargetSizeAttempt) {\n return {};\n }\n const { width } = referenceRect;\n floatingElement.style.setProperty(matchTargetSizeCssVar, `${width}px`);\n if (!floatingElement.style.width) {\n floatingElement.style.width = `var(${matchTargetSizeCssVar})`;\n }\n return {\n data: {\n matchTargetSizeAttempt: true\n },\n reset: {\n rects: true\n }\n };\n }\n };\n}\n"],"names":["
|
1
|
+
{"version":3,"sources":["matchTargetSize.js"],"sourcesContent":["export const matchTargetSizeCssVar = '--fui-match-target-size';\nexport function matchTargetSize() {\n return {\n name: 'matchTargetSize',\n fn: async (middlewareArguments)=>{\n const { rects: { reference: referenceRect, floating: floatingRect }, elements: { floating: floatingElement }, middlewareData: { matchTargetSize: { matchTargetSizeAttempt = false } = {} } } = middlewareArguments;\n if (referenceRect.width === floatingRect.width || matchTargetSizeAttempt) {\n return {};\n }\n const { width } = referenceRect;\n floatingElement.style.setProperty(matchTargetSizeCssVar, `${width}px`);\n if (!floatingElement.style.width) {\n floatingElement.style.width = `var(${matchTargetSizeCssVar})`;\n }\n return {\n data: {\n matchTargetSizeAttempt: true\n },\n reset: {\n rects: true\n }\n };\n }\n };\n}\n"],"names":["matchTargetSize","matchTargetSizeCssVar","name","fn","middlewareArguments","rects","reference","referenceRect","floating","floatingRect","elements","floatingElement","middlewareData","matchTargetSizeAttempt","width","style","setProperty","data","reset"],"mappings":";;;;;;;;;;;IACgBA,eAAe;eAAfA;;IADHC,qBAAqB;eAArBA;;;AAAN,MAAMA,wBAAwB;AAC9B,SAASD;IACZ,OAAO;QACHE,MAAM;QACNC,IAAI,OAAOC;YACP,MAAM,EAAEC,OAAO,EAAEC,WAAWC,aAAa,EAAEC,UAAUC,YAAY,EAAE,EAAEC,UAAU,EAAEF,UAAUG,eAAe,EAAE,EAAEC,gBAAgB,EAAEZ,iBAAiB,EAAEa,yBAAyB,KAAK,EAAE,GAAG,CAAC,CAAC,EAAE,EAAE,GAAGT;YAC/L,IAAIG,cAAcO,KAAK,KAAKL,aAAaK,KAAK,IAAID,wBAAwB;gBACtE,OAAO,CAAC;YACZ;YACA,MAAM,EAAEC,KAAK,EAAE,GAAGP;YAClBI,gBAAgBI,KAAK,CAACC,WAAW,CAACf,uBAAuB,CAAC,EAAEa,MAAM,EAAE,CAAC;YACrE,IAAI,CAACH,gBAAgBI,KAAK,CAACD,KAAK,EAAE;gBAC9BH,gBAAgBI,KAAK,CAACD,KAAK,GAAG,CAAC,IAAI,EAAEb,sBAAsB,CAAC,CAAC;YACjE;YACA,OAAO;gBACHgB,MAAM;oBACFJ,wBAAwB;gBAC5B;gBACAK,OAAO;oBACHb,OAAO;gBACX;YACJ;QACJ;IACJ;AACJ"}
|
@@ -9,11 +9,11 @@ function _export(target, all) {
|
|
9
9
|
});
|
10
10
|
}
|
11
11
|
_export(exports, {
|
12
|
-
resetMaxSize: function() {
|
13
|
-
return resetMaxSize;
|
14
|
-
},
|
15
12
|
maxSize: function() {
|
16
13
|
return maxSize;
|
14
|
+
},
|
15
|
+
resetMaxSize: function() {
|
16
|
+
return resetMaxSize;
|
17
17
|
}
|
18
18
|
});
|
19
19
|
const _dom = require("@floating-ui/dom");
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["maxSize.js"],"sourcesContent":["import { size } from '@floating-ui/dom';\nimport { getBoundary } from '../utils/getBoundary';\n/**\n * floating-ui `size` middleware uses floating element's height/width to calculate available height/width.\n * This middleware only runs once per lifecycle, resetting styles applied by maxSize from previous lifecycle.\n * Then floating element's original size is restored and `size` middleware can calculate available height/width correctly.\n */ export const resetMaxSize = (autoSize)=>({\n name: 'resetMaxSize',\n fn ({ middlewareData, elements }) {\n var _middlewareData_resetMaxSize;\n if ((_middlewareData_resetMaxSize = middlewareData.resetMaxSize) === null || _middlewareData_resetMaxSize === void 0 ? void 0 : _middlewareData_resetMaxSize.maxSizeAlreadyReset) {\n return {};\n }\n const { applyMaxWidth, applyMaxHeight } = autoSize;\n if (applyMaxWidth) {\n elements.floating.style.removeProperty('box-sizing');\n elements.floating.style.removeProperty('max-width');\n elements.floating.style.removeProperty('width');\n }\n if (applyMaxHeight) {\n elements.floating.style.removeProperty('box-sizing');\n elements.floating.style.removeProperty('max-height');\n elements.floating.style.removeProperty('height');\n }\n return {\n data: {\n maxSizeAlreadyReset: true\n },\n reset: {\n rects: true\n }\n };\n }\n });\nexport function maxSize(autoSize, options) {\n const { container, overflowBoundary } = options;\n return size({\n ...overflowBoundary && {\n altBoundary: true,\n boundary: getBoundary(container, overflowBoundary)\n },\n apply ({ availableHeight, availableWidth, elements, rects }) {\n const applyMaxSizeStyles = (apply, dimension, availableSize)=>{\n if (!apply) {\n return;\n }\n elements.floating.style.setProperty('box-sizing', 'border-box');\n elements.floating.style.setProperty(`max-${dimension}`, `${availableSize}px`);\n if (rects.floating[dimension] > availableSize) {\n elements.floating.style.setProperty(dimension, `${availableSize}px`);\n const axis = dimension === 'width' ? 'x' : 'y';\n if (!elements.floating.style.getPropertyValue(`overflow-${axis}`)) {\n elements.floating.style.setProperty(`overflow-${axis}`, 'auto');\n }\n }\n };\n const { applyMaxWidth, applyMaxHeight } = autoSize;\n applyMaxSizeStyles(applyMaxWidth, 'width', availableWidth);\n applyMaxSizeStyles(applyMaxHeight, 'height', availableHeight);\n }\n });\n}\n"],"names":["
|
1
|
+
{"version":3,"sources":["maxSize.js"],"sourcesContent":["import { size } from '@floating-ui/dom';\nimport { getBoundary } from '../utils/getBoundary';\n/**\n * floating-ui `size` middleware uses floating element's height/width to calculate available height/width.\n * This middleware only runs once per lifecycle, resetting styles applied by maxSize from previous lifecycle.\n * Then floating element's original size is restored and `size` middleware can calculate available height/width correctly.\n */ export const resetMaxSize = (autoSize)=>({\n name: 'resetMaxSize',\n fn ({ middlewareData, elements }) {\n var _middlewareData_resetMaxSize;\n if ((_middlewareData_resetMaxSize = middlewareData.resetMaxSize) === null || _middlewareData_resetMaxSize === void 0 ? void 0 : _middlewareData_resetMaxSize.maxSizeAlreadyReset) {\n return {};\n }\n const { applyMaxWidth, applyMaxHeight } = autoSize;\n if (applyMaxWidth) {\n elements.floating.style.removeProperty('box-sizing');\n elements.floating.style.removeProperty('max-width');\n elements.floating.style.removeProperty('width');\n }\n if (applyMaxHeight) {\n elements.floating.style.removeProperty('box-sizing');\n elements.floating.style.removeProperty('max-height');\n elements.floating.style.removeProperty('height');\n }\n return {\n data: {\n maxSizeAlreadyReset: true\n },\n reset: {\n rects: true\n }\n };\n }\n });\nexport function maxSize(autoSize, options) {\n const { container, overflowBoundary } = options;\n return size({\n ...overflowBoundary && {\n altBoundary: true,\n boundary: getBoundary(container, overflowBoundary)\n },\n apply ({ availableHeight, availableWidth, elements, rects }) {\n const applyMaxSizeStyles = (apply, dimension, availableSize)=>{\n if (!apply) {\n return;\n }\n elements.floating.style.setProperty('box-sizing', 'border-box');\n elements.floating.style.setProperty(`max-${dimension}`, `${availableSize}px`);\n if (rects.floating[dimension] > availableSize) {\n elements.floating.style.setProperty(dimension, `${availableSize}px`);\n const axis = dimension === 'width' ? 'x' : 'y';\n if (!elements.floating.style.getPropertyValue(`overflow-${axis}`)) {\n elements.floating.style.setProperty(`overflow-${axis}`, 'auto');\n }\n }\n };\n const { applyMaxWidth, applyMaxHeight } = autoSize;\n applyMaxSizeStyles(applyMaxWidth, 'width', availableWidth);\n applyMaxSizeStyles(applyMaxHeight, 'height', availableHeight);\n }\n });\n}\n"],"names":["maxSize","resetMaxSize","autoSize","name","fn","middlewareData","elements","_middlewareData_resetMaxSize","maxSizeAlreadyReset","applyMaxWidth","applyMaxHeight","floating","style","removeProperty","data","reset","rects","options","container","overflowBoundary","size","altBoundary","boundary","getBoundary","apply","availableHeight","availableWidth","applyMaxSizeStyles","dimension","availableSize","setProperty","axis","getPropertyValue"],"mappings":";;;;;;;;;;;IAkCgBA,OAAO;eAAPA;;IA5BCC,YAAY;eAAZA;;;qBANI;6BACO;AAKjB,MAAMA,eAAe,CAACC,WAAY,CAAA;QACrCC,MAAM;QACNC,IAAI,EAAEC,cAAc,EAAEC,QAAQ,EAAE;YAC5B,IAAIC;YACJ,IAAI,AAACA,CAAAA,+BAA+BF,eAAeJ,YAAY,AAAD,MAAO,QAAQM,iCAAiC,KAAK,IAAI,KAAK,IAAIA,6BAA6BC,mBAAmB,EAAE;gBAC9K,OAAO,CAAC;YACZ;YACA,MAAM,EAAEC,aAAa,EAAEC,cAAc,EAAE,GAAGR;YAC1C,IAAIO,eAAe;gBACfH,SAASK,QAAQ,CAACC,KAAK,CAACC,cAAc,CAAC;gBACvCP,SAASK,QAAQ,CAACC,KAAK,CAACC,cAAc,CAAC;gBACvCP,SAASK,QAAQ,CAACC,KAAK,CAACC,cAAc,CAAC;YAC3C;YACA,IAAIH,gBAAgB;gBAChBJ,SAASK,QAAQ,CAACC,KAAK,CAACC,cAAc,CAAC;gBACvCP,SAASK,QAAQ,CAACC,KAAK,CAACC,cAAc,CAAC;gBACvCP,SAASK,QAAQ,CAACC,KAAK,CAACC,cAAc,CAAC;YAC3C;YACA,OAAO;gBACHC,MAAM;oBACFN,qBAAqB;gBACzB;gBACAO,OAAO;oBACHC,OAAO;gBACX;YACJ;QACJ;IACJ,CAAA;AACG,SAAShB,QAAQE,QAAQ,EAAEe,OAAO;IACrC,MAAM,EAAEC,SAAS,EAAEC,gBAAgB,EAAE,GAAGF;IACxC,OAAOG,IAAAA,SAAI,EAAC;QACR,GAAGD,oBAAoB;YACnBE,aAAa;YACbC,UAAUC,IAAAA,wBAAW,EAACL,WAAWC;QACrC,CAAC;QACDK,OAAO,EAAEC,eAAe,EAAEC,cAAc,EAAEpB,QAAQ,EAAEU,KAAK,EAAE;YACvD,MAAMW,qBAAqB,CAACH,OAAOI,WAAWC;gBAC1C,IAAI,CAACL,OAAO;oBACR;gBACJ;gBACAlB,SAASK,QAAQ,CAACC,KAAK,CAACkB,WAAW,CAAC,cAAc;gBAClDxB,SAASK,QAAQ,CAACC,KAAK,CAACkB,WAAW,CAAC,CAAC,IAAI,EAAEF,UAAU,CAAC,EAAE,CAAC,EAAEC,cAAc,EAAE,CAAC;gBAC5E,IAAIb,MAAML,QAAQ,CAACiB,UAAU,GAAGC,eAAe;oBAC3CvB,SAASK,QAAQ,CAACC,KAAK,CAACkB,WAAW,CAACF,WAAW,CAAC,EAAEC,cAAc,EAAE,CAAC;oBACnE,MAAME,OAAOH,cAAc,UAAU,MAAM;oBAC3C,IAAI,CAACtB,SAASK,QAAQ,CAACC,KAAK,CAACoB,gBAAgB,CAAC,CAAC,SAAS,EAAED,KAAK,CAAC,GAAG;wBAC/DzB,SAASK,QAAQ,CAACC,KAAK,CAACkB,WAAW,CAAC,CAAC,SAAS,EAAEC,KAAK,CAAC,EAAE;oBAC5D;gBACJ;YACJ;YACA,MAAM,EAAEtB,aAAa,EAAEC,cAAc,EAAE,GAAGR;YAC1CyB,mBAAmBlB,eAAe,SAASiB;YAC3CC,mBAAmBjB,gBAAgB,UAAUe;QACjD;IACJ;AACJ"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-positioning",
|
3
|
-
"version": "0.0.0-nightly-
|
3
|
+
"version": "0.0.0-nightly-20240315-0408.1",
|
4
4
|
"description": "A react wrapper around Popper.js for Fluent UI",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
@@ -31,9 +31,9 @@
|
|
31
31
|
"dependencies": {
|
32
32
|
"@floating-ui/dom": "^1.2.0",
|
33
33
|
"@floating-ui/devtools": "0.2.1",
|
34
|
-
"@fluentui/react-shared-contexts": "0.0.0-nightly-
|
35
|
-
"@fluentui/react-theme": "0.0.0-nightly-
|
36
|
-
"@fluentui/react-utilities": "0.0.0-nightly-
|
34
|
+
"@fluentui/react-shared-contexts": "0.0.0-nightly-20240315-0408.1",
|
35
|
+
"@fluentui/react-theme": "0.0.0-nightly-20240315-0408.1",
|
36
|
+
"@fluentui/react-utilities": "0.0.0-nightly-20240315-0408.1",
|
37
37
|
"@griffel/react": "^1.5.14",
|
38
38
|
"@swc/helpers": "^0.5.1"
|
39
39
|
},
|