@gooddata/sdk-ui-pluggable-application 11.25.0-alpha.2
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/LICENSE +19 -0
- package/README.md +10 -0
- package/esm/context.d.ts +32 -0
- package/esm/context.d.ts.map +1 -0
- package/esm/context.js +33 -0
- package/esm/context.js.map +1 -0
- package/esm/index.d.ts +7 -0
- package/esm/index.d.ts.map +1 -0
- package/esm/index.js +9 -0
- package/esm/index.js.map +1 -0
- package/esm/sdk-ui-pluggable-application.d.ts +44 -0
- package/esm/tsdoc-metadata.json +11 -0
- package/package.json +84 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright (c) 2026 GoodData Corporation
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
in the Software without restriction, including without limitation the rights
|
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
|
11
|
+
copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# GoodData.UI SDK - UI Pluggable Application
|
|
2
|
+
|
|
3
|
+
This package is a part of the [GoodData.UI SDK](https://sdk.gooddata.com/gooddata-ui/docs/about_gooddataui.html).
|
|
4
|
+
It provides React helpers for consuming platform context in pluggable applications.
|
|
5
|
+
|
|
6
|
+
## License
|
|
7
|
+
|
|
8
|
+
(C) 2026 GoodData Corporation
|
|
9
|
+
|
|
10
|
+
This project is under MIT License. See `LICENSE`.
|
package/esm/context.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type PropsWithChildren } from "react";
|
|
2
|
+
import { type IPlatformContext } from "@gooddata/sdk-pluggable-application-model";
|
|
3
|
+
/**
|
|
4
|
+
* Props for {@link PlatformContextProvider}.
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export interface IPlatformContextProviderProps extends PropsWithChildren {
|
|
9
|
+
/**
|
|
10
|
+
* Platform context snapshot.
|
|
11
|
+
*/
|
|
12
|
+
value: IPlatformContext;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* React provider that binds platform context into React context.
|
|
16
|
+
*
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
19
|
+
export declare function PlatformContextProvider({ value, children }: IPlatformContextProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
/**
|
|
21
|
+
* Returns platform context snapshot (or undefined if not available yet).
|
|
22
|
+
*
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
export declare function usePlatformContext(): IPlatformContext | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Returns platform context snapshot and throws if it's not available.
|
|
28
|
+
*
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
31
|
+
export declare function usePlatformContextStrict(context?: string): IPlatformContext;
|
|
32
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../src/context.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,iBAAiB,EAA6B,MAAM,OAAO,CAAC;AAI1E,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAKlF;;;;GAIG;AACH,MAAM,WAAW,6BAA8B,SAAQ,iBAAiB;IACpE;;OAEG;IACH,KAAK,EAAE,gBAAgB,CAAC;CAC3B;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,6BAA6B,2CAEzF;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,IAAI,gBAAgB,GAAG,SAAS,CAEjE;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,SAA6B,GAAG,gBAAgB,CAO/F"}
|
package/esm/context.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// (C) 2026 GoodData Corporation
|
|
3
|
+
import { createContext, useContext } from "react";
|
|
4
|
+
import { invariant } from "ts-invariant";
|
|
5
|
+
const PlatformContext = createContext(undefined);
|
|
6
|
+
PlatformContext.displayName = "PlatformContext";
|
|
7
|
+
/**
|
|
8
|
+
* React provider that binds platform context into React context.
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export function PlatformContextProvider({ value, children }) {
|
|
13
|
+
return _jsx(PlatformContext.Provider, { value: value, children: children });
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Returns platform context snapshot (or undefined if not available yet).
|
|
17
|
+
*
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
export function usePlatformContext() {
|
|
21
|
+
return useContext(PlatformContext);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Returns platform context snapshot and throws if it's not available.
|
|
25
|
+
*
|
|
26
|
+
* @public
|
|
27
|
+
*/
|
|
28
|
+
export function usePlatformContextStrict(context = "usePlatformContextStrict") {
|
|
29
|
+
const value = usePlatformContext();
|
|
30
|
+
invariant(value, `${context}: platform context is not available. Make sure PlatformContextProvider is mounted and the host provided a context snapshot.`);
|
|
31
|
+
return value;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../src/context.tsx"],"names":[],"mappings":";AAAA,gCAAgC;AAEhC,OAAO,EAA0B,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE1E,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAIzC,MAAM,eAAe,GAAG,aAAa,CAA+B,SAAS,CAAC,CAAC;AAC/E,eAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC;AAchD;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAiC,EAAE;IACxF,OAAO,KAAC,eAAe,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,YAAG,QAAQ,GAA4B,CAAC;AAAA,CACxF;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,GAAiC;IAC/D,OAAO,UAAU,CAAC,eAAe,CAAC,CAAC;AAAA,CACtC;AAED;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAAO,GAAG,0BAA0B,EAAoB;IAC7F,MAAM,KAAK,GAAG,kBAAkB,EAAE,CAAC;IACnC,SAAS,CACL,KAAK,EACL,GAAG,OAAO,6HAA6H,CAC1I,CAAC;IACF,OAAO,KAAK,CAAC;AAAA,CAChB"}
|
package/esm/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React helpers for pluggable application integration.
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
6
|
+
export { PlatformContextProvider, type IPlatformContextProviderProps, usePlatformContext, usePlatformContextStrict, } from "./context.js";
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AAEH,OAAO,EACH,uBAAuB,EACvB,KAAK,6BAA6B,EAClC,kBAAkB,EAClB,wBAAwB,GAC3B,MAAM,cAAc,CAAC"}
|
package/esm/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// (C) 2026 GoodData Corporation
|
|
2
|
+
/* oxlint-disable no-barrel-files/no-barrel-files */
|
|
3
|
+
/**
|
|
4
|
+
* React helpers for pluggable application integration.
|
|
5
|
+
*
|
|
6
|
+
* @packageDocumentation
|
|
7
|
+
*/
|
|
8
|
+
export { PlatformContextProvider, usePlatformContext, usePlatformContextStrict, } from "./context.js";
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
package/esm/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAEhC,oDAAoD;AAEpD;;;;GAIG;AAEH,OAAO,EACH,uBAAuB,EAEvB,kBAAkB,EAClB,wBAAwB,GAC3B,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React helpers for pluggable application integration.
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { IPlatformContext } from '@gooddata/sdk-pluggable-application-model';
|
|
8
|
+
import { JSX } from 'react/jsx-runtime';
|
|
9
|
+
import { PropsWithChildren } from 'react';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Props for {@link PlatformContextProvider}.
|
|
13
|
+
*
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
export declare interface IPlatformContextProviderProps extends PropsWithChildren {
|
|
17
|
+
/**
|
|
18
|
+
* Platform context snapshot.
|
|
19
|
+
*/
|
|
20
|
+
value: IPlatformContext;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* React provider that binds platform context into React context.
|
|
25
|
+
*
|
|
26
|
+
* @public
|
|
27
|
+
*/
|
|
28
|
+
export declare function PlatformContextProvider({ value, children }: IPlatformContextProviderProps): JSX.Element;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Returns platform context snapshot (or undefined if not available yet).
|
|
32
|
+
*
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
export declare function usePlatformContext(): IPlatformContext | undefined;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Returns platform context snapshot and throws if it's not available.
|
|
39
|
+
*
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
42
|
+
export declare function usePlatformContextStrict(context?: string): IPlatformContext;
|
|
43
|
+
|
|
44
|
+
export { }
|
|
@@ -0,0 +1,11 @@
|
|
|
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.55.2"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@gooddata/sdk-ui-pluggable-application",
|
|
3
|
+
"version": "11.25.0-alpha.2",
|
|
4
|
+
"description": "GoodData SDK React helpers for pluggable applications",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "GoodData Corporation",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/gooddata/gooddata-ui-sdk.git",
|
|
10
|
+
"directory": "libs/sdk-ui-pluggable-application"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"esm/**/*.js",
|
|
14
|
+
"esm/**/*.json",
|
|
15
|
+
"esm/**/*.d.ts",
|
|
16
|
+
"esm/**/*.map"
|
|
17
|
+
],
|
|
18
|
+
"type": "module",
|
|
19
|
+
"sideEffects": false,
|
|
20
|
+
"browser": "./esm/index.js",
|
|
21
|
+
"types": "./esm/index.d.ts",
|
|
22
|
+
"exports": "./esm/index.js",
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"ts-invariant": "0.10.3",
|
|
25
|
+
"tslib": "2.8.1",
|
|
26
|
+
"@gooddata/sdk-pluggable-application-model": "11.25.0-alpha.2"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@microsoft/api-documenter": "^7.17.0",
|
|
30
|
+
"@microsoft/api-extractor": "^7.55.2",
|
|
31
|
+
"@types/node": "22.13.0",
|
|
32
|
+
"@types/react": "19.1.11",
|
|
33
|
+
"@types/react-dom": "19.1.7",
|
|
34
|
+
"@typescript-eslint/eslint-plugin": "8.52.0",
|
|
35
|
+
"@typescript-eslint/parser": "8.52.0",
|
|
36
|
+
"@typescript/native-preview": "7.0.0-dev.20260202.1",
|
|
37
|
+
"dependency-cruiser": "^14.1.2",
|
|
38
|
+
"eslint": "^9.39.2",
|
|
39
|
+
"eslint-import-resolver-typescript": "4.4.4",
|
|
40
|
+
"eslint-plugin-headers": "1.3.3",
|
|
41
|
+
"eslint-plugin-import-esm": "1.2.1",
|
|
42
|
+
"eslint-plugin-import-x": "4.16.1",
|
|
43
|
+
"eslint-plugin-jsdoc": "62.1.0",
|
|
44
|
+
"eslint-plugin-no-barrel-files": "1.2.2",
|
|
45
|
+
"eslint-plugin-no-only-tests": "3.3.0",
|
|
46
|
+
"eslint-plugin-react": "7.37.5",
|
|
47
|
+
"eslint-plugin-react-hooks": "5.2.0",
|
|
48
|
+
"eslint-plugin-sonarjs": "3.0.6",
|
|
49
|
+
"happy-dom": "18.0.1",
|
|
50
|
+
"npm-run-all": "^4.1.5",
|
|
51
|
+
"oxfmt": "0.27.0",
|
|
52
|
+
"oxlint": "^1.43.0",
|
|
53
|
+
"oxlint-tsgolint": "0.11.4",
|
|
54
|
+
"react": "19.1.1",
|
|
55
|
+
"react-dom": "19.1.1",
|
|
56
|
+
"typescript": "5.9.3",
|
|
57
|
+
"vitest": "4.0.8",
|
|
58
|
+
"@gooddata/oxlint-config": "11.25.0-alpha.2",
|
|
59
|
+
"@gooddata/eslint-config": "11.25.0-alpha.2"
|
|
60
|
+
},
|
|
61
|
+
"peerDependencies": {
|
|
62
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
63
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
64
|
+
},
|
|
65
|
+
"scripts": {
|
|
66
|
+
"_phase:build": "npm run build",
|
|
67
|
+
"_phase:test": "echo \"No tests for @gooddata/sdk-ui-pluggable-application\"",
|
|
68
|
+
"_phase:validate": "npm run validate",
|
|
69
|
+
"api-extractor": "mkdir -p api && [ -z \"${CI}\" ] && (api-extractor run -l) || (api-extractor run)",
|
|
70
|
+
"build": "npm-run-all -p build-check build-ts && npm run api-extractor",
|
|
71
|
+
"build-check": "tsgo",
|
|
72
|
+
"build-ts": "tsgo -p tsconfig.build.json",
|
|
73
|
+
"clean": "../../common/scripts/clean-command-state.sh && rm -rf ci dist esm coverage *.log tsconfig.tsbuildinfo",
|
|
74
|
+
"dep-cruiser": "depcruise --validate .dependency-cruiser.cjs --output-type err-long src/",
|
|
75
|
+
"format-check": "oxfmt --check .",
|
|
76
|
+
"format-write": "oxfmt .",
|
|
77
|
+
"lint": "oxlint . --type-aware --quiet && eslint .",
|
|
78
|
+
"lint-fix": "oxlint . --type-aware --quiet --fix && eslint . --fix",
|
|
79
|
+
"test": "vitest watch",
|
|
80
|
+
"test-once": "vitest run --passWithNoTests",
|
|
81
|
+
"validate": "npm run lint && npm run dep-cruiser && npm run format-check",
|
|
82
|
+
"validate-esm": "node --input-type=module --eval 'import \"@gooddata/sdk-ui-pluggable-application\"'"
|
|
83
|
+
}
|
|
84
|
+
}
|