mgwdev-m365-components 0.0.3 → 0.0.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.
Files changed (78) hide show
  1. package/{lib → dist}/App.d.ts +3 -3
  2. package/{lib → dist}/components/Test.d.ts +4 -4
  3. package/dist/components/common/ConditionalRenderComponent.d.ts +7 -0
  4. package/dist/components/common/GraphGroupMembershipTrimmedComponent.d.ts +10 -0
  5. package/{lib → dist}/components/common/GraphPersona.d.ts +12 -10
  6. package/dist/components/common/SPPermissionTrimmedComponent.d.ts +11 -0
  7. package/{lib → dist}/components/common/graphEntityPicker/AbstractGraphEntityPicker.d.ts +16 -16
  8. package/{lib → dist}/components/common/graphEntityPicker/ChannelPicker.d.ts +11 -11
  9. package/{lib → dist}/components/common/graphEntityPicker/DrivePicker.d.ts +11 -11
  10. package/{lib → dist}/components/common/graphEntityPicker/ListPicker.d.ts +11 -11
  11. package/{lib → dist}/components/common/graphEntityPicker/PeoplePicker.d.ts +8 -8
  12. package/{lib → dist}/components/common/graphEntityPicker/SitePicker.d.ts +8 -8
  13. package/{lib → dist}/components/common/graphEntityPicker/TeamPicker.d.ts +8 -8
  14. package/{lib → dist}/components/common/graphEntityPicker/index.d.ts +6 -6
  15. package/dist/components/common/index.d.ts +4 -0
  16. package/{lib → dist}/components/index.d.ts +2 -2
  17. package/{lib → dist}/components/search/DefaultDocumentCard.d.ts +7 -7
  18. package/{lib → dist}/components/search/M365Search.d.ts +18 -18
  19. package/{lib → dist}/components/search/SearchDefaults.d.ts +1 -1
  20. package/{lib → dist}/components/search/index.d.ts +2 -2
  21. package/{lib → dist}/context/AuthenticationContext.d.ts +11 -11
  22. package/{lib → dist}/context/DataverseContext.d.ts +13 -13
  23. package/{lib → dist}/context/GraphContext.d.ts +11 -11
  24. package/{lib → dist}/context/SPContext.d.ts +13 -13
  25. package/{lib → dist}/context/index.d.ts +4 -4
  26. package/{lib → dist}/index.d.ts +2 -2
  27. package/{lib → dist}/main.d.ts +1 -1
  28. package/{lib → dist}/model/IEntityWithIdAndDisplayName.d.ts +4 -4
  29. package/{lib → dist}/model/ISearchResult.d.ts +19 -19
  30. package/{lib → dist}/model/index.d.ts +1 -1
  31. package/{lib → dist}/model/infra/ICacheEntry.d.ts +4 -4
  32. package/dist/mwdev-m365-components.es.js +15417 -0
  33. package/dist/mwdev-m365-components.umd.js +145 -0
  34. package/{lib → dist}/services/PersonaService.d.ts +12 -12
  35. package/{lib → dist}/utils/FileUtils.d.ts +29 -29
  36. package/{lib → dist}/utils/StringUtils.d.ts +1 -1
  37. package/{lib → dist}/utils/ThumbnailUtils.d.ts +7 -7
  38. package/{lib → dist}/utils/index.d.ts +3 -3
  39. package/dist/vite.svg +1 -0
  40. package/package.json +70 -67
  41. package/lib/App.js +0 -212
  42. package/lib/components/Test.js +0 -37
  43. package/lib/components/common/GraphPersona.js +0 -125
  44. package/lib/components/common/graphEntityPicker/AbstractGraphEntityPicker.js +0 -117
  45. package/lib/components/common/graphEntityPicker/ChannelPicker.js +0 -83
  46. package/lib/components/common/graphEntityPicker/DrivePicker.js +0 -77
  47. package/lib/components/common/graphEntityPicker/ListPicker.js +0 -77
  48. package/lib/components/common/graphEntityPicker/PeoplePicker.js +0 -76
  49. package/lib/components/common/graphEntityPicker/SitePicker.js +0 -73
  50. package/lib/components/common/graphEntityPicker/TeamPicker.js +0 -77
  51. package/lib/components/common/graphEntityPicker/index.js +0 -6
  52. package/lib/components/common/index.d.ts +0 -2
  53. package/lib/components/common/index.js +0 -2
  54. package/lib/components/index.js +0 -2
  55. package/lib/components/provisioning/GetSiteTemplate.d.ts +0 -6
  56. package/lib/components/provisioning/GetSiteTemplate.js +0 -41
  57. package/lib/components/search/DefaultDocumentCard.js +0 -59
  58. package/lib/components/search/M365Search.js +0 -69
  59. package/lib/components/search/SearchDefaults.js +0 -17
  60. package/lib/components/search/index.js +0 -2
  61. package/lib/context/AuthenticationContext.js +0 -50
  62. package/lib/context/DataverseContext.js +0 -29
  63. package/lib/context/GraphContext.js +0 -26
  64. package/lib/context/SPContext.js +0 -30
  65. package/lib/context/index.js +0 -4
  66. package/lib/index.js +0 -2
  67. package/lib/main.js +0 -6
  68. package/lib/model/IEntityWithIdAndDisplayName.js +0 -1
  69. package/lib/model/ISearchResult.js +0 -1
  70. package/lib/model/index.js +0 -1
  71. package/lib/model/infra/ICacheEntry.js +0 -1
  72. package/lib/service-worker/sw.d.ts +0 -3
  73. package/lib/service-worker/sw.js +0 -20
  74. package/lib/services/PersonaService.js +0 -134
  75. package/lib/utils/FileUtils.js +0 -200
  76. package/lib/utils/StringUtils.js +0 -10
  77. package/lib/utils/ThumbnailUtils.js +0 -92
  78. package/lib/utils/index.js +0 -3
@@ -1,12 +1,12 @@
1
- import { IHttpClient } from "mgwdev-m365-helpers/lib/dal/http/IHttpClient";
2
- import { ICacheService } from "mgwdev-m365-helpers/lib/services/cache";
3
- import { IUser } from "mgwdev-m365-helpers";
4
- export declare class PersonaService {
5
- protected graphClient: IHttpClient;
6
- updatePresence?: boolean;
7
- storageService: ICacheService;
8
- protected key: string;
9
- cacheExpiration: number;
10
- constructor(graphClient: IHttpClient, updatePresence?: boolean);
11
- getUser(id?: string, size?: "48x48" | "64x64" | "96x96" | "120x120" | "240x240"): Promise<IUser>;
12
- }
1
+ import { IHttpClient } from "mgwdev-m365-helpers/lib/dal/http/IHttpClient";
2
+ import { ICacheService } from "mgwdev-m365-helpers/lib/services/cache";
3
+ import { IUser } from "mgwdev-m365-helpers";
4
+ export declare class PersonaService {
5
+ protected graphClient: IHttpClient;
6
+ updatePresence?: boolean;
7
+ storageService: ICacheService;
8
+ protected key: string;
9
+ cacheExpiration: number;
10
+ constructor(graphClient: IHttpClient, updatePresence?: boolean);
11
+ getUser(id?: string, size?: "48x48" | "64x64" | "96x96" | "120x120" | "240x240"): Promise<IUser>;
12
+ }
@@ -1,29 +1,29 @@
1
- export declare const DOCICONURL_XLSX = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/xlsx.png";
2
- export declare const DOCICONURL_DOCX = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/docx.png";
3
- export declare const DOCICONURL_PPTX = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/pptx.png";
4
- export declare const DOCICONURL_MPPX = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/mpp.png";
5
- export declare const DOCICONURL_PHOTO = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/photo.png";
6
- export declare const DOCICONURL_PDF = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/pdf.png";
7
- export declare const DOCICONURL_TXT = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/txt.png";
8
- export declare const DOCICONURL_EMAIL = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/email.png";
9
- export declare const DOCICONURL_CSV = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/csv.png";
10
- export declare const DOCICONURL_ONE = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/one.png";
11
- export declare const DOCICONURL_VSDX = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/vsdx.png";
12
- export declare const DOCICONURL_VSSX = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/vssx.png";
13
- export declare const DOCICONURL_PUB = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/pub.png";
14
- export declare const DOCICONURL_ACCDB = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/accdb.png";
15
- export declare const DOCICONURL_ZIP = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/zip.png";
16
- export declare const DOCICONURL_GENERIC = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/genericfile.png";
17
- export declare const DOCICONURL_CODE = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/code.png";
18
- export declare const DOCICONURL_HTML = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/html.png";
19
- export declare const DOCICONURL_XML = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/xml.png";
20
- export declare const DOCICONURL_SPO = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/spo.png";
21
- export declare const DOCICONURL_VIDEO = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/video.png";
22
- export default class FileUtils {
23
- /**
24
- * GetFileImageUrl
25
- */
26
- static getFileImageUrl(_file: string): string;
27
- static getShortName: (name: string) => string;
28
- static isOndrive: (name: string) => Promise<boolean>;
29
- }
1
+ export declare const DOCICONURL_XLSX = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/xlsx.png";
2
+ export declare const DOCICONURL_DOCX = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/docx.png";
3
+ export declare const DOCICONURL_PPTX = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/pptx.png";
4
+ export declare const DOCICONURL_MPPX = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/mpp.png";
5
+ export declare const DOCICONURL_PHOTO = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/photo.png";
6
+ export declare const DOCICONURL_PDF = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/pdf.png";
7
+ export declare const DOCICONURL_TXT = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/txt.png";
8
+ export declare const DOCICONURL_EMAIL = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/email.png";
9
+ export declare const DOCICONURL_CSV = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/csv.png";
10
+ export declare const DOCICONURL_ONE = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/one.png";
11
+ export declare const DOCICONURL_VSDX = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/vsdx.png";
12
+ export declare const DOCICONURL_VSSX = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/vssx.png";
13
+ export declare const DOCICONURL_PUB = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/pub.png";
14
+ export declare const DOCICONURL_ACCDB = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/accdb.png";
15
+ export declare const DOCICONURL_ZIP = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/zip.png";
16
+ export declare const DOCICONURL_GENERIC = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/genericfile.png";
17
+ export declare const DOCICONURL_CODE = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/code.png";
18
+ export declare const DOCICONURL_HTML = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/html.png";
19
+ export declare const DOCICONURL_XML = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/xml.png";
20
+ export declare const DOCICONURL_SPO = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/spo.png";
21
+ export declare const DOCICONURL_VIDEO = "https://static2.sharepointonline.com/files/fabric/assets/item-types/32/video.png";
22
+ export default class FileUtils {
23
+ /**
24
+ * GetFileImageUrl
25
+ */
26
+ static getFileImageUrl(_file: string): string;
27
+ static getShortName: (name: string) => string;
28
+ static isOndrive: (name: string) => Promise<boolean>;
29
+ }
@@ -1 +1 @@
1
- export declare function camelCase(value: string): string;
1
+ export declare function camelCase(value: string): string;
@@ -1,7 +1,7 @@
1
- import { IHttpClient } from "mgwdev-m365-helpers";
2
- import { IDocumentSearchResult } from "../model";
3
- export declare class ThumbnailUtils {
4
- static getThumbnailUrl: (item: IDocumentSearchResult, size: "small" | "medium" | "large") => string;
5
- static getThumbnailImageFromGraphApiCall: (graphClient: IHttpClient, graphApiUrl: string) => Promise<any>;
6
- static getThumbnailImageFromGraph: (item: IDocumentSearchResult, graphClient: IHttpClient, size?: "small" | "medium" | "large") => Promise<any>;
7
- }
1
+ import { IHttpClient } from "mgwdev-m365-helpers";
2
+ import { IDocumentSearchResult } from "../model";
3
+ export declare class ThumbnailUtils {
4
+ static getThumbnailUrl: (item: IDocumentSearchResult, size: "small" | "medium" | "large") => string;
5
+ static getThumbnailImageFromGraphApiCall: (graphClient: IHttpClient, graphApiUrl: string) => Promise<any>;
6
+ static getThumbnailImageFromGraph: (item: IDocumentSearchResult, graphClient: IHttpClient, size?: "small" | "medium" | "large") => Promise<any>;
7
+ }
@@ -1,3 +1,3 @@
1
- export * from "./FileUtils";
2
- export * from "./ThumbnailUtils";
3
- export * from "./StringUtils";
1
+ export * from "./FileUtils";
2
+ export * from "./ThumbnailUtils";
3
+ export * from "./StringUtils";
package/dist/vite.svg ADDED
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
package/package.json CHANGED
@@ -1,67 +1,70 @@
1
- {
2
- "name": "mgwdev-m365-components",
3
- "private": false,
4
- "version": "0.0.3",
5
- "scripts": {
6
- "start": "vite",
7
- "build": "tsc && vite build",
8
- "build-lib": "gulp build",
9
- "test": "vitest",
10
- "test:report": "vitest --reporter=junit --outputFile.junit=./tests/TEST-mgwdev-m365-components.xml --watch=false",
11
- "test:coverage": "vitest run --coverage",
12
- "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
13
- "preview": "vite preview"
14
- },
15
- "keywords": [
16
- "SharePoint",
17
- "MSGraph"
18
- ],
19
- "author": "m.g.wojciechowski@gmail.com",
20
- "license": "MIT",
21
- "dependencies": {
22
- "@azure/msal-browser": "^3.6.0",
23
- "@fluentui/react-components": "^9.42.0",
24
- "handlebars": "^4.7.8",
25
- "handlebars-group-by": "^1.0.1",
26
- "handlebars-helpers": "^0.10.0",
27
- "jspath": "^0.4.0",
28
- "mgwdev-m365-helpers": "^0.1.13",
29
- "react": ">=16.8.0",
30
- "react-dom": ">=16.8.0",
31
- "vite-plugin-dts": "^3.6.4"
32
- },
33
- "peerDependencies": {
34
- "react": ">=16.8.0",
35
- "react-dom": ">=16.8.0"
36
- },
37
- "devDependencies": {
38
- "@microsoft/rush-stack-compiler-4.7": "^0.1.0",
39
- "@microsoft/sp-build-web": "^1.18.2",
40
- "@types/react": "^18.2.43",
41
- "@types/react-dom": "^18.2.17",
42
- "@typescript-eslint/eslint-plugin": "^6.14.0",
43
- "@typescript-eslint/parser": "^6.14.0",
44
- "@vitejs/plugin-react": "^4.2.1",
45
- "@vitest/coverage-v8": "^1.6.0",
46
- "eslint": "^8.55.0",
47
- "eslint-plugin-react-hooks": "^4.6.0",
48
- "eslint-plugin-react-refresh": "^0.4.5",
49
- "jest-environment-jsdom": "^29.7.0",
50
- "ts-jest": "^29.1.1",
51
- "typescript": "^5.2.2",
52
- "vite": "^5.0.8",
53
- "vitest": "^1.6.0"
54
- },
55
- "files": [
56
- "lib"
57
- ],
58
- "main": "./dist/mwdev-m365-components.umd.js",
59
- "module": "./dist/mwdev-m365-components.es.js",
60
- "types": "./dist/index.d.ts",
61
- "exports": {
62
- ".": {
63
- "import": "./dist/mwdev-m365-components.es.js",
64
- "require": "./dist/mwdev-m365-components.umd.js"
65
- }
66
- }
67
- }
1
+ {
2
+ "name": "mgwdev-m365-components",
3
+ "private": false,
4
+ "version": "0.0.5",
5
+ "scripts": {
6
+ "start": "vite",
7
+ "build": "tsc && vite build",
8
+ "build-lib": "gulp build",
9
+ "test": "vitest",
10
+ "test:report": "vitest --reporter=junit --outputFile.junit=./tests/TEST-mgwdev-m365-components.xml --watch=false",
11
+ "test:coverage": "vitest run --coverage",
12
+ "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
13
+ "preview": "vite preview"
14
+ },
15
+ "keywords": [
16
+ "SharePoint",
17
+ "MSGraph"
18
+ ],
19
+ "author": "m.g.wojciechowski@gmail.com",
20
+ "license": "MIT",
21
+ "dependencies": {
22
+ "@azure/msal-browser": "^3.6.0",
23
+ "@fluentui/react-components": "^9.42.0",
24
+ "@testing-library/react": "^16.2.0",
25
+ "handlebars": "^4.7.8",
26
+ "handlebars-group-by": "^1.0.1",
27
+ "handlebars-helpers": "^0.10.0",
28
+ "jspath": "^0.4.0",
29
+ "mgwdev-m365-helpers": "^0.2.10",
30
+ "react": ">=16.8.0",
31
+ "react-dom": ">=16.8.0",
32
+ "vite-plugin-dts": "^3.6.4"
33
+ },
34
+ "peerDependencies": {
35
+ "react": ">=16.8.0",
36
+ "react-dom": ">=16.8.0"
37
+ },
38
+ "devDependencies": {
39
+ "@microsoft/rush-stack-compiler-4.7": "^0.1.0",
40
+ "@microsoft/sp-build-web": "^1.18.2",
41
+ "@testing-library/jest-dom": "^6.6.3",
42
+ "@types/react": "^18.2.43",
43
+ "@types/react-dom": "^18.2.17",
44
+ "@typescript-eslint/eslint-plugin": "^6.14.0",
45
+ "@typescript-eslint/parser": "^6.14.0",
46
+ "@vitejs/plugin-react": "^4.2.1",
47
+ "@vitest/coverage-v8": "^1.6.0",
48
+ "eslint": "^8.55.0",
49
+ "eslint-plugin-react-hooks": "^4.6.0",
50
+ "eslint-plugin-react-refresh": "^0.4.5",
51
+ "jest-environment-jsdom": "^29.7.0",
52
+ "jsdom": "^26.0.0",
53
+ "ts-jest": "^29.1.1",
54
+ "typescript": "^5.2.2",
55
+ "vite": "^5.0.8",
56
+ "vitest": "^1.6.0"
57
+ },
58
+ "files": [
59
+ "dist"
60
+ ],
61
+ "main": "./dist/mwdev-m365-components.umd.js",
62
+ "module": "./dist/mwdev-m365-components.es.js",
63
+ "types": "./dist/index.d.ts",
64
+ "exports": {
65
+ ".": {
66
+ "import": "./dist/mwdev-m365-components.es.js",
67
+ "require": "./dist/mwdev-m365-components.umd.js"
68
+ }
69
+ }
70
+ }
package/lib/App.js DELETED
@@ -1,212 +0,0 @@
1
- import * as React from 'react';
2
- import { AuthenticationContextProvider, GraphContextProvider, SPContextProvider } from './context';
3
- import { DrivePicker, PeoplePicker, TeamPicker } from './components/common/graphEntityPicker';
4
- import { SitePicker } from './components/common/graphEntityPicker/SitePicker';
5
- import { Msal2AuthenticationService } from 'mgwdev-m365-helpers/lib/services/Msal2AuthenticationService';
6
- import { ListPickerPicker } from './components/common/graphEntityPicker/ListPicker';
7
- import { GetSiteTemplateContext } from './components/provisioning/GetSiteTemplate';
8
- function App() {
9
- var pnpSearchWPConfig = {
10
- "queryTemplate": "{searchTerms}",
11
- "selectedProperties": "Title,Path,Created,Filename,SiteLogo,PreviewUrl,PictureThumbnailURL,ServerRedirectedPreviewURL,ServerRedirectedURL,HitHighlightedSummary,FileType,contentclass,ServerRedirectedEmbedURL,ParentLink,DefaultEncodingURL,owstaxidmetadataalltagsinfo,Author,AuthorOWSUSER,SPSiteUrl,SiteTitle,IsContainer,IsListItem,HtmlFileType,SiteId,WebId,UniqueID,OriginalPath,FileExtension,IsDocument,NormSiteID,NormWebID,NormListID,NormUniqueID",
12
- "enableQueryRules": false,
13
- "includeOneDriveResults": false,
14
- "showBlank": true,
15
- "showResultsCount": true,
16
- "webPartTitle": "",
17
- "enableLocalization": true,
18
- "useDefaultSearchQuery": false,
19
- "resultTypes@odata.type": "#Collection(String)",
20
- "resultTypes": [],
21
- "useExternalRefinersDisplay": false,
22
- "useExternalPaginationDisplay": false,
23
- "appliedRefiners@odata.type": "#Collection(String)",
24
- "appliedRefiners": [],
25
- "refinersConfiguration@odata.type": "#Collection(String)",
26
- "refinersConfiguration": [],
27
- "sortableFields@odata.type": "#Collection(String)",
28
- "sortableFields": [],
29
- "synonymList@odata.type": "#Collection(String)",
30
- "synonymList": [],
31
- "searchQueryLanguage": -1,
32
- "queryModifiers@odata.type": "#Collection(String)",
33
- "queryModifiers": [],
34
- "refinementFilters": "",
35
- "selectedLayout": 2,
36
- "defaultSearchQuery": "",
37
- "inlineTemplateText": "<content id=\"template\">\n\n <style>\n \n /* Insert your CSS overrides here */\n\n </style>\n\n <div class=\"template_root\">\n <span>Test</span>\n <div class=\"template_defaultCard\">\n {{#if showResultsCount}}\n <div class=\"template_resultCount\">\n <label class=\"ms-fontWeight-semibold\">{{getCountMessage @root.paging.totalItemsCount keywords}}</label>\n </div>\n {{/if}}\n <div class=\"document-card-container\">\n {{#each items as |item|}}\n <div class=\"document-card-item\">\n {{#> resultTypes item=item}}\n\n <pnp-document-card data-item=\"{{JSONstringify item}}\" data-fields-configuration=\"{{JSONstringify @root.documentCardFields}}\" data-enable-preview=\"{{@root.enablePreview}}\" data-show-file-icon=\"{{@root.showFileIcon}}\" data-is-compact=\"{{@root.isCompact}}\"></pnp-document-card>\n {{/resultTypes}}\n </div>\n {{/each}}\n </div>\n </div>\n {{#if @root.paging.showPaging}}\n <pnp-pagination \n data-total-items=\"{{@root.paging.totalItemsCount}}\" \n data-hide-first-last-pages=\"{{@root.paging.hideFirstLastPages}}\"\n data-hide-disabled=\"{{@root.paging.hideDisabled}}\"\n data-hide-navigation=\"{{@root.paging.hideNavigation}}\"\n data-range=\"{{@root.paging.pagingRange}}\" \n data-items-count-per-page=\"{{@root.paging.itemsCountPerPage}}\" \n data-current-page-number=\"{{@root.paging.currentPageNumber}}\"\n >\n </pnp-pagination>\n {{/if}}\n </div>\n</content>\n\n<content id=\"placeholder\"> \n <div class=\"placeholder_root\">\n <div class=\"template_defaultCard\">\n {{#if showResultsCount}}\n <div class=\"template_resultCount\">\n <span class=\"shimmer line\" style=\"width: 20%\"></span>\n </div>\n {{/if}}\n <div class=\"document-card-container\"> \n {{#times @root.paging.totalItemsCount}}\n <div class=\"document-card-item\">\n <pnp-document-card-shimmers data-is-compact=\"{{@root.isCompact}}\"></pnp-document-card-shimmers>\n </div>\n {{/times}}\n </div>\n </div>\n </div>\n</content>",
38
- "externalTemplateUrl": "",
39
- "paging": {
40
- "@odata.type": "#graph.Json",
41
- "itemsCountPerPage": 10,
42
- "pagingRange": 5,
43
- "showPaging": true,
44
- "hideDisabled": true,
45
- "hideFirstLastPages": false,
46
- "hideNavigation": false
47
- },
48
- "sortList@odata.type": "#Collection(graph.Json)",
49
- "sortList": [
50
- {
51
- "sortField": "Created",
52
- "sortDirection": 1
53
- },
54
- {
55
- "sortField": "Size",
56
- "sortDirection": 2
57
- }
58
- ],
59
- "templateParameters": {
60
- "@odata.type": "#graph.Json",
61
- "showFileIcon": false,
62
- "documentCardFields@odata.type": "#Collection(graph.Json)",
63
- "documentCardFields": [
64
- {
65
- "name": "Title",
66
- "field": "title",
67
- "value": "Title",
68
- "useHandlebarsExpr": false,
69
- "supportHtml": false
70
- },
71
- {
72
- "name": "Location",
73
- "field": "location",
74
- "value": "<a style=\"color:{{@themeVariant.palette.themePrimary}}\" href=\"{{SPSiteUrl}}\">{{SiteTitle}}</a>",
75
- "useHandlebarsExpr": true,
76
- "supportHtml": true
77
- },
78
- {
79
- "name": "Tags",
80
- "field": "tags",
81
- "value": "{{#if owstaxidmetadataalltagsinfo}}<i class='ms-Icon ms-Icon--Tag' aria-hidden='true'></i> {{#each (split owstaxidmetadataalltagsinfo ',') as |tag| }}<a class=\"ms-Link\" href=\"#owstaxidmetadataalltagsinfo:'{{trim tag}}'\">{{tag}}</a>{{/each}}{{/if}}",
82
- "useHandlebarsExpr": true,
83
- "supportHtml": true
84
- },
85
- {
86
- "name": "Preview Image",
87
- "field": "previewImage",
88
- "value": "{{{getPreviewSrc item}}}",
89
- "useHandlebarsExpr": true,
90
- "supportHtml": false
91
- },
92
- {
93
- "name": "Preview URL",
94
- "field": "previewUrl",
95
- "value": "{{#eq contentclass 'STS_ListItem_851'}}{{{DefaultEncodingURL}}}{{else}}{{#eq FileType 'pdf'}}{{#contains Path '-my.sharepoint'}}{{{ServerRedirectedEmbedURL}}}{{else}}{{{Path}}}{{/contains}}{{else}}{{{ServerRedirectedEmbedURL}}}{{/eq}}{{/eq}} ",
96
- "useHandlebarsExpr": true,
97
- "supportHtml": false
98
- },
99
- {
100
- "name": "Date",
101
- "field": "date",
102
- "value": "{{getDate item.Created 'LL'}}",
103
- "useHandlebarsExpr": true,
104
- "supportHtml": false
105
- },
106
- {
107
- "name": "URL",
108
- "field": "href",
109
- "value": "{{getUrl item}}",
110
- "useHandlebarsExpr": true,
111
- "supportHtml": false
112
- },
113
- {
114
- "name": "Author",
115
- "field": "author",
116
- "value": "Author",
117
- "useHandlebarsExpr": false,
118
- "supportHtml": false
119
- },
120
- {
121
- "name": "Profile Image",
122
- "field": "profileImage",
123
- "value": "{{#with (split AuthorOWSUSER '|')}}/_layouts/15/userphoto.aspx?size=L&username={{[0]}}{{/with}}",
124
- "useHandlebarsExpr": true,
125
- "supportHtml": false
126
- },
127
- {
128
- "name": "IconSrc",
129
- "field": "iconSrc",
130
- "value": "{{IconSrc}}",
131
- "useHandlebarsExpr": true,
132
- "supportHtml": false
133
- },
134
- {
135
- "name": "IconExt",
136
- "field": "iconExt",
137
- "value": "{{IconExt}}",
138
- "useHandlebarsExpr": true,
139
- "supportHtml": false
140
- },
141
- {
142
- "name": "File Extension",
143
- "field": "fileExtension",
144
- "value": "FileType",
145
- "useHandlebarsExpr": false,
146
- "supportHtml": false
147
- }
148
- ],
149
- "detailsListColumns@odata.type": "#Collection(graph.Json)",
150
- "detailsListColumns": [
151
- {
152
- "name": "Title",
153
- "value": "Title",
154
- "useHandlebarsExpr": false,
155
- "minWidth": "80",
156
- "maxWidth": "300",
157
- "enableSorting": false,
158
- "isMultiline": false,
159
- "isResizable": true,
160
- "isResultItemLink": true,
161
- "sortIdx": 1
162
- },
163
- {
164
- "name": "Created",
165
- "value": "{{getDate Created 'LL'}}",
166
- "useHandlebarsExpr": true,
167
- "minWidth": "80",
168
- "maxWidth": "120",
169
- "enableSorting": false,
170
- "isMultiline": false,
171
- "isResizable": false,
172
- "isResultItemLink": false,
173
- "sortIdx": 2
174
- },
175
- {
176
- "name": "Summary",
177
- "value": "{{getSummary HitHighlightedSummary}}",
178
- "useHandlebarsExpr": true,
179
- "minWidth": "80",
180
- "maxWidth": "300",
181
- "enableSorting": false,
182
- "isMultiline": true,
183
- "isResizable": false,
184
- "isResultItemLink": false,
185
- "sortIdx": 3
186
- },
187
- {
188
- "uniqueId": "9c4eb969-17ac-4bf0-928e-7eb916688378",
189
- "name": "Author",
190
- "value": "Author",
191
- "minWidth": "50",
192
- "maxWidth": "310",
193
- "enableSorting": true
194
- }
195
- ]
196
- }
197
- };
198
- var clientId = import.meta.env.VITE_FRONTEND_CLIENT_ID;
199
- var authService = new Msal2AuthenticationService({ clientId: clientId }, false);
200
- var _a = React.useState(), site = _a[0], setSite = _a[1];
201
- return (React.createElement(AuthenticationContextProvider, { authProvider: authService },
202
- React.createElement(GraphContextProvider, null,
203
- React.createElement(SPContextProvider, { siteUrl: import.meta.env.VITE_SITE_URL },
204
- React.createElement(React.Fragment, null,
205
- React.createElement(PeoplePicker, { key: "people-picker", label: "People picker", description: "Pick some people here" }),
206
- React.createElement(TeamPicker, { key: "team-picker", label: "Team picker", description: "Pick a team here" }),
207
- React.createElement(DrivePicker, { key: "drive-picker", label: "Drive picker", description: "Pick a drive here" }),
208
- React.createElement(SitePicker, { onEntitySelected: function (site) { return setSite(site[0]); }, label: "Site picker", description: "Pick a site " }),
209
- site && React.createElement(ListPickerPicker, { siteId: site.id, label: "List picker", description: "Pick a list from ".concat(site.displayName) }),
210
- React.createElement(GetSiteTemplateContext, null))))));
211
- }
212
- export default App;
@@ -1,37 +0,0 @@
1
- import * as React from "react";
2
- import { useGraph, useSP } from "../context";
3
- export function Test(props) {
4
- var graphClient = useGraph().graphClient;
5
- var _a = useSP(), spClient = _a.spClient, siteUrl = _a.siteUrl;
6
- var _b = React.useState(true), loading = _b[0], setLoading = _b[1];
7
- var _c = React.useState(undefined), user = _c[0], setUser = _c[1];
8
- var _d = React.useState(undefined), web = _d[0], setWeb = _d[1];
9
- React.useEffect(function () {
10
- if (graphClient) {
11
- graphClient.get("https://graph.microsoft.com/v1.0/me").then(function (resp) {
12
- resp.json().then(function (response) {
13
- setUser(response);
14
- setLoading(false);
15
- });
16
- });
17
- }
18
- if (spClient) {
19
- spClient.get("".concat(siteUrl, "/_api/web"), {
20
- headers: {
21
- "Accept": "application/json;odata=nometadata"
22
- }
23
- }).then(function (resp) {
24
- resp.json().then(function (response) {
25
- setWeb(response);
26
- setLoading(false);
27
- });
28
- });
29
- }
30
- }, [graphClient]);
31
- if (loading) {
32
- return React.createElement("div", null, "Loading...");
33
- }
34
- return React.createElement("div", null,
35
- React.createElement("div", null, user === null || user === void 0 ? void 0 : user.displayName),
36
- React.createElement("div", null, web === null || web === void 0 ? void 0 : web.Title));
37
- }