-
Notifications
You must be signed in to change notification settings - Fork 2.9k
feat: add dashboard grid preview #36610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Yeshwanth N (yeshsurya)
wants to merge
7
commits into
microsoft:master
Choose a base branch
from
yeshsurya:feature/dashboard-grid-preview
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
53b1080
feat: add dashboard grid preview
12f8116
fix: complete dashboard grid integration
0084515
feat: complete dashboard grid parity
a0c49ad
fix: finalize dashboard grid browser integration
7f1172f
fix: address dashboard grid review findings
7203a70
fix: synchronize dashboard grid lockfile
5f2428f
fix: register dashboard grid isolation fixture
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/@fluentui-react-dashboard-grid-preview-drag-preview-parity.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "type": "patch", | ||
| "comment": "fix: render configured drag previews during internal pointer dragging", | ||
| "packageName": "@fluentui/react-dashboard-grid-preview", | ||
| "email": "ynagaraj@microsoft.com", | ||
| "dependentChangeType": "patch" | ||
| } | ||
7 changes: 7 additions & 0 deletions
7
change/@fluentui-react-dashboard-grid-preview-locked-nesting.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "type": "patch", | ||
| "comment": "fix: complete dashboard serialization and interaction behavior", | ||
| "packageName": "@fluentui/react-dashboard-grid-preview", | ||
| "email": "ynagaraj@microsoft.com", | ||
| "dependentChangeType": "patch" | ||
| } |
7 changes: 7 additions & 0 deletions
7
change/@fluentui-react-dashboard-grid-preview-serialization-parity.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "type": "patch", | ||
| "comment": "fix: preserve complete serializable dashboard grid options across save and load", | ||
| "packageName": "@fluentui/react-dashboard-grid-preview", | ||
| "email": "ynagaraj@microsoft.com", | ||
| "dependentChangeType": "patch" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
packages/react-components/react-dashboard-grid-preview/library/.babelrc.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "extends": "../../../../.babelrc-v9.json", | ||
| "plugins": ["annotate-pure-calls", "@babel/transform-react-pure-annotations"] | ||
| } |
31 changes: 31 additions & 0 deletions
31
packages/react-components/react-dashboard-grid-preview/library/.swcrc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| { | ||
| "$schema": "https://json.schemastore.org/swcrc", | ||
| "exclude": [ | ||
| "/testing", | ||
| "/**/*.cy.ts", | ||
| "/**/*.cy.tsx", | ||
| "/**/*.spec.ts", | ||
| "/**/*.spec.tsx", | ||
| "/**/*.test.ts", | ||
| "/**/*.test.tsx" | ||
| ], | ||
| "jsc": { | ||
| "baseUrl": ".", | ||
| "parser": { | ||
| "syntax": "typescript", | ||
| "tsx": true, | ||
| "decorators": false, | ||
| "dynamicImport": false | ||
| }, | ||
| "externalHelpers": true, | ||
| "transform": { | ||
| "react": { | ||
| "runtime": "classic", | ||
| "useSpread": true | ||
| } | ||
| }, | ||
| "target": "es2019" | ||
| }, | ||
| "minify": false, | ||
| "sourceMaps": true | ||
| } |
47 changes: 47 additions & 0 deletions
47
packages/react-components/react-dashboard-grid-preview/library/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # @fluentui/react-dashboard-grid-preview | ||
|
|
||
| **Dashboard Grid components for [Fluent UI React](https://react.fluentui.dev/)** | ||
|
|
||
| > **Preview package:** These APIs are not production-ready and may change before a stable release. | ||
|
|
||
| The package provides a responsive dashboard layout, item composition, shared-provider transfer support, drag sources, | ||
| and drop zones. | ||
|
|
||
| ## Public entry points | ||
|
|
||
| - `@fluentui/react-dashboard-grid-preview` exposes the React components and hooks. | ||
| - `@fluentui/react-dashboard-grid-preview/engine` exposes the React-free and DOM-free layout engine. | ||
| - `@fluentui/react-dashboard-grid-preview/gridstack-compat` exposes explicit GridStack conversion and DOM adapters. | ||
|
|
||
| Preview APIs must be imported directly from this package. They are not re-exported from | ||
| `@fluentui/react-components/unstable`. | ||
|
|
||
| ## React ownership modes | ||
|
|
||
| `DashboardGrid` supports three explicit, mutually exclusive ownership modes: | ||
|
|
||
| - `defaultItems` for uncontrolled model ownership. | ||
| - `items` with `onItemsChange` for controlled ownership. | ||
| - Declarative `DashboardGridItem` children for React-owned descriptors and content. | ||
|
|
||
| Declarative items remain registered for their mounted lifetime. A shared `DashboardGridProvider` preserves item | ||
| content state and focus during cross-grid transfer, including dynamically created nested grids. | ||
|
|
||
| ## Layout and commands | ||
|
|
||
| Screen layout uses a relative surface with absolutely positioned item and placeholder shells. SSR uses deterministic | ||
| percentage geometry until client measurement resolves exact pixel geometry; print mode replaces screen positioning | ||
| with flow or exact print projection. | ||
|
|
||
| Use `imperativeRef` for commands such as querying, batching, fitting, compacting, changing columns, rotating, | ||
| enabling/disabling, focusing, and refreshing handles. The ordinary forwarded ref always targets the root HTML | ||
| element. The public command handle intentionally does not expose the mutable internal store. | ||
|
|
||
| `save()` uses the highest-resolution cached layout by default; pass `columns` to save a specific responsive layout. | ||
| Application `data` is included and React `content` is excluded by default. Use `includeData` and `includeContent` to | ||
| override those defaults. The resulting versioned state can be passed directly to `load()`. | ||
|
|
||
| Root and nested grids share the same options for columns, responsive layouts, row height, gap, row constraints, | ||
| drag/resize disablement, external acceptance, removal zones, dynamic nesting, print behavior, and optional engine | ||
| injection. Public callbacks follow Fluent's `(event, data)` convention and include committed item changes, | ||
| drag/resize progress, content resizing, enablement, and final item drops. |
22 changes: 22 additions & 0 deletions
22
packages/react-components/react-dashboard-grid-preview/library/bundle-isolation.config.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| { | ||
| "$schema": "../../../../tools/verify-bundle-isolation/schema.json", | ||
| "fixturesRoot": "./bundle-isolation", | ||
| "externals": [], | ||
| "forbiddenPackages": [ | ||
| "@fluentui/keyboard-keys", | ||
| "@fluentui/react-context-selector", | ||
| "@fluentui/react-jsx-runtime", | ||
| "@fluentui/react-shared-contexts", | ||
| "@fluentui/react-tabster", | ||
| "@fluentui/react-theme", | ||
| "@fluentui/react-utilities", | ||
| "@griffel/*", | ||
| "react", | ||
| "react-dom", | ||
| "tabster", | ||
| "use-sync-external-store" | ||
| ], | ||
| "fixtures": { | ||
| "engine.fixture.js": {} | ||
| } | ||
| } |
7 changes: 7 additions & 0 deletions
7
.../react-components/react-dashboard-grid-preview/library/bundle-isolation/engine.fixture.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import * as engine from '@fluentui/react-dashboard-grid-preview/engine'; | ||
|
|
||
| console.log(engine); | ||
|
|
||
| export default { | ||
| name: '@fluentui/react-dashboard-grid-preview/engine', | ||
| }; |
7 changes: 7 additions & 0 deletions
7
packages/react-components/react-dashboard-grid-preview/library/bundle-size/index.fixture.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| import * as p from '@fluentui/react-dashboard-grid-preview'; | ||
|
|
||
| console.log(p); | ||
|
|
||
| export default { | ||
| name: 'react-dashboard-grid-preview - package', | ||
| }; |
5 changes: 5 additions & 0 deletions
5
packages/react-components/react-dashboard-grid-preview/library/config/api-extractor.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", | ||
| "extends": "@fluentui/scripts-api-extractor/api-extractor.common.v-next.json", | ||
| "mainEntryPointFilePath": "<projectRoot>/../../../../../../dist/out-tsc/types/packages/react-components/<unscopedPackageName>/library/src/index.d.ts" | ||
| } |
3 changes: 3 additions & 0 deletions
3
packages/react-components/react-dashboard-grid-preview/library/config/tests.cjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| /** Jest test setup file. */ | ||
|
|
||
| require('@testing-library/jest-dom'); |
5 changes: 5 additions & 0 deletions
5
packages/react-components/react-dashboard-grid-preview/library/eslint.config.cjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| // @ts-check | ||
|
|
||
| const rootConfig = require('../../../../eslint.config.js'); | ||
|
|
||
| module.exports = [...rootConfig]; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.