@fluentui/react-overflow 9.0.0-beta.1 → 9.0.0-beta.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. package/CHANGELOG.json +330 -1
  2. package/CHANGELOG.md +113 -2
  3. package/dist/index.d.ts +4 -32
  4. package/lib/components/Overflow.js +4 -2
  5. package/lib/components/Overflow.js.map +1 -1
  6. package/lib/components/OverflowItem/OverflowItem.js.map +1 -1
  7. package/lib/components/OverflowItem/OverflowItem.types.js.map +1 -1
  8. package/lib/components/OverflowItem/index.js.map +1 -1
  9. package/lib/constants.js.map +1 -1
  10. package/lib/index.js +1 -1
  11. package/lib/index.js.map +1 -1
  12. package/lib/overflowContext.js +6 -4
  13. package/lib/overflowContext.js.map +1 -1
  14. package/lib/types.js.map +1 -1
  15. package/lib/useIsOverflowGroupVisible.js.map +1 -1
  16. package/lib/useIsOverflowItemVisible.js.map +1 -1
  17. package/lib/useOverflowContainer.js +30 -19
  18. package/lib/useOverflowContainer.js.map +1 -1
  19. package/lib/useOverflowCount.js.map +1 -1
  20. package/lib/useOverflowItem.js +1 -0
  21. package/lib/useOverflowItem.js.map +1 -1
  22. package/lib/useOverflowMenu.js +4 -16
  23. package/lib/useOverflowMenu.js.map +1 -1
  24. package/lib-commonjs/components/Overflow.js +4 -2
  25. package/lib-commonjs/components/Overflow.js.map +1 -1
  26. package/lib-commonjs/components/OverflowItem/OverflowItem.js.map +1 -1
  27. package/lib-commonjs/components/OverflowItem/index.js.map +1 -1
  28. package/lib-commonjs/constants.js.map +1 -1
  29. package/lib-commonjs/index.js +1 -7
  30. package/lib-commonjs/index.js.map +1 -1
  31. package/lib-commonjs/overflowContext.js +6 -4
  32. package/lib-commonjs/overflowContext.js.map +1 -1
  33. package/lib-commonjs/useIsOverflowGroupVisible.js.map +1 -1
  34. package/lib-commonjs/useIsOverflowItemVisible.js.map +1 -1
  35. package/lib-commonjs/useOverflowContainer.js +28 -17
  36. package/lib-commonjs/useOverflowContainer.js.map +1 -1
  37. package/lib-commonjs/useOverflowCount.js.map +1 -1
  38. package/lib-commonjs/useOverflowItem.js +1 -0
  39. package/lib-commonjs/useOverflowItem.js.map +1 -1
  40. package/lib-commonjs/useOverflowMenu.js +4 -17
  41. package/lib-commonjs/useOverflowMenu.js.map +1 -1
  42. package/package.json +13 -11
  43. package/dist/tsdoc-metadata.json +0 -11
@@ -1 +1 @@
1
- {"version":3,"sources":["useOverflowMenu.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,mBAAA,CAAA;;AACA,MAAA,kBAAA,gBAAA,OAAA,CAAA,oBAAA,CAAA;;AACA,MAAA,WAAA,gBAAA,OAAA,CAAA,aAAA,CAAA;;AAEA,SAAgB,eAAhB,CAA8D,EAA9D,EAAyE;AACvE,QAAM,SAAS,GAAG,iBAAA,CAAA,KAAA,CAAM,eAAN,EAAuB,EAAvB,CAAlB;AACA,QAAM,aAAa,GAAG,kBAAA,CAAA,gBAAA,EAAtB;AACA,QAAM,YAAY,GAAG,iBAAA,CAAA,kBAAA,CAAmB,CAAC,IAAI,CAAC,CAAC,YAA1B,CAArB;AACA,QAAM,cAAc,GAAG,iBAAA,CAAA,kBAAA,CAAmB,CAAC,IAAI,CAAC,CAAC,cAA1B,CAAvB;AACA,QAAM,GAAG,GAAG,KAAK,CAAC,MAAN,CAAuB,IAAvB,CAAZ;AACA,QAAM,aAAa,GAAG,aAAa,GAAG,CAAtC;AAEA,EAAA,iBAAA,CAAA,yBAAA,CAA0B,MAAK;AAC7B,UAAM,OAAO,GAAG,GAAG,CAAC,OAApB;;AACA,QAAI,OAAJ,EAAa;AACX,YAAM,cAAc,GAAG,YAAY,CAAC;AAClC,QAAA,OADkC;AAElC,QAAA,EAAE,EAAE,SAF8B;AAGlC,QAAA,QAAQ,EAAE;AAHwB,OAAD,CAAnC;AAKA,MAAA,OAAO,CAAC,YAAR,CAAqB,WAAA,CAAA,kBAArB,EAAyC,EAAzC;AAEA,aAAO,MAAK;AACV,QAAA,cAAc;AACd,QAAA,OAAO,KAAA,IAAP,IAAA,OAAO,KAAA,KAAA,CAAP,GAAO,KAAA,CAAP,GAAA,OAAO,CAAE,eAAT,CAAyB,WAAA,CAAA,kBAAzB,CAAA;AACD,OAHD;AAID;AACF,GAfD,EAeG,CAAC,YAAD,EAAe,aAAf,EAA8B,SAA9B,CAfH;AAiBA,EAAA,iBAAA,CAAA,yBAAA,CAA0B,MAAK;AAC7B,QAAI,aAAJ,EAAmB;AACjB,MAAA,cAAc;AACf;AACF,GAJD,EAIG,CAAC,aAAD,EAAgB,cAAhB,EAAgC,GAAhC,CAJH;AAMA,SAAO;AAAE,IAAA,GAAF;AAAO,IAAA,aAAP;AAAsB,IAAA;AAAtB,GAAP;AACD;;AAhCD,OAAA,CAAA,eAAA,GAAA,eAAA","sourcesContent":["import * as React from 'react';\nimport { useId, useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\nimport { useOverflowContext } from './overflowContext';\nimport { useOverflowCount } from './useOverflowCount';\nimport { DATA_OVERFLOW_MENU } from './constants';\n\nexport function useOverflowMenu<TElement extends HTMLElement>(id?: string) {\n const elementId = useId('overflow-menu', id);\n const overflowCount = useOverflowCount();\n const registerItem = useOverflowContext(v => v.registerItem);\n const updateOverflow = useOverflowContext(v => v.updateOverflow);\n const ref = React.useRef<TElement>(null);\n const isOverflowing = overflowCount > 0;\n\n useIsomorphicLayoutEffect(() => {\n const element = ref.current;\n if (element) {\n const deregisterItem = registerItem({\n element,\n id: elementId,\n priority: Infinity,\n });\n element.setAttribute(DATA_OVERFLOW_MENU, '');\n\n return () => {\n deregisterItem();\n element?.removeAttribute(DATA_OVERFLOW_MENU);\n };\n }\n }, [registerItem, isOverflowing, elementId]);\n\n useIsomorphicLayoutEffect(() => {\n if (isOverflowing) {\n updateOverflow();\n }\n }, [isOverflowing, updateOverflow, ref]);\n\n return { ref, overflowCount, isOverflowing };\n}\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-overflow/src/useOverflowMenu.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,mBAAA,CAAA;;AACA,MAAA,kBAAA,gBAAA,OAAA,CAAA,oBAAA,CAAA;;AAEA,SAAgB,eAAhB,CAA8D,EAA9D,EAAyE;EACvE,MAAM,SAAS,GAAG,iBAAA,CAAA,KAAA,CAAM,eAAN,EAAuB,EAAvB,CAAlB;EACA,MAAM,aAAa,GAAG,kBAAA,CAAA,gBAAA,EAAtB;EACA,MAAM,oBAAoB,GAAG,iBAAA,CAAA,kBAAA,CAAmB,CAAC,IAAI,CAAC,CAAC,oBAA1B,CAA7B;EACA,MAAM,cAAc,GAAG,iBAAA,CAAA,kBAAA,CAAmB,CAAC,IAAI,CAAC,CAAC,cAA1B,CAAvB;EACA,MAAM,GAAG,GAAG,KAAK,CAAC,MAAN,CAAuB,IAAvB,CAAZ;EACA,MAAM,aAAa,GAAG,aAAa,GAAG,CAAtC;EAEA,iBAAA,CAAA,yBAAA,CAA0B,MAAK;IAC7B,IAAI,GAAG,CAAC,OAAR,EAAiB;MACf,OAAO,oBAAoB,CAAC,GAAG,CAAC,OAAL,CAA3B;IACD;EACF,CAJD,EAIG,CAAC,oBAAD,EAAuB,aAAvB,EAAsC,SAAtC,CAJH;EAMA,iBAAA,CAAA,yBAAA,CAA0B,MAAK;IAC7B,IAAI,aAAJ,EAAmB;MACjB,cAAc;IACf;EACF,CAJD,EAIG,CAAC,aAAD,EAAgB,cAAhB,EAAgC,GAAhC,CAJH;EAMA,OAAO;IAAE,GAAF;IAAO,aAAP;IAAsB;EAAtB,CAAP;AACD;;AArBD,OAAA,CAAA,eAAA,GAAA,eAAA","sourcesContent":["import * as React from 'react';\nimport { useId, useIsomorphicLayoutEffect } from '@fluentui/react-utilities';\nimport { useOverflowContext } from './overflowContext';\nimport { useOverflowCount } from './useOverflowCount';\n\nexport function useOverflowMenu<TElement extends HTMLElement>(id?: string) {\n const elementId = useId('overflow-menu', id);\n const overflowCount = useOverflowCount();\n const registerOverflowMenu = useOverflowContext(v => v.registerOverflowMenu);\n const updateOverflow = useOverflowContext(v => v.updateOverflow);\n const ref = React.useRef<TElement>(null);\n const isOverflowing = overflowCount > 0;\n\n useIsomorphicLayoutEffect(() => {\n if (ref.current) {\n return registerOverflowMenu(ref.current);\n }\n }, [registerOverflowMenu, isOverflowing, elementId]);\n\n useIsomorphicLayoutEffect(() => {\n if (isOverflowing) {\n updateOverflow();\n }\n }, [isOverflowing, updateOverflow, ref]);\n\n return { ref, overflowCount, isOverflowing };\n}\n"],"sourceRoot":"../src/"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-overflow",
3
- "version": "9.0.0-beta.1",
3
+ "version": "9.0.0-beta.11",
4
4
  "description": "React bindings for @fluentui/priority-overflow",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -16,32 +16,34 @@
16
16
  "bundle-size": "bundle-size measure",
17
17
  "clean": "just-scripts clean",
18
18
  "code-style": "just-scripts code-style",
19
+ "e2e": "cypress run --component",
20
+ "e2e:local": "cypress open --component",
19
21
  "just": "just-scripts",
20
22
  "lint": "just-scripts lint",
21
23
  "start": "yarn storybook",
22
24
  "test": "jest --passWithNoTests",
23
- "docs": "api-extractor run --config=config/api-extractor.local.json --local",
24
- "build:local": "tsc -p ./tsconfig.lib.json --module esnext --emitDeclarationOnly && node ../../../scripts/typescript/normalize-import --output ./dist/packages/react-components/react-overflow/src && yarn docs",
25
- "storybook": "node ../../../scripts/storybook/runner",
26
- "type-check": "tsc -b tsconfig.json"
25
+ "storybook": "start-storybook",
26
+ "type-check": "tsc -b tsconfig.json",
27
+ "generate-api": "tsc -p ./tsconfig.lib.json --emitDeclarationOnly && just-scripts api-extractor"
27
28
  },
28
29
  "devDependencies": {
29
30
  "@fluentui/eslint-plugin": "*",
30
31
  "@fluentui/scripts": "^1.0.0"
31
32
  },
32
33
  "dependencies": {
33
- "@fluentui/priority-overflow": "^9.0.0-beta.1",
34
- "@fluentui/react-context-selector": "9.0.0-rc.9",
35
- "@fluentui/react-theme": "9.0.0-rc.8",
36
- "@fluentui/react-utilities": "9.0.0-rc.9",
37
- "@griffel/react": "1.0.5",
34
+ "@fluentui/priority-overflow": "^9.0.0-beta.3",
35
+ "@fluentui/react-context-selector": "^9.0.4",
36
+ "@fluentui/react-theme": "^9.1.0",
37
+ "@fluentui/react-utilities": "^9.1.1",
38
+ "@griffel/react": "^1.4.0",
38
39
  "tslib": "^2.1.0"
39
40
  },
40
41
  "peerDependencies": {
41
42
  "@types/react": ">=16.8.0 <18.0.0",
42
43
  "@types/react-dom": ">=16.8.0 <18.0.0",
43
44
  "react": ">=16.8.0 <18.0.0",
44
- "react-dom": ">=16.8.0 <18.0.0"
45
+ "react-dom": ">=16.8.0 <18.0.0",
46
+ "scheduler": "^0.19.0 || ^0.20.0"
45
47
  },
46
48
  "beachball": {
47
49
  "disallowedChangeTypes": [
@@ -1,11 +0,0 @@
1
- // This file is read by tools that parse documentation comments conforming to the TSDoc standard.
2
- // It should be published with your NPM package. It should not be tracked by Git.
3
- {
4
- "tsdocVersion": "0.12",
5
- "toolPackages": [
6
- {
7
- "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.18.1"
9
- }
10
- ]
11
- }