@uniformdev/context-ui 20.50.2-alpha.146 → 20.50.2-alpha.167
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/dist/index.esm.js +16 -12
- package/dist/index.js +16 -12
- package/dist/index.mjs +16 -12
- package/package.json +10 -11
package/dist/index.esm.js
CHANGED
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
import { useState as useState2 } from "react";
|
|
18
18
|
|
|
19
19
|
// src/hooks/useABTests.ts
|
|
20
|
-
import { ApiClientError,
|
|
20
|
+
import { ApiClientError, TestClient } from "@uniformdev/context/api";
|
|
21
21
|
import { useEffect, useState } from "react";
|
|
22
22
|
function useABTests({ apiHost, apiKey, projectId }) {
|
|
23
23
|
const [reload, setReload] = useState(true);
|
|
@@ -35,10 +35,11 @@ function useABTests({ apiHost, apiKey, projectId }) {
|
|
|
35
35
|
const runEffect = async () => {
|
|
36
36
|
setState({ notConfigured: false, loading: true, error: null, result: null });
|
|
37
37
|
try {
|
|
38
|
-
const client = new
|
|
38
|
+
const client = new TestClient({
|
|
39
39
|
projectId,
|
|
40
40
|
apiKey,
|
|
41
|
-
apiHost
|
|
41
|
+
apiHost,
|
|
42
|
+
bypassCache: false
|
|
42
43
|
});
|
|
43
44
|
const { tests } = await client.get();
|
|
44
45
|
setState({ notConfigured: false, loading: false, error: null, result: tests });
|
|
@@ -383,7 +384,7 @@ import { LoadingIndicator as LoadingIndicator2 } from "@uniformdev/design-system
|
|
|
383
384
|
import { createContext, useContext } from "react";
|
|
384
385
|
|
|
385
386
|
// src/hooks/useContextData.ts
|
|
386
|
-
import { ApiClientError as ApiClientError2,
|
|
387
|
+
import { ApiClientError as ApiClientError2, ManifestClient } from "@uniformdev/context/api";
|
|
387
388
|
import { useEffect as useEffect2, useState as useState3 } from "react";
|
|
388
389
|
function useContextData({ apiHost, apiKey, projectId }) {
|
|
389
390
|
const [state, setState] = useState3({
|
|
@@ -400,10 +401,11 @@ function useContextData({ apiHost, apiKey, projectId }) {
|
|
|
400
401
|
const runEffect = async () => {
|
|
401
402
|
setState({ notConfigured: false, loading: true, error: null, result: null });
|
|
402
403
|
try {
|
|
403
|
-
const client = new
|
|
404
|
+
const client = new ManifestClient({
|
|
404
405
|
projectId,
|
|
405
406
|
apiKey,
|
|
406
|
-
apiHost
|
|
407
|
+
apiHost,
|
|
408
|
+
bypassCache: false
|
|
407
409
|
});
|
|
408
410
|
const result = await client.get({ preview: true });
|
|
409
411
|
setState({ notConfigured: false, loading: false, error: null, result });
|
|
@@ -432,7 +434,7 @@ function useContextData({ apiHost, apiKey, projectId }) {
|
|
|
432
434
|
}
|
|
433
435
|
|
|
434
436
|
// src/hooks/useDimensions.ts
|
|
435
|
-
import { ApiClientError as ApiClientError3,
|
|
437
|
+
import { ApiClientError as ApiClientError3, computeDimensionDisplayName, DimensionClient } from "@uniformdev/context/api";
|
|
436
438
|
import { useEffect as useEffect3, useState as useState4 } from "react";
|
|
437
439
|
|
|
438
440
|
// src/utils/objectify.ts
|
|
@@ -463,10 +465,11 @@ function useDimensions({ apiHost, apiKey, projectId }) {
|
|
|
463
465
|
const runEffect = async () => {
|
|
464
466
|
setState({ notConfigured: false, loading: true, error: null, result: null });
|
|
465
467
|
try {
|
|
466
|
-
const client = new
|
|
468
|
+
const client = new DimensionClient({
|
|
467
469
|
projectId,
|
|
468
470
|
apiKey,
|
|
469
|
-
apiHost
|
|
471
|
+
apiHost,
|
|
472
|
+
bypassCache: false
|
|
470
473
|
});
|
|
471
474
|
const dimensions = (await client.get()).dimensions.map((dim) => ({
|
|
472
475
|
...dim,
|
|
@@ -1795,7 +1798,7 @@ function ProjectUIVersion({ children, versionMap, contextConfig }) {
|
|
|
1795
1798
|
import { useEffect as useEffect5, useState as useState8 } from "react";
|
|
1796
1799
|
|
|
1797
1800
|
// src/utils/validateContextConfig.ts
|
|
1798
|
-
import {
|
|
1801
|
+
import { ManifestClient as ManifestClient2 } from "@uniformdev/context/api";
|
|
1799
1802
|
import { validate as validate2 } from "uuid";
|
|
1800
1803
|
var validateContextConfig = async (contextConfig) => {
|
|
1801
1804
|
if (!contextConfig) {
|
|
@@ -1810,10 +1813,11 @@ var validateContextConfig = async (contextConfig) => {
|
|
|
1810
1813
|
if (!validate2(contextConfig.apiKey) && !contextConfig.projectId) {
|
|
1811
1814
|
return { valid: false, error: new Error("projectId is required when using a modern API key.") };
|
|
1812
1815
|
}
|
|
1813
|
-
const client = new
|
|
1816
|
+
const client = new ManifestClient2({
|
|
1814
1817
|
projectId: contextConfig.projectId,
|
|
1815
1818
|
apiKey: contextConfig.apiKey,
|
|
1816
|
-
apiHost: contextConfig.apiHost
|
|
1819
|
+
apiHost: contextConfig.apiHost,
|
|
1820
|
+
bypassCache: true
|
|
1817
1821
|
});
|
|
1818
1822
|
try {
|
|
1819
1823
|
const result = await client.get({ preview: true });
|
package/dist/index.js
CHANGED
|
@@ -29,8 +29,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
29
29
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
30
|
|
|
31
31
|
// src/index.ts
|
|
32
|
-
var
|
|
33
|
-
__export(
|
|
32
|
+
var index_exports = {};
|
|
33
|
+
__export(index_exports, {
|
|
34
34
|
AbTestSelector: () => AbTestSelector,
|
|
35
35
|
ContextData: () => ContextData,
|
|
36
36
|
CriteriaMatchMenu: () => CriteriaMatchMenu,
|
|
@@ -59,7 +59,7 @@ __export(src_exports, {
|
|
|
59
59
|
useValidateContextConfig: () => useValidateContextConfig,
|
|
60
60
|
validateContextConfig: () => validateContextConfig
|
|
61
61
|
});
|
|
62
|
-
module.exports = __toCommonJS(
|
|
62
|
+
module.exports = __toCommonJS(index_exports);
|
|
63
63
|
|
|
64
64
|
// ../../scripts/emotion-jsx-shim.js
|
|
65
65
|
var import_react = require("@emotion/react");
|
|
@@ -89,10 +89,11 @@ function useABTests({ apiHost, apiKey, projectId }) {
|
|
|
89
89
|
const runEffect = async () => {
|
|
90
90
|
setState({ notConfigured: false, loading: true, error: null, result: null });
|
|
91
91
|
try {
|
|
92
|
-
const client = new import_api.
|
|
92
|
+
const client = new import_api.TestClient({
|
|
93
93
|
projectId,
|
|
94
94
|
apiKey,
|
|
95
|
-
apiHost
|
|
95
|
+
apiHost,
|
|
96
|
+
bypassCache: false
|
|
96
97
|
});
|
|
97
98
|
const { tests } = await client.get();
|
|
98
99
|
setState({ notConfigured: false, loading: false, error: null, result: tests });
|
|
@@ -454,10 +455,11 @@ function useContextData({ apiHost, apiKey, projectId }) {
|
|
|
454
455
|
const runEffect = async () => {
|
|
455
456
|
setState({ notConfigured: false, loading: true, error: null, result: null });
|
|
456
457
|
try {
|
|
457
|
-
const client = new import_api2.
|
|
458
|
+
const client = new import_api2.ManifestClient({
|
|
458
459
|
projectId,
|
|
459
460
|
apiKey,
|
|
460
|
-
apiHost
|
|
461
|
+
apiHost,
|
|
462
|
+
bypassCache: false
|
|
461
463
|
});
|
|
462
464
|
const result = await client.get({ preview: true });
|
|
463
465
|
setState({ notConfigured: false, loading: false, error: null, result });
|
|
@@ -517,10 +519,11 @@ function useDimensions({ apiHost, apiKey, projectId }) {
|
|
|
517
519
|
const runEffect = async () => {
|
|
518
520
|
setState({ notConfigured: false, loading: true, error: null, result: null });
|
|
519
521
|
try {
|
|
520
|
-
const client = new import_api3.
|
|
522
|
+
const client = new import_api3.DimensionClient({
|
|
521
523
|
projectId,
|
|
522
524
|
apiKey,
|
|
523
|
-
apiHost
|
|
525
|
+
apiHost,
|
|
526
|
+
bypassCache: false
|
|
524
527
|
});
|
|
525
528
|
const dimensions = (await client.get()).dimensions.map((dim) => ({
|
|
526
529
|
...dim,
|
|
@@ -1846,10 +1849,11 @@ var validateContextConfig = async (contextConfig) => {
|
|
|
1846
1849
|
if (!(0, import_uuid.validate)(contextConfig.apiKey) && !contextConfig.projectId) {
|
|
1847
1850
|
return { valid: false, error: new Error("projectId is required when using a modern API key.") };
|
|
1848
1851
|
}
|
|
1849
|
-
const client = new import_api4.
|
|
1852
|
+
const client = new import_api4.ManifestClient({
|
|
1850
1853
|
projectId: contextConfig.projectId,
|
|
1851
1854
|
apiKey: contextConfig.apiKey,
|
|
1852
|
-
apiHost: contextConfig.apiHost
|
|
1855
|
+
apiHost: contextConfig.apiHost,
|
|
1856
|
+
bypassCache: true
|
|
1853
1857
|
});
|
|
1854
1858
|
try {
|
|
1855
1859
|
const result = await client.get({ preview: true });
|
|
@@ -1892,7 +1896,7 @@ var useValidateContextConfig = (contextConfig) => {
|
|
|
1892
1896
|
};
|
|
1893
1897
|
|
|
1894
1898
|
// src/index.ts
|
|
1895
|
-
__reExport(
|
|
1899
|
+
__reExport(index_exports, require("@uniformdev/design-system"), module.exports);
|
|
1896
1900
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1897
1901
|
0 && (module.exports = {
|
|
1898
1902
|
AbTestSelector,
|
package/dist/index.mjs
CHANGED
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
import { useState as useState2 } from "react";
|
|
18
18
|
|
|
19
19
|
// src/hooks/useABTests.ts
|
|
20
|
-
import { ApiClientError,
|
|
20
|
+
import { ApiClientError, TestClient } from "@uniformdev/context/api";
|
|
21
21
|
import { useEffect, useState } from "react";
|
|
22
22
|
function useABTests({ apiHost, apiKey, projectId }) {
|
|
23
23
|
const [reload, setReload] = useState(true);
|
|
@@ -35,10 +35,11 @@ function useABTests({ apiHost, apiKey, projectId }) {
|
|
|
35
35
|
const runEffect = async () => {
|
|
36
36
|
setState({ notConfigured: false, loading: true, error: null, result: null });
|
|
37
37
|
try {
|
|
38
|
-
const client = new
|
|
38
|
+
const client = new TestClient({
|
|
39
39
|
projectId,
|
|
40
40
|
apiKey,
|
|
41
|
-
apiHost
|
|
41
|
+
apiHost,
|
|
42
|
+
bypassCache: false
|
|
42
43
|
});
|
|
43
44
|
const { tests } = await client.get();
|
|
44
45
|
setState({ notConfigured: false, loading: false, error: null, result: tests });
|
|
@@ -383,7 +384,7 @@ import { LoadingIndicator as LoadingIndicator2 } from "@uniformdev/design-system
|
|
|
383
384
|
import { createContext, useContext } from "react";
|
|
384
385
|
|
|
385
386
|
// src/hooks/useContextData.ts
|
|
386
|
-
import { ApiClientError as ApiClientError2,
|
|
387
|
+
import { ApiClientError as ApiClientError2, ManifestClient } from "@uniformdev/context/api";
|
|
387
388
|
import { useEffect as useEffect2, useState as useState3 } from "react";
|
|
388
389
|
function useContextData({ apiHost, apiKey, projectId }) {
|
|
389
390
|
const [state, setState] = useState3({
|
|
@@ -400,10 +401,11 @@ function useContextData({ apiHost, apiKey, projectId }) {
|
|
|
400
401
|
const runEffect = async () => {
|
|
401
402
|
setState({ notConfigured: false, loading: true, error: null, result: null });
|
|
402
403
|
try {
|
|
403
|
-
const client = new
|
|
404
|
+
const client = new ManifestClient({
|
|
404
405
|
projectId,
|
|
405
406
|
apiKey,
|
|
406
|
-
apiHost
|
|
407
|
+
apiHost,
|
|
408
|
+
bypassCache: false
|
|
407
409
|
});
|
|
408
410
|
const result = await client.get({ preview: true });
|
|
409
411
|
setState({ notConfigured: false, loading: false, error: null, result });
|
|
@@ -432,7 +434,7 @@ function useContextData({ apiHost, apiKey, projectId }) {
|
|
|
432
434
|
}
|
|
433
435
|
|
|
434
436
|
// src/hooks/useDimensions.ts
|
|
435
|
-
import { ApiClientError as ApiClientError3,
|
|
437
|
+
import { ApiClientError as ApiClientError3, computeDimensionDisplayName, DimensionClient } from "@uniformdev/context/api";
|
|
436
438
|
import { useEffect as useEffect3, useState as useState4 } from "react";
|
|
437
439
|
|
|
438
440
|
// src/utils/objectify.ts
|
|
@@ -463,10 +465,11 @@ function useDimensions({ apiHost, apiKey, projectId }) {
|
|
|
463
465
|
const runEffect = async () => {
|
|
464
466
|
setState({ notConfigured: false, loading: true, error: null, result: null });
|
|
465
467
|
try {
|
|
466
|
-
const client = new
|
|
468
|
+
const client = new DimensionClient({
|
|
467
469
|
projectId,
|
|
468
470
|
apiKey,
|
|
469
|
-
apiHost
|
|
471
|
+
apiHost,
|
|
472
|
+
bypassCache: false
|
|
470
473
|
});
|
|
471
474
|
const dimensions = (await client.get()).dimensions.map((dim) => ({
|
|
472
475
|
...dim,
|
|
@@ -1795,7 +1798,7 @@ function ProjectUIVersion({ children, versionMap, contextConfig }) {
|
|
|
1795
1798
|
import { useEffect as useEffect5, useState as useState8 } from "react";
|
|
1796
1799
|
|
|
1797
1800
|
// src/utils/validateContextConfig.ts
|
|
1798
|
-
import {
|
|
1801
|
+
import { ManifestClient as ManifestClient2 } from "@uniformdev/context/api";
|
|
1799
1802
|
import { validate as validate2 } from "uuid";
|
|
1800
1803
|
var validateContextConfig = async (contextConfig) => {
|
|
1801
1804
|
if (!contextConfig) {
|
|
@@ -1810,10 +1813,11 @@ var validateContextConfig = async (contextConfig) => {
|
|
|
1810
1813
|
if (!validate2(contextConfig.apiKey) && !contextConfig.projectId) {
|
|
1811
1814
|
return { valid: false, error: new Error("projectId is required when using a modern API key.") };
|
|
1812
1815
|
}
|
|
1813
|
-
const client = new
|
|
1816
|
+
const client = new ManifestClient2({
|
|
1814
1817
|
projectId: contextConfig.projectId,
|
|
1815
1818
|
apiKey: contextConfig.apiKey,
|
|
1816
|
-
apiHost: contextConfig.apiHost
|
|
1819
|
+
apiHost: contextConfig.apiHost,
|
|
1820
|
+
bypassCache: true
|
|
1817
1821
|
});
|
|
1818
1822
|
try {
|
|
1819
1823
|
const result = await client.get({ preview: true });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/context-ui",
|
|
3
|
-
"version": "20.50.2-alpha.
|
|
3
|
+
"version": "20.50.2-alpha.167+74e60d5bb7",
|
|
4
4
|
"description": "React-based functionality and components for Uniform Context",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -28,13 +28,13 @@
|
|
|
28
28
|
"@emotion/react": "11.14.0",
|
|
29
29
|
"@hello-pangea/dnd": "18.0.1",
|
|
30
30
|
"@react-icons/all-files": "https://github.com/react-icons/react-icons/releases/download/v5.5.0/react-icons-all-files-5.5.0.tgz",
|
|
31
|
-
"@uniformdev/context": "20.50.2-alpha.
|
|
32
|
-
"@uniformdev/design-system": "20.50.2-alpha.
|
|
33
|
-
"immer": "
|
|
31
|
+
"@uniformdev/context": "20.50.2-alpha.167+74e60d5bb7",
|
|
32
|
+
"@uniformdev/design-system": "20.50.2-alpha.167+74e60d5bb7",
|
|
33
|
+
"immer": "11.1.8",
|
|
34
34
|
"react-select": "5.10.2",
|
|
35
|
-
"react-use": "17.6.
|
|
35
|
+
"react-use": "17.6.1",
|
|
36
36
|
"timeago.js": "4.0.2",
|
|
37
|
-
"uuid": "
|
|
37
|
+
"uuid": "11.1.1",
|
|
38
38
|
"yup": "0.32.11"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
@@ -42,10 +42,9 @@
|
|
|
42
42
|
"react-dom": ">=16.8"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@storybook/react": "10.
|
|
46
|
-
"@types/react": "19.2.
|
|
47
|
-
"@types/react-dom": "19.2.
|
|
48
|
-
"@types/uuid": "9.0.4",
|
|
45
|
+
"@storybook/react": "10.4.6",
|
|
46
|
+
"@types/react": "19.2.17",
|
|
47
|
+
"@types/react-dom": "19.2.3",
|
|
49
48
|
"react": "19.2.1",
|
|
50
49
|
"react-dom": "19.2.1"
|
|
51
50
|
},
|
|
@@ -55,5 +54,5 @@
|
|
|
55
54
|
"publishConfig": {
|
|
56
55
|
"access": "public"
|
|
57
56
|
},
|
|
58
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "74e60d5bb79fe1c4d446e4d3e6edf9f08850be4f"
|
|
59
58
|
}
|