@fluentui/react-tabs 9.3.4 → 9.3.5
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/.swcrc +30 -0
- package/CHANGELOG.json +58 -1
- package/CHANGELOG.md +18 -2
- package/lib/Tab.js.map +1 -1
- package/lib/TabList.js.map +1 -1
- package/lib/components/Tab/Tab.js.map +1 -1
- package/lib/components/Tab/Tab.types.js.map +1 -1
- package/lib/components/Tab/index.js.map +1 -1
- package/lib/components/Tab/renderTab.js +1 -7
- package/lib/components/Tab/renderTab.js.map +1 -1
- package/lib/components/Tab/useTab.js.map +1 -1
- package/lib/components/Tab/useTabAnimatedIndicator.js +4 -4
- package/lib/components/Tab/useTabAnimatedIndicator.js.map +1 -1
- package/lib/components/Tab/useTabStyles.js +4 -6
- package/lib/components/Tab/useTabStyles.js.map +1 -1
- package/lib/components/TabList/TabList.js.map +1 -1
- package/lib/components/TabList/TabList.types.js +1 -1
- package/lib/components/TabList/TabList.types.js.map +1 -1
- package/lib/components/TabList/TabListContext.js +3 -6
- package/lib/components/TabList/TabListContext.js.map +1 -1
- package/lib/components/TabList/index.js.map +1 -1
- package/lib/components/TabList/renderTabList.js +1 -3
- package/lib/components/TabList/renderTabList.js.map +1 -1
- package/lib/components/TabList/useTabList.js.map +1 -1
- package/lib/components/TabList/useTabListContextValues.js.map +1 -1
- package/lib/components/TabList/useTabListStyles.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/Tab.js +5 -4
- package/lib-commonjs/Tab.js.map +1 -1
- package/lib-commonjs/TabList.js +5 -4
- package/lib-commonjs/TabList.js.map +1 -1
- package/lib-commonjs/components/Tab/Tab.js +19 -20
- package/lib-commonjs/components/Tab/Tab.js.map +1 -1
- package/lib-commonjs/components/Tab/Tab.types.js +3 -2
- package/lib-commonjs/components/Tab/Tab.types.js.map +1 -1
- package/lib-commonjs/components/Tab/index.js +10 -9
- package/lib-commonjs/components/Tab/index.js.map +1 -1
- package/lib-commonjs/components/Tab/renderTab.js +16 -25
- package/lib-commonjs/components/Tab/renderTab.js.map +1 -1
- package/lib-commonjs/components/Tab/useTab.js +76 -82
- package/lib-commonjs/components/Tab/useTab.js.map +1 -1
- package/lib-commonjs/components/Tab/useTabAnimatedIndicator.js +133 -117
- package/lib-commonjs/components/Tab/useTabAnimatedIndicator.js.map +1 -1
- package/lib-commonjs/components/Tab/useTabStyles.js +751 -396
- package/lib-commonjs/components/Tab/useTabStyles.js.map +1 -1
- package/lib-commonjs/components/TabList/TabList.js +21 -22
- package/lib-commonjs/components/TabList/TabList.js.map +1 -1
- package/lib-commonjs/components/TabList/TabList.types.js +5 -2
- package/lib-commonjs/components/TabList/TabList.types.js.map +1 -1
- package/lib-commonjs/components/TabList/TabListContext.js +34 -28
- package/lib-commonjs/components/TabList/TabListContext.js.map +1 -1
- package/lib-commonjs/components/TabList/index.js +11 -10
- package/lib-commonjs/components/TabList/index.js.map +1 -1
- package/lib-commonjs/components/TabList/renderTabList.js +16 -21
- package/lib-commonjs/components/TabList/renderTabList.js.map +1 -1
- package/lib-commonjs/components/TabList/useTabList.js +73 -84
- package/lib-commonjs/components/TabList/useTabList.js.map +1 -1
- package/lib-commonjs/components/TabList/useTabListContextValues.js +23 -32
- package/lib-commonjs/components/TabList/useTabListContextValues.js.map +1 -1
- package/lib-commonjs/components/TabList/useTabListStyles.js +46 -36
- package/lib-commonjs/components/TabList/useTabListStyles.js.map +1 -1
- package/lib-commonjs/index.js +27 -84
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +10 -9
- package/lib-amd/Tab.js +0 -6
- package/lib-amd/Tab.js.map +0 -1
- package/lib-amd/TabList.js +0 -6
- package/lib-amd/TabList.js.map +0 -1
- package/lib-amd/components/Tab/Tab.js +0 -17
- package/lib-amd/components/Tab/Tab.js.map +0 -1
- package/lib-amd/components/Tab/Tab.types.js +0 -5
- package/lib-amd/components/Tab/Tab.types.js.map +0 -1
- package/lib-amd/components/Tab/index.js +0 -11
- package/lib-amd/components/Tab/index.js.map +0 -1
- package/lib-amd/components/Tab/renderTab.js +0 -17
- package/lib-amd/components/Tab/renderTab.js.map +0 -1
- package/lib-amd/components/Tab/useTab.js +0 -63
- package/lib-amd/components/Tab/useTab.js.map +0 -1
- package/lib-amd/components/Tab/useTabAnimatedIndicator.js +0 -112
- package/lib-amd/components/Tab/useTabAnimatedIndicator.js.map +0 -1
- package/lib-amd/components/Tab/useTabStyles.js +0 -380
- package/lib-amd/components/Tab/useTabStyles.js.map +0 -1
- package/lib-amd/components/TabList/TabList.js +0 -18
- package/lib-amd/components/TabList/TabList.js.map +0 -1
- package/lib-amd/components/TabList/TabList.types.js +0 -5
- package/lib-amd/components/TabList/TabList.types.js.map +0 -1
- package/lib-amd/components/TabList/TabListContext.js +0 -37
- package/lib-amd/components/TabList/TabListContext.js.map +0 -1
- package/lib-amd/components/TabList/index.js +0 -12
- package/lib-amd/components/TabList/index.js.map +0 -1
- package/lib-amd/components/TabList/renderTabList.js +0 -15
- package/lib-amd/components/TabList/renderTabList.js.map +0 -1
- package/lib-amd/components/TabList/useTabList.js +0 -74
- package/lib-amd/components/TabList/useTabList.js.map +0 -1
- package/lib-amd/components/TabList/useTabListContextValues.js +0 -23
- package/lib-amd/components/TabList/useTabListContextValues.js.map +0 -1
- package/lib-amd/components/TabList/useTabListStyles.js +0 -39
- package/lib-amd/components/TabList/useTabListStyles.js.map +0 -1
- package/lib-amd/index.js +0 -19
- package/lib-amd/index.js.map +0 -1
|
@@ -9,9 +9,7 @@ export const renderTabList_unstable = (state, contextValues) => {
|
|
|
9
9
|
slots,
|
|
10
10
|
slotProps
|
|
11
11
|
} = getSlots(state);
|
|
12
|
-
return /*#__PURE__*/React.createElement(slots.root, {
|
|
13
|
-
...slotProps.root
|
|
14
|
-
}, /*#__PURE__*/React.createElement(TabListProvider, {
|
|
12
|
+
return /*#__PURE__*/React.createElement(slots.root, slotProps.root, /*#__PURE__*/React.createElement(TabListProvider, {
|
|
15
13
|
value: contextValues.tabList
|
|
16
14
|
}, state.root.children));
|
|
17
15
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","getSlots","TabListProvider","renderTabList_unstable","state","contextValues","slots","slotProps","createElement","root","value","tabList","children"],"sources":["
|
|
1
|
+
{"version":3,"names":["React","getSlots","TabListProvider","renderTabList_unstable","state","contextValues","slots","slotProps","createElement","root","value","tabList","children"],"sources":["../../../src/components/TabList/renderTabList.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { TabListState, TabListSlots, TabListContextValues } from './TabList.types';\nimport { TabListProvider } from './TabListContext';\n\n/**\n * Render the final JSX of TabList\n */\nexport const renderTabList_unstable = (state: TabListState, contextValues: TabListContextValues) => {\n const { slots, slotProps } = getSlots<TabListSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n <TabListProvider value={contextValues.tabList}>{state.root.children}</TabListProvider>\n </slots.root>\n );\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,QAAQ,QAAQ;AAEzB,SAASC,eAAe,QAAQ;AAEhC;;;AAGA,OAAO,MAAMC,sBAAA,GAAyBA,CAACC,KAAA,EAAqBC,aAAA,KAAwC;EAClG,MAAM;IAAEC,KAAA;IAAOC;EAAS,CAAE,GAAGN,QAAA,CAAuBG,KAAA;EAEpD,oBACEJ,KAAA,CAAAQ,aAAA,CAACF,KAAA,CAAMG,IAAI,EAAKF,SAAA,CAAUE,IAAI,eAC5BT,KAAA,CAAAQ,aAAA,CAACN,eAAA;IAAgBQ,KAAA,EAAOL,aAAA,CAAcM;KAAUP,KAAA,CAAMK,IAAI,CAACG,QAAQ;AAGzE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useArrowNavigationGroup","getNativeElementProps","useControllableState","useEventCallback","useMergedRefs","useTabList_unstable","props","ref","appearance","reserveSelectedTabSpace","disabled","onTabSelect","size","vertical","innerRef","useRef","focusAttributes","circular","axis","memorizeCurrent","selectedValue","setSelectedValue","state","defaultState","defaultSelectedValue","initialState","undefined","currentSelectedValue","previousSelectedValue","useEffect","current","onSelect","event","data","value","registeredTabs","onRegister","JSON","stringify","onUnregister","getRegisteredTabs","useCallback","components","root","role"],"sources":["
|
|
1
|
+
{"version":3,"names":["React","useArrowNavigationGroup","getNativeElementProps","useControllableState","useEventCallback","useMergedRefs","useTabList_unstable","props","ref","appearance","reserveSelectedTabSpace","disabled","onTabSelect","size","vertical","innerRef","useRef","focusAttributes","circular","axis","memorizeCurrent","selectedValue","setSelectedValue","state","defaultState","defaultSelectedValue","initialState","undefined","currentSelectedValue","previousSelectedValue","useEffect","current","onSelect","event","data","value","registeredTabs","onRegister","JSON","stringify","onUnregister","getRegisteredTabs","useCallback","components","root","role"],"sources":["../../../src/components/TabList/useTabList.ts"],"sourcesContent":["import * as React from 'react';\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport {\n getNativeElementProps,\n useControllableState,\n useEventCallback,\n useMergedRefs,\n} from '@fluentui/react-utilities';\nimport type { TabRegisterData, SelectTabData, SelectTabEvent, TabListProps, TabListState } from './TabList.types';\nimport { TabValue } from '../Tab/Tab.types';\n\n/**\n * Create the state required to render TabList.\n *\n * The returned state can be modified with hooks such as useTabListStyles_unstable,\n * before being passed to renderTabList_unstable.\n *\n * @param props - props from this instance of TabList\n * @param ref - reference to root HTMLElement of TabList\n */\nexport const useTabList_unstable = (props: TabListProps, ref: React.Ref<HTMLElement>): TabListState => {\n const {\n appearance = 'transparent',\n reserveSelectedTabSpace = true,\n disabled = false,\n onTabSelect,\n size = 'medium',\n vertical = false,\n } = props;\n\n const innerRef = React.useRef<HTMLElement>(null);\n\n const focusAttributes = useArrowNavigationGroup({\n circular: true,\n axis: vertical ? 'vertical' : 'horizontal',\n memorizeCurrent: true,\n });\n\n const [selectedValue, setSelectedValue] = useControllableState({\n state: props.selectedValue,\n defaultState: props.defaultSelectedValue,\n initialState: undefined,\n });\n\n // considered usePrevious, but it is sensitive to re-renders\n // this could cause the previous to move to current in the case where the tab list re-renders.\n // these refs avoid getRegisteredTabs changing when selectedValue changes and causing\n // renders for tabs that have not changed.\n const currentSelectedValue = React.useRef<TabValue | undefined>(undefined);\n const previousSelectedValue = React.useRef<TabValue | undefined>(undefined);\n\n React.useEffect(() => {\n previousSelectedValue.current = currentSelectedValue.current;\n currentSelectedValue.current = selectedValue;\n }, [selectedValue]);\n\n const onSelect = useEventCallback((event: SelectTabEvent, data: SelectTabData) => {\n setSelectedValue(data.value);\n onTabSelect?.(event, data);\n });\n\n const registeredTabs = React.useRef<Record<string, TabRegisterData>>({});\n\n const onRegister = useEventCallback((data: TabRegisterData) => {\n registeredTabs.current[JSON.stringify(data.value)] = data;\n });\n\n const onUnregister = useEventCallback((data: TabRegisterData) => {\n delete registeredTabs.current[JSON.stringify(data.value)];\n });\n\n const getRegisteredTabs = React.useCallback(() => {\n return {\n selectedValue: currentSelectedValue.current,\n previousSelectedValue: previousSelectedValue.current,\n registeredTabs: registeredTabs.current,\n };\n }, []);\n\n return {\n components: {\n root: 'div',\n },\n root: getNativeElementProps('div', {\n ref: useMergedRefs(ref, innerRef),\n role: 'tablist',\n ...focusAttributes,\n ...props,\n }),\n appearance,\n reserveSelectedTabSpace,\n disabled,\n selectedValue,\n size,\n vertical,\n onRegister,\n onUnregister,\n onSelect,\n getRegisteredTabs,\n };\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,uBAAuB,QAAQ;AACxC,SACEC,qBAAqB,EACrBC,oBAAoB,EACpBC,gBAAgB,EAChBC,aAAa,QACR;AAIP;;;;;;;;;AASA,OAAO,MAAMC,mBAAA,GAAsBA,CAACC,KAAA,EAAqBC,GAAA,KAA8C;EACrG,MAAM;IACJC,UAAA,GAAa;IACbC,uBAAA,GAA0B,IAAI;IAC9BC,QAAA,GAAW,KAAK;IAChBC,WAAA;IACAC,IAAA,GAAO;IACPC,QAAA,GAAW;EAAK,CACjB,GAAGP,K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IAAA,CAAKC,SAAS,CAACL,IAAA,CAAKC,KAAK,EAAE;EAC3D;EAEA,MAAMM,iBAAA,GAAoBzC,KAAA,CAAM0C,WAAW,CAAC,MAAM;IAChD,OAAO;MACLrB,aAAA,EAAeO,oBAAA,CAAqBG,OAAO;MAC3CF,qBAAA,EAAuBA,qBAAA,CAAsBE,OAAO;MACpDK,cAAA,EAAgBA,cAAA,CAAeL;IACjC;EACF,GAAG,EAAE;EAEL,OAAO;IACLY,UAAA,EAAY;MACVC,IAAA,EAAM;IACR;IACAA,IAAA,EAAM1C,qBAAA,CAAsB,OAAO;MACjCM,GAAA,EAAKH,aAAA,CAAcG,GAAA,EAAKO,QAAA;MACxB8B,IAAA,EAAM;MACN,GAAG5B,eAAe;MAClB,GAAGV;IACL;IACAE,UAAA;IACAC,uBAAA;IACAC,QAAA;IACAU,aAAA;IACAR,IAAA;IACAC,QAAA;IACAuB,UAAA;IACAG,YAAA;IACAR,QAAA;IACAS;EACF;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useTabListContextValues_unstable","state","appearance","reserveSelectedTabSpace","disabled","selectedValue","selectedKey","onRegister","onUnregister","onSelect","getRegisteredTabs","size","vertical","tabList"],"sources":["
|
|
1
|
+
{"version":3,"names":["useTabListContextValues_unstable","state","appearance","reserveSelectedTabSpace","disabled","selectedValue","selectedKey","onRegister","onUnregister","onSelect","getRegisteredTabs","size","vertical","tabList"],"sources":["../../../src/components/TabList/useTabListContextValues.tsx"],"sourcesContent":["import { TabListContextValue, TabListContextValues, TabListState } from './TabList.types';\n\nexport function useTabListContextValues_unstable(state: TabListState): TabListContextValues {\n const {\n appearance,\n reserveSelectedTabSpace,\n disabled,\n selectedValue: selectedKey,\n onRegister,\n onUnregister,\n onSelect,\n getRegisteredTabs,\n size,\n vertical,\n } = state;\n\n const tabList: TabListContextValue = {\n appearance,\n reserveSelectedTabSpace,\n disabled,\n selectedValue: selectedKey,\n onSelect,\n onRegister,\n onUnregister,\n getRegisteredTabs,\n size,\n vertical,\n };\n\n return { tabList };\n}\n"],"mappings":"AAEA,OAAO,SAASA,iCAAiCC,KAAmB,EAAwB;EAC1F,MAAM;IACJC,UAAA;IACAC,uBAAA;IACAC,QAAA;IACAC,aAAA,EAAeC,WAAA;IACfC,UAAA;IACAC,YAAA;IACAC,QAAA;IACAC,iBAAA;IACAC,IAAA;IACAC;EAAQ,CACT,GAAGX,KAAA;EAEJ,MAAMY,OAAA,GAA+B;IACnCX,UAAA;IACAC,uBAAA;IACAC,QAAA;IACAC,aAAA,EAAeC,WAAA;IACfG,QAAA;IACAF,UAAA;IACAC,YAAA;IACAE,iBAAA;IACAC,IAAA;IACAC;EACF;EAEA,OAAO;IAAEC;EAAQ;AACnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__styles","mergeClasses","tabListClassNames","root","useStyles","mc9l5x","Beiy3e4","Bnnss6s","Eh141a","qhf8xq","horizontal","Bt984gj","vertical","d","useTabListStyles_unstable","state","styles","className"],"sources":["
|
|
1
|
+
{"version":3,"names":["__styles","mergeClasses","tabListClassNames","root","useStyles","mc9l5x","Beiy3e4","Bnnss6s","Eh141a","qhf8xq","horizontal","Bt984gj","vertical","d","useTabListStyles_unstable","state","styles","className"],"sources":["../../../src/components/TabList/useTabListStyles.ts"],"sourcesContent":["import { SlotClassNames } from '@fluentui/react-utilities';\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport type { TabListSlots, TabListState } from './TabList.types';\n\nexport const tabListClassNames: SlotClassNames<TabListSlots> = {\n root: 'fui-TabList',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n display: 'flex',\n flexDirection: 'row',\n flexShrink: 0,\n flexWrap: 'nowrap',\n position: 'relative',\n },\n horizontal: {\n alignItems: 'stretch',\n flexDirection: 'row',\n },\n vertical: {\n alignItems: 'stretch',\n flexDirection: 'column',\n },\n});\n\n/**\n * Apply styling to the TabList slots based on the state\n */\nexport const useTabListStyles_unstable = (state: TabListState): TabListState => {\n const { vertical } = state;\n\n const styles = useStyles();\n\n state.root.className = mergeClasses(\n tabListClassNames.root,\n styles.root,\n vertical ? styles.vertical : styles.horizontal,\n state.root.className,\n );\n\n return state;\n};\n"],"mappings":"AACA,SAAAA,QAAA,EAAqBC,YAAY,QAAQ;AAGzC,OAAO,MAAMC,iBAAA,GAAkD;EAC7DC,IAAA,EAAM;AACR;AAEA;;;AAGA,MAAMC,SAAA,gBAAYJ,QAAA;EAAAG,IAAA;IAAAE,MAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IAAAC,MAAA;EAAA;EAAAC,UAAA;IAAAC,OAAA;IAAAL,OAAA;EAAA;EAAAM,QAAA;IAAAD,OAAA;IAAAL,OAAA;EAAA;AAAA;EAAAO,CAAA;AAAA,EAgBlB;AAEA;;;AAGA,OAAO,MAAMC,yBAAA,GAA6BC,KAAA,IAAsC;EAC9E,MAAM;IAAEH;EAAQ,CAAE,GAAGG,KAAA;EAErB,MAAMC,MAAA,GAASZ,SAAA;EAEfW,KAAA,CAAMZ,IAAI,CAACc,SAAS,GAAGhB,YAAA,CACrBC,iBAAA,CAAkBC,IAAI,EACtBa,MAAA,CAAOb,IAAI,EACXS,QAAA,GAAWI,MAAA,CAAOJ,QAAQ,GAAGI,MAAA,CAAON,UAAU,EAC9CK,KAAA,CAAMZ,IAAI,CAACc,SAAS;EAGtB,OAAOF,KAAA;AACT"}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["renderTab_unstable","Tab","tabClassNames","useTabStyles_unstable","useTab_unstable","renderTabList_unstable","TabList","TabListProvider","tabListClassNames","useTabListContext_unstable","useTabListContextValues_unstable","useTabListStyles_unstable","useTabList_unstable"],"sources":["../src/
|
|
1
|
+
{"version":3,"names":["renderTab_unstable","Tab","tabClassNames","useTabStyles_unstable","useTab_unstable","renderTabList_unstable","TabList","TabListProvider","tabListClassNames","useTabListContext_unstable","useTabListContextValues_unstable","useTabListStyles_unstable","useTabList_unstable"],"sources":["../src/index.ts"],"sourcesContent":["export type { TabProps, TabSlots, TabState, TabValue } from './Tab';\nexport { renderTab_unstable, Tab, tabClassNames, useTabStyles_unstable, useTab_unstable } from './Tab';\nexport type {\n TabRegisterData,\n RegisterTabEventHandler,\n SelectTabData,\n SelectTabEvent,\n SelectTabEventHandler,\n TabListContextValue,\n TabListContextValues,\n TabListProps,\n TabListSlots,\n TabListState,\n} from './TabList';\nexport {\n renderTabList_unstable,\n TabList,\n TabListProvider,\n tabListClassNames,\n useTabListContext_unstable,\n useTabListContextValues_unstable,\n useTabListStyles_unstable,\n useTabList_unstable,\n} from './TabList';\n"],"mappings":"AACA,SAASA,kBAAkB,EAAEC,GAAG,EAAEC,aAAa,EAAEC,qBAAqB,EAAEC,eAAe,QAAQ;AAa/F,SACEC,sBAAsB,EACtBC,OAAO,EACPC,eAAe,EACfC,iBAAiB,EACjBC,0BAA0B,EAC1BC,gCAAgC,EAChCC,yBAAyB,EACzBC,mBAAmB,QACd"}
|
package/lib-commonjs/Tab.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
5
4
|
});
|
|
6
|
-
const
|
|
7
|
-
|
|
5
|
+
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
|
6
|
+
_exportStar(require("./components/Tab/index"), exports);
|
|
7
|
+
//# sourceMappingURL=Tab.js.map
|
|
8
|
+
|
|
8
9
|
//# sourceMappingURL=Tab.js.map
|
package/lib-commonjs/Tab.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../lib/Tab.js"],"sourcesContent":["export * from './components/Tab/index';\n//# sourceMappingURL=Tab.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,+BAA+B"}
|
package/lib-commonjs/TabList.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
5
4
|
});
|
|
6
|
-
const
|
|
7
|
-
|
|
5
|
+
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
|
6
|
+
_exportStar(require("./components/TabList/index"), exports);
|
|
7
|
+
//# sourceMappingURL=TabList.js.map
|
|
8
|
+
|
|
8
9
|
//# sourceMappingURL=TabList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../lib/TabList.js"],"sourcesContent":["export * from './components/TabList/index';\n//# sourceMappingURL=TabList.js.map"],"names":[],"mappings":";;;;;oBAAc;CACd,mCAAmC"}
|
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "Tab", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>Tab
|
|
5
8
|
});
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const {
|
|
19
|
-
useTabStyles_unstable: useCustomStyles
|
|
20
|
-
} = react_shared_contexts_1.useCustomStyleHooks_unstable();
|
|
21
|
-
useCustomStyles(state);
|
|
22
|
-
return renderTab_1.renderTab_unstable(state);
|
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
11
|
+
const _useTab = require("./useTab");
|
|
12
|
+
const _renderTab = require("./renderTab");
|
|
13
|
+
const _useTabStyles = require("./useTabStyles");
|
|
14
|
+
const _reactSharedContexts = require("@fluentui/react-shared-contexts");
|
|
15
|
+
const Tab = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
16
|
+
const state = (0, _useTab.useTab_unstable)(props, ref);
|
|
17
|
+
(0, _useTabStyles.useTabStyles_unstable)(state);
|
|
18
|
+
const { useTabStyles_unstable: useCustomStyles } = (0, _reactSharedContexts.useCustomStyleHooks_unstable)();
|
|
19
|
+
useCustomStyles(state);
|
|
20
|
+
return (0, _renderTab.renderTab_unstable)(state);
|
|
23
21
|
});
|
|
24
|
-
|
|
22
|
+
Tab.displayName = 'Tab'; //# sourceMappingURL=Tab.js.map
|
|
23
|
+
|
|
25
24
|
//# sourceMappingURL=Tab.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/Tab/Tab.js"],"sourcesContent":["import * as React from 'react';\nimport { useTab_unstable } from './useTab';\nimport { renderTab_unstable } from './renderTab';\nimport { useTabStyles_unstable } from './useTabStyles';\nimport { useCustomStyleHooks_unstable } from '@fluentui/react-shared-contexts';\n/**\n * A tab provides a selectable item in a tab list.\n */\nexport const Tab = /*#__PURE__*/React.forwardRef((props, ref) => {\n const state = useTab_unstable(props, ref);\n useTabStyles_unstable(state);\n const {\n useTabStyles_unstable: useCustomStyles\n } = useCustomStyleHooks_unstable();\n useCustomStyles(state);\n return renderTab_unstable(state);\n});\nTab.displayName = 'Tab';\n//# sourceMappingURL=Tab.js.map"],"names":["Tab","React","forwardRef","props","ref","state","useTab_unstable","useTabStyles_unstable","useCustomStyles","useCustomStyleHooks_unstable","renderTab_unstable","displayName"],"mappings":";;;;+BAQaA;;aAAAA;;;6DARU;wBACS;2BACG;8BACG;qCACO;AAItC,MAAMA,MAAM,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAQ;IAC/D,MAAMC,QAAQC,IAAAA,uBAAe,EAACH,OAAOC;IACrCG,IAAAA,mCAAqB,EAACF;IACtB,MAAM,EACJE,uBAAuBC,gBAAe,EACvC,GAAGC,IAAAA,iDAA4B;IAChCD,gBAAgBH;IAChB,OAAOK,IAAAA,6BAAkB,EAACL;AAC5B;AACAL,IAAIW,WAAW,GAAG,OAClB,+BAA+B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/Tab/Tab.types.js"],"sourcesContent":["export {};\n//# sourceMappingURL=Tab.types.js.map"],"names":[],"mappings":";;;;CACA,qCAAqC"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
5
4
|
});
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
|
6
|
+
_exportStar(require("./Tab"), exports);
|
|
7
|
+
_exportStar(require("./Tab.types"), exports);
|
|
8
|
+
_exportStar(require("./renderTab"), exports);
|
|
9
|
+
_exportStar(require("./useTab"), exports);
|
|
10
|
+
_exportStar(require("./useTabStyles"), exports);
|
|
11
|
+
_exportStar(require("./useTabAnimatedIndicator"), exports);
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
13
|
+
|
|
13
14
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/Tab/index.js"],"sourcesContent":["export * from './Tab';\nexport * from './Tab.types';\nexport * from './renderTab';\nexport * from './useTab';\nexport * from './useTabStyles';\nexport * from './useTabAnimatedIndicator';\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA;oBACA;CACd,iCAAiC"}
|
|
@@ -1,29 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "renderTab_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>renderTab_unstable
|
|
5
8
|
});
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return React.createElement(slots.root, {
|
|
18
|
-
...slotProps.root
|
|
19
|
-
}, slots.icon && React.createElement(slots.icon, {
|
|
20
|
-
...slotProps.icon
|
|
21
|
-
}), !state.iconOnly && React.createElement(slots.content, {
|
|
22
|
-
...slotProps.content
|
|
23
|
-
}), !state.selected && !state.iconOnly && state.contentReservedSpaceClassName !== undefined && React.createElement(slots.content, {
|
|
24
|
-
...slotProps.content,
|
|
25
|
-
className: state.contentReservedSpaceClassName
|
|
26
|
-
}));
|
|
27
|
-
};
|
|
28
|
-
exports.renderTab_unstable = renderTab_unstable;
|
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
11
|
+
const _reactUtilities = require("@fluentui/react-utilities");
|
|
12
|
+
const renderTab_unstable = (state)=>{
|
|
13
|
+
const { slots , slotProps } = (0, _reactUtilities.getSlots)(state);
|
|
14
|
+
return /*#__PURE__*/ _react.createElement(slots.root, slotProps.root, slots.icon && /*#__PURE__*/ _react.createElement(slots.icon, slotProps.icon), !state.iconOnly && /*#__PURE__*/ _react.createElement(slots.content, slotProps.content), !state.selected && !state.iconOnly && state.contentReservedSpaceClassName !== undefined && /*#__PURE__*/ _react.createElement(slots.content, {
|
|
15
|
+
...slotProps.content,
|
|
16
|
+
className: state.contentReservedSpaceClassName
|
|
17
|
+
}));
|
|
18
|
+
}; //# sourceMappingURL=renderTab.js.map
|
|
19
|
+
|
|
29
20
|
//# sourceMappingURL=renderTab.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/Tab/renderTab.js"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\n/**\n * Render the final JSX of Tab\n */\nexport const renderTab_unstable = state => {\n const {\n slots,\n slotProps\n } = getSlots(state);\n return /*#__PURE__*/React.createElement(slots.root, slotProps.root, slots.icon && /*#__PURE__*/React.createElement(slots.icon, slotProps.icon), !state.iconOnly && /*#__PURE__*/React.createElement(slots.content, slotProps.content), !state.selected && !state.iconOnly && state.contentReservedSpaceClassName !== undefined && /*#__PURE__*/React.createElement(slots.content, {\n ...slotProps.content,\n className: state.contentReservedSpaceClassName\n }));\n};\n//# sourceMappingURL=renderTab.js.map"],"names":["renderTab_unstable","state","slots","slotProps","getSlots","React","createElement","root","icon","iconOnly","content","selected","contentReservedSpaceClassName","undefined","className"],"mappings":";;;;+BAKaA;;aAAAA;;;6DALU;gCACE;AAIlB,MAAMA,qBAAqBC,CAAAA,QAAS;IACzC,MAAM,EACJC,MAAK,EACLC,UAAS,EACV,GAAGC,IAAAA,wBAAQ,EAACH;IACb,OAAO,WAAW,GAAEI,OAAMC,aAAa,CAACJ,MAAMK,IAAI,EAAEJ,UAAUI,IAAI,EAAEL,MAAMM,IAAI,IAAI,WAAW,GAAEH,OAAMC,aAAa,CAACJ,MAAMM,IAAI,EAAEL,UAAUK,IAAI,GAAG,CAACP,MAAMQ,QAAQ,IAAI,WAAW,GAAEJ,OAAMC,aAAa,CAACJ,MAAMQ,OAAO,EAAEP,UAAUO,OAAO,GAAG,CAACT,MAAMU,QAAQ,IAAI,CAACV,MAAMQ,QAAQ,IAAIR,MAAMW,6BAA6B,KAAKC,aAAa,WAAW,GAAER,OAAMC,aAAa,CAACJ,MAAMQ,OAAO,EAAE;QAChX,GAAGP,UAAUO,OAAO;QACpBI,WAAWb,MAAMW,6BAA6B;IAChD;AACF,GACA,qCAAqC"}
|
|
@@ -1,89 +1,83 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useTab_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: ()=>useTab_unstable
|
|
5
8
|
});
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
9
|
+
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
10
|
+
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
11
|
+
const _reactUtilities = require("@fluentui/react-utilities");
|
|
12
|
+
const _tabListContext = require("../TabList/TabListContext");
|
|
13
|
+
const useTab_unstable = (props, ref)=>{
|
|
14
|
+
const { content , disabled: tabDisabled = false , icon , value } = props;
|
|
15
|
+
const appearance = (0, _tabListContext.useTabListContext_unstable)((ctx)=>ctx.appearance);
|
|
16
|
+
const reserveSelectedTabSpace = (0, _tabListContext.useTabListContext_unstable)((ctx)=>ctx.reserveSelectedTabSpace);
|
|
17
|
+
const listDisabled = (0, _tabListContext.useTabListContext_unstable)((ctx)=>ctx.disabled);
|
|
18
|
+
const selected = (0, _tabListContext.useTabListContext_unstable)((ctx)=>ctx.selectedValue === value);
|
|
19
|
+
const onRegister = (0, _tabListContext.useTabListContext_unstable)((ctx)=>ctx.onRegister);
|
|
20
|
+
const onUnregister = (0, _tabListContext.useTabListContext_unstable)((ctx)=>ctx.onUnregister);
|
|
21
|
+
const onSelect = (0, _tabListContext.useTabListContext_unstable)((ctx)=>ctx.onSelect);
|
|
22
|
+
const size = (0, _tabListContext.useTabListContext_unstable)((ctx)=>ctx.size);
|
|
23
|
+
const vertical = (0, _tabListContext.useTabListContext_unstable)((ctx)=>!!ctx.vertical);
|
|
24
|
+
const disabled = listDisabled || tabDisabled;
|
|
25
|
+
const innerRef = _react.useRef(null);
|
|
26
|
+
const onClick = (0, _reactUtilities.useEventCallback)((event)=>onSelect(event, {
|
|
27
|
+
value
|
|
28
|
+
}));
|
|
29
|
+
_react.useEffect(()=>{
|
|
30
|
+
onRegister({
|
|
31
|
+
value,
|
|
32
|
+
ref: innerRef
|
|
33
|
+
});
|
|
34
|
+
return ()=>{
|
|
35
|
+
onUnregister({
|
|
36
|
+
value,
|
|
37
|
+
ref: innerRef
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
}, [
|
|
41
|
+
onRegister,
|
|
42
|
+
onUnregister,
|
|
43
|
+
innerRef,
|
|
44
|
+
value
|
|
45
|
+
]);
|
|
46
|
+
const iconShorthand = (0, _reactUtilities.resolveShorthand)(icon);
|
|
47
|
+
const contentShorthand = (0, _reactUtilities.resolveShorthand)(content, {
|
|
48
|
+
required: true,
|
|
49
|
+
defaultProps: {
|
|
50
|
+
children: props.children
|
|
51
|
+
}
|
|
44
52
|
});
|
|
45
|
-
return
|
|
46
|
-
|
|
53
|
+
return {
|
|
54
|
+
components: {
|
|
55
|
+
root: 'button',
|
|
56
|
+
icon: 'span',
|
|
57
|
+
content: 'span'
|
|
58
|
+
},
|
|
59
|
+
root: (0, _reactUtilities.getNativeElementProps)('button', {
|
|
60
|
+
ref: (0, _reactUtilities.useMergedRefs)(ref, innerRef),
|
|
61
|
+
role: 'tab',
|
|
62
|
+
type: 'button',
|
|
63
|
+
// aria-selected undefined indicates it is not selectable
|
|
64
|
+
// according to https://www.w3.org/TR/wai-aria-1.1/#aria-selected
|
|
65
|
+
'aria-selected': disabled ? undefined : `${selected}`,
|
|
66
|
+
...props,
|
|
67
|
+
disabled,
|
|
68
|
+
onClick
|
|
69
|
+
}),
|
|
70
|
+
icon: iconShorthand,
|
|
71
|
+
iconOnly: Boolean((iconShorthand === null || iconShorthand === void 0 ? void 0 : iconShorthand.children) && !contentShorthand.children),
|
|
72
|
+
content: contentShorthand,
|
|
73
|
+
appearance,
|
|
74
|
+
contentReservedSpaceClassName: reserveSelectedTabSpace ? '' : undefined,
|
|
75
|
+
disabled,
|
|
76
|
+
selected,
|
|
77
|
+
size,
|
|
47
78
|
value,
|
|
48
|
-
|
|
49
|
-
});
|
|
79
|
+
vertical
|
|
50
80
|
};
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
const contentShorthand = react_utilities_1.resolveShorthand(content, {
|
|
54
|
-
required: true,
|
|
55
|
-
defaultProps: {
|
|
56
|
-
children: props.children
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
return {
|
|
60
|
-
components: {
|
|
61
|
-
root: 'button',
|
|
62
|
-
icon: 'span',
|
|
63
|
-
content: 'span'
|
|
64
|
-
},
|
|
65
|
-
root: react_utilities_1.getNativeElementProps('button', {
|
|
66
|
-
ref: react_utilities_1.useMergedRefs(ref, innerRef),
|
|
67
|
-
role: 'tab',
|
|
68
|
-
type: 'button',
|
|
69
|
-
// aria-selected undefined indicates it is not selectable
|
|
70
|
-
// according to https://www.w3.org/TR/wai-aria-1.1/#aria-selected
|
|
71
|
-
'aria-selected': disabled ? undefined : `${selected}`,
|
|
72
|
-
...props,
|
|
73
|
-
disabled,
|
|
74
|
-
onClick
|
|
75
|
-
}),
|
|
76
|
-
icon: iconShorthand,
|
|
77
|
-
iconOnly: Boolean((iconShorthand === null || iconShorthand === void 0 ? void 0 : iconShorthand.children) && !contentShorthand.children),
|
|
78
|
-
content: contentShorthand,
|
|
79
|
-
appearance,
|
|
80
|
-
contentReservedSpaceClassName: reserveSelectedTabSpace ? '' : undefined,
|
|
81
|
-
disabled,
|
|
82
|
-
selected,
|
|
83
|
-
size,
|
|
84
|
-
value,
|
|
85
|
-
vertical
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
|
-
exports.useTab_unstable = useTab_unstable;
|
|
81
|
+
}; //# sourceMappingURL=useTab.js.map
|
|
82
|
+
|
|
89
83
|
//# sourceMappingURL=useTab.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/Tab/useTab.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand, useEventCallback, useMergedRefs } from '@fluentui/react-utilities';\nimport { useTabListContext_unstable } from '../TabList/TabListContext';\n/**\n * Create the state required to render Tab.\n *\n * The returned state can be modified with hooks such as useTabStyles_unstable,\n * before being passed to renderTab_unstable.\n *\n * @param props - props from this instance of Tab\n * @param ref - reference to root HTMLElement of Tab\n */\nexport const useTab_unstable = (props, ref) => {\n const {\n content,\n disabled: tabDisabled = false,\n icon,\n value\n } = props;\n const appearance = useTabListContext_unstable(ctx => ctx.appearance);\n const reserveSelectedTabSpace = useTabListContext_unstable(ctx => ctx.reserveSelectedTabSpace);\n const listDisabled = useTabListContext_unstable(ctx => ctx.disabled);\n const selected = useTabListContext_unstable(ctx => ctx.selectedValue === value);\n const onRegister = useTabListContext_unstable(ctx => ctx.onRegister);\n const onUnregister = useTabListContext_unstable(ctx => ctx.onUnregister);\n const onSelect = useTabListContext_unstable(ctx => ctx.onSelect);\n const size = useTabListContext_unstable(ctx => ctx.size);\n const vertical = useTabListContext_unstable(ctx => !!ctx.vertical);\n const disabled = listDisabled || tabDisabled;\n const innerRef = React.useRef(null);\n const onClick = useEventCallback(event => onSelect(event, {\n value\n }));\n React.useEffect(() => {\n onRegister({\n value,\n ref: innerRef\n });\n return () => {\n onUnregister({\n value,\n ref: innerRef\n });\n };\n }, [onRegister, onUnregister, innerRef, value]);\n const iconShorthand = resolveShorthand(icon);\n const contentShorthand = resolveShorthand(content, {\n required: true,\n defaultProps: {\n children: props.children\n }\n });\n return {\n components: {\n root: 'button',\n icon: 'span',\n content: 'span'\n },\n root: getNativeElementProps('button', {\n ref: useMergedRefs(ref, innerRef),\n role: 'tab',\n type: 'button',\n // aria-selected undefined indicates it is not selectable\n // according to https://www.w3.org/TR/wai-aria-1.1/#aria-selected\n 'aria-selected': disabled ? undefined : `${selected}`,\n ...props,\n disabled,\n onClick\n }),\n icon: iconShorthand,\n iconOnly: Boolean((iconShorthand === null || iconShorthand === void 0 ? void 0 : iconShorthand.children) && !contentShorthand.children),\n content: contentShorthand,\n appearance,\n contentReservedSpaceClassName: reserveSelectedTabSpace ? '' : undefined,\n disabled,\n selected,\n size,\n value,\n vertical\n };\n};\n//# sourceMappingURL=useTab.js.map"],"names":["useTab_unstable","props","ref","content","disabled","tabDisabled","icon","value","appearance","useTabListContext_unstable","ctx","reserveSelectedTabSpace","listDisabled","selected","selectedValue","onRegister","onUnregister","onSelect","size","vertical","innerRef","React","useRef","onClick","useEventCallback","event","useEffect","iconShorthand","resolveShorthand","contentShorthand","required","defaultProps","children","components","root","getNativeElementProps","useMergedRefs","role","type","undefined","iconOnly","Boolean","contentReservedSpaceClassName"],"mappings":";;;;+BAYaA;;aAAAA;;;6DAZU;gCACkE;gCAC9C;AAUpC,MAAMA,kBAAkB,CAACC,OAAOC,MAAQ;IAC7C,MAAM,EACJC,QAAO,EACPC,UAAUC,cAAc,KAAK,CAAA,EAC7BC,KAAI,EACJC,MAAK,EACN,GAAGN;IACJ,MAAMO,aAAaC,IAAAA,0CAA0B,EAACC,C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