@devsym/graph-toolkit-react 1.0.0-next.10 → 1.0.0-next.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +2 -1
- package/dist/components/People/People.d.ts +16 -0
- package/dist/components/People/People.d.ts.map +1 -0
- package/dist/components/People/People.types.d.ts +55 -0
- package/dist/components/People/People.types.d.ts.map +1 -0
- package/dist/components/People/index.d.ts +6 -0
- package/dist/components/People/index.d.ts.map +1 -0
- package/dist/hooks/usePeopleList.d.ts +62 -0
- package/dist/hooks/usePeopleList.d.ts.map +1 -0
- package/dist/hooks/usePeopleSearch.d.ts +1 -1
- package/dist/hooks/usePeopleSearch.d.ts.map +1 -1
- package/dist/hooks/usePersonData.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.mjs +902 -733
- package/dist/providers/MockProvider.d.ts.map +1 -1
- package/dist/utils/graph.d.ts +17 -0
- package/dist/utils/graph.d.ts.map +1 -1
- package/package.json +1 -1
- package/readme.md +48 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MockProvider.d.ts","sourceRoot":"","sources":["../../src/providers/MockProvider.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,uBAAuB,CAAC;AA4F/B,qBAAa,YAAa,YAAW,SAAS,EAAE,mBAAmB,EAAE,qBAAqB;IACxF,OAAO,CAAC,KAAK,CAA8B;IAC3C,OAAO,CAAC,SAAS,CAAuB;gBAC5B,OAAO,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,OAAO,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE;IAMnE,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC;IAQ3B,aAAa,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"MockProvider.d.ts","sourceRoot":"","sources":["../../src/providers/MockProvider.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,uBAAuB,CAAC;AA4F/B,qBAAa,YAAa,YAAW,SAAS,EAAE,mBAAmB,EAAE,qBAAqB;IACxF,OAAO,CAAC,KAAK,CAA8B;IAC3C,OAAO,CAAC,SAAS,CAAuB;gBAC5B,OAAO,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,OAAO,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE;IAMnE,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC;IAQ3B,aAAa,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAyCtF,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,SAAK,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC;IAe3E,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAKtB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAK7B,QAAQ,IAAI,aAAa;IAIzB,cAAc,CAAC,OAAO,EAAE,MAAM,IAAI,GAAG,IAAI;IAIzC,yBAAyB,CAAC,OAAO,EAAE,MAAM,IAAI,GAAG,IAAI;IAIpD,OAAO,CAAC,IAAI;CASb;AAED,eAAO,MAAM,0BAA0B,oBAA+C,CAAC"}
|
package/dist/utils/graph.d.ts
CHANGED
|
@@ -11,4 +11,21 @@ export declare const createGraphClient: (provider: IProvider) => Client;
|
|
|
11
11
|
* Extract initials from a display name
|
|
12
12
|
*/
|
|
13
13
|
export declare const getInitials: (displayName?: string) => string;
|
|
14
|
+
/**
|
|
15
|
+
* Convert a Microsoft Graph photo response into a data URL string when possible.
|
|
16
|
+
*
|
|
17
|
+
* The Graph SDK may return a string, `Blob`, or `ArrayBuffer` depending on the
|
|
18
|
+
* environment and request adapter. Unsupported response shapes resolve to `null`.
|
|
19
|
+
*
|
|
20
|
+
* @param photoResponse - Raw response returned from the Graph photo endpoint
|
|
21
|
+
* @returns A data URL string or `null` when the response cannot be converted
|
|
22
|
+
*/
|
|
23
|
+
export declare const photoResponseToDataUrl: (photoResponse: unknown) => Promise<string | null>;
|
|
24
|
+
/**
|
|
25
|
+
* Encode a dynamic Microsoft Graph path segment for safe interpolation into request URLs.
|
|
26
|
+
*
|
|
27
|
+
* @param value - Raw path segment value such as a user identifier or group ID
|
|
28
|
+
* @returns The trimmed and URL-encoded path segment
|
|
29
|
+
*/
|
|
30
|
+
export declare const encodeGraphPathSegment: (value: string) => string;
|
|
14
31
|
//# sourceMappingURL=graph.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../src/utils/graph.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,UAAU,SAAS,KAAG,MAWvD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,GAAI,cAAc,MAAM,KAAG,MASlD,CAAC"}
|
|
1
|
+
{"version":3,"file":"graph.d.ts","sourceRoot":"","sources":["../../src/utils/graph.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,mCAAmC,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAEnD;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,UAAU,SAAS,KAAG,MAWvD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,GAAI,cAAc,MAAM,KAAG,MASlD,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,GAAU,eAAe,OAAO,KAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CA0B1F,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GAAI,OAAO,MAAM,KAAG,MAA0C,CAAC"}
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -129,6 +129,34 @@ For full manual override, use React render callbacks as the replacement for MGT
|
|
|
129
129
|
/>
|
|
130
130
|
```
|
|
131
131
|
|
|
132
|
+
### People Component
|
|
133
|
+
Display a compact strip of people using Fluent UI `AvatarGroup`.
|
|
134
|
+
|
|
135
|
+
```tsx
|
|
136
|
+
import { People } from '@devsym/graph-toolkit-react';
|
|
137
|
+
|
|
138
|
+
<People showMax={4} size={40} />
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
You can also provide people directly or resolve specific users:
|
|
142
|
+
|
|
143
|
+
```tsx
|
|
144
|
+
<People
|
|
145
|
+
userIds={['me', 'user@contoso.com']}
|
|
146
|
+
showMax={2}
|
|
147
|
+
showPresence
|
|
148
|
+
/>
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
```tsx
|
|
152
|
+
<People
|
|
153
|
+
people={[
|
|
154
|
+
{ id: 'adele', displayName: 'Adele Vance', mail: 'adelev@contoso.com' },
|
|
155
|
+
{ id: 'alex', displayName: 'Alex Wilber', mail: 'alexw@contoso.com' },
|
|
156
|
+
]}
|
|
157
|
+
/>
|
|
158
|
+
```
|
|
159
|
+
|
|
132
160
|
|
|
133
161
|
## 🚀 Getting Started
|
|
134
162
|
|
|
@@ -181,6 +209,8 @@ function App() {
|
|
|
181
209
|
}
|
|
182
210
|
```
|
|
183
211
|
|
|
212
|
+
For a complete browser-hosted example app, try the deployed [React MSAL sample](https://gentle-beach-0f6fe2903.2.azurestaticapps.net) or review [`samples/react-msal-sample/README.md`](./samples/react-msal-sample/README.md), which wires `MsalBrowserProvider` into `GraphProvider` and demonstrates `Person`, `People`, and `PeoplePicker`.
|
|
213
|
+
|
|
184
214
|
### Authentication Providers
|
|
185
215
|
|
|
186
216
|
The library uses a provider pattern for authentication:
|
|
@@ -272,7 +302,9 @@ Use explicit mode selection in your app:
|
|
|
272
302
|
| ------- | ------------------------ | ----- |
|
|
273
303
|
| Load current user profile (`userId="me"`) | `User.Read` | Required for basic person data (`displayName`, `mail`, etc.) |
|
|
274
304
|
| Load another user by id/upn (`userId="{id}"`) | `User.ReadBasic.All` | May require admin consent depending on tenant policy |
|
|
275
|
-
| Load
|
|
305
|
+
| Load `People` default suggestions | `User.ReadBasic.All` | Used for the default `/users` directory list when no explicit people source is provided |
|
|
306
|
+
| Load `People` group members (`groupId`) | `GroupMember.Read.All` | Required only when resolving direct group membership |
|
|
307
|
+
| Load PeoplePicker focus suggestions | `User.ReadBasic.All` | Uses the initial `/users` directory list shown before typing |
|
|
276
308
|
| Show presence (`showPresence`) | `Presence.Read` | If not granted, person still renders without presence |
|
|
277
309
|
| Load profile photo (`fetchImage`) | `User.Read` | Falls back to initials if photo is unavailable |
|
|
278
310
|
|
|
@@ -340,10 +372,13 @@ npm run build-storybook
|
|
|
340
372
|
```
|
|
341
373
|
src/
|
|
342
374
|
├── components/
|
|
343
|
-
│
|
|
344
|
-
│
|
|
345
|
-
│
|
|
346
|
-
│
|
|
375
|
+
│ ├── Person/
|
|
376
|
+
│ │ ├── Person.tsx # Component implementation
|
|
377
|
+
│ │ ├── Person.types.ts # TypeScript definitions
|
|
378
|
+
│ │ └── __tests__/ # Component tests
|
|
379
|
+
│ └── People/
|
|
380
|
+
│ ├── People.tsx # Component implementation
|
|
381
|
+
│ └── People.types.ts # TypeScript definitions
|
|
347
382
|
├── providers/
|
|
348
383
|
│ ├── IProvider.ts # Provider interface
|
|
349
384
|
│ ├── MockProvider.ts # Development provider
|
|
@@ -351,11 +386,14 @@ src/
|
|
|
351
386
|
├── hooks/
|
|
352
387
|
│ ├── useGraphClient.ts # Graph client hook
|
|
353
388
|
│ ├── usePersonData.ts # Person data fetching
|
|
389
|
+
│ ├── usePeopleList.ts # People list fetching
|
|
354
390
|
│ └── useProvider.ts # Provider access
|
|
355
391
|
└── index.ts # Public API
|
|
356
392
|
|
|
357
393
|
stories/
|
|
358
|
-
|
|
394
|
+
├── Person.stories.tsx # Person stories
|
|
395
|
+
├── People.stories.tsx # People stories
|
|
396
|
+
└── PeoplePicker.stories.tsx # PeoplePicker stories
|
|
359
397
|
```
|
|
360
398
|
|
|
361
399
|
## 🎯 Current Status
|
|
@@ -365,15 +403,17 @@ stories/
|
|
|
365
403
|
- ✅ Repository restructured from monorepo to single package
|
|
366
404
|
- ✅ Provider infrastructure with MockProvider for development
|
|
367
405
|
- ✅ Person component using Fluent UI Persona
|
|
406
|
+
- ✅ People component using Fluent UI AvatarGroup
|
|
407
|
+
- ✅ PeoplePicker component using Fluent UI TagPicker
|
|
368
408
|
- ✅ Full Persona configuration support (textAlignment, textPosition, sizing)
|
|
369
409
|
- ✅ Build system (ESM + CJS + TypeScript declarations)
|
|
370
410
|
- ✅ Storybook documentation and GitHub Pages deployment
|
|
371
411
|
- ✅ CI/CD with GitHub Actions
|
|
372
412
|
- ✅ Automatic Storybook deployment to GitHub Pages
|
|
373
|
-
- ✅ Sample app with MSAL sign-in and `Person`
|
|
413
|
+
- ✅ Sample app with MSAL sign-in and `Person`, `People`, and `PeoplePicker` demos at `samples/react-msal-sample`
|
|
374
414
|
|
|
375
415
|
**Next Steps**:
|
|
376
|
-
- Additional components (
|
|
416
|
+
- Additional components (PersonCard, Login, Agenda) — see [`docs/COMPONENT_ROADMAP.md`](./docs/COMPONENT_ROADMAP.md) for the full ranked list
|
|
377
417
|
- Expanded provider guidance and production auth examples
|
|
378
418
|
- Comprehensive test coverage
|
|
379
419
|
- First stable release (1.0.0)
|