@uniformdev/context-ui 20.50.2-alpha.167 → 20.50.2-alpha.180
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 +12 -16
- package/dist/index.js +8 -12
- package/dist/index.mjs +12 -16
- package/package.json +4 -4
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, CachedTestClient } 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,11 +35,10 @@ 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 CachedTestClient({
|
|
39
39
|
projectId,
|
|
40
40
|
apiKey,
|
|
41
|
-
apiHost
|
|
42
|
-
bypassCache: false
|
|
41
|
+
apiHost
|
|
43
42
|
});
|
|
44
43
|
const { tests } = await client.get();
|
|
45
44
|
setState({ notConfigured: false, loading: false, error: null, result: tests });
|
|
@@ -384,7 +383,7 @@ import { LoadingIndicator as LoadingIndicator2 } from "@uniformdev/design-system
|
|
|
384
383
|
import { createContext, useContext } from "react";
|
|
385
384
|
|
|
386
385
|
// src/hooks/useContextData.ts
|
|
387
|
-
import { ApiClientError as ApiClientError2,
|
|
386
|
+
import { ApiClientError as ApiClientError2, CachedManifestClient } from "@uniformdev/context/api";
|
|
388
387
|
import { useEffect as useEffect2, useState as useState3 } from "react";
|
|
389
388
|
function useContextData({ apiHost, apiKey, projectId }) {
|
|
390
389
|
const [state, setState] = useState3({
|
|
@@ -401,11 +400,10 @@ function useContextData({ apiHost, apiKey, projectId }) {
|
|
|
401
400
|
const runEffect = async () => {
|
|
402
401
|
setState({ notConfigured: false, loading: true, error: null, result: null });
|
|
403
402
|
try {
|
|
404
|
-
const client = new
|
|
403
|
+
const client = new CachedManifestClient({
|
|
405
404
|
projectId,
|
|
406
405
|
apiKey,
|
|
407
|
-
apiHost
|
|
408
|
-
bypassCache: false
|
|
406
|
+
apiHost
|
|
409
407
|
});
|
|
410
408
|
const result = await client.get({ preview: true });
|
|
411
409
|
setState({ notConfigured: false, loading: false, error: null, result });
|
|
@@ -434,7 +432,7 @@ function useContextData({ apiHost, apiKey, projectId }) {
|
|
|
434
432
|
}
|
|
435
433
|
|
|
436
434
|
// src/hooks/useDimensions.ts
|
|
437
|
-
import { ApiClientError as ApiClientError3,
|
|
435
|
+
import { ApiClientError as ApiClientError3, CachedDimensionClient, computeDimensionDisplayName } from "@uniformdev/context/api";
|
|
438
436
|
import { useEffect as useEffect3, useState as useState4 } from "react";
|
|
439
437
|
|
|
440
438
|
// src/utils/objectify.ts
|
|
@@ -465,11 +463,10 @@ function useDimensions({ apiHost, apiKey, projectId }) {
|
|
|
465
463
|
const runEffect = async () => {
|
|
466
464
|
setState({ notConfigured: false, loading: true, error: null, result: null });
|
|
467
465
|
try {
|
|
468
|
-
const client = new
|
|
466
|
+
const client = new CachedDimensionClient({
|
|
469
467
|
projectId,
|
|
470
468
|
apiKey,
|
|
471
|
-
apiHost
|
|
472
|
-
bypassCache: false
|
|
469
|
+
apiHost
|
|
473
470
|
});
|
|
474
471
|
const dimensions = (await client.get()).dimensions.map((dim) => ({
|
|
475
472
|
...dim,
|
|
@@ -1798,7 +1795,7 @@ function ProjectUIVersion({ children, versionMap, contextConfig }) {
|
|
|
1798
1795
|
import { useEffect as useEffect5, useState as useState8 } from "react";
|
|
1799
1796
|
|
|
1800
1797
|
// src/utils/validateContextConfig.ts
|
|
1801
|
-
import {
|
|
1798
|
+
import { UncachedManifestClient } from "@uniformdev/context/api";
|
|
1802
1799
|
import { validate as validate2 } from "uuid";
|
|
1803
1800
|
var validateContextConfig = async (contextConfig) => {
|
|
1804
1801
|
if (!contextConfig) {
|
|
@@ -1813,11 +1810,10 @@ var validateContextConfig = async (contextConfig) => {
|
|
|
1813
1810
|
if (!validate2(contextConfig.apiKey) && !contextConfig.projectId) {
|
|
1814
1811
|
return { valid: false, error: new Error("projectId is required when using a modern API key.") };
|
|
1815
1812
|
}
|
|
1816
|
-
const client = new
|
|
1813
|
+
const client = new UncachedManifestClient({
|
|
1817
1814
|
projectId: contextConfig.projectId,
|
|
1818
1815
|
apiKey: contextConfig.apiKey,
|
|
1819
|
-
apiHost: contextConfig.apiHost
|
|
1820
|
-
bypassCache: true
|
|
1816
|
+
apiHost: contextConfig.apiHost
|
|
1821
1817
|
});
|
|
1822
1818
|
try {
|
|
1823
1819
|
const result = await client.get({ preview: true });
|
package/dist/index.js
CHANGED
|
@@ -89,11 +89,10 @@ 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.CachedTestClient({
|
|
93
93
|
projectId,
|
|
94
94
|
apiKey,
|
|
95
|
-
apiHost
|
|
96
|
-
bypassCache: false
|
|
95
|
+
apiHost
|
|
97
96
|
});
|
|
98
97
|
const { tests } = await client.get();
|
|
99
98
|
setState({ notConfigured: false, loading: false, error: null, result: tests });
|
|
@@ -455,11 +454,10 @@ function useContextData({ apiHost, apiKey, projectId }) {
|
|
|
455
454
|
const runEffect = async () => {
|
|
456
455
|
setState({ notConfigured: false, loading: true, error: null, result: null });
|
|
457
456
|
try {
|
|
458
|
-
const client = new import_api2.
|
|
457
|
+
const client = new import_api2.CachedManifestClient({
|
|
459
458
|
projectId,
|
|
460
459
|
apiKey,
|
|
461
|
-
apiHost
|
|
462
|
-
bypassCache: false
|
|
460
|
+
apiHost
|
|
463
461
|
});
|
|
464
462
|
const result = await client.get({ preview: true });
|
|
465
463
|
setState({ notConfigured: false, loading: false, error: null, result });
|
|
@@ -519,11 +517,10 @@ function useDimensions({ apiHost, apiKey, projectId }) {
|
|
|
519
517
|
const runEffect = async () => {
|
|
520
518
|
setState({ notConfigured: false, loading: true, error: null, result: null });
|
|
521
519
|
try {
|
|
522
|
-
const client = new import_api3.
|
|
520
|
+
const client = new import_api3.CachedDimensionClient({
|
|
523
521
|
projectId,
|
|
524
522
|
apiKey,
|
|
525
|
-
apiHost
|
|
526
|
-
bypassCache: false
|
|
523
|
+
apiHost
|
|
527
524
|
});
|
|
528
525
|
const dimensions = (await client.get()).dimensions.map((dim) => ({
|
|
529
526
|
...dim,
|
|
@@ -1849,11 +1846,10 @@ var validateContextConfig = async (contextConfig) => {
|
|
|
1849
1846
|
if (!(0, import_uuid.validate)(contextConfig.apiKey) && !contextConfig.projectId) {
|
|
1850
1847
|
return { valid: false, error: new Error("projectId is required when using a modern API key.") };
|
|
1851
1848
|
}
|
|
1852
|
-
const client = new import_api4.
|
|
1849
|
+
const client = new import_api4.UncachedManifestClient({
|
|
1853
1850
|
projectId: contextConfig.projectId,
|
|
1854
1851
|
apiKey: contextConfig.apiKey,
|
|
1855
|
-
apiHost: contextConfig.apiHost
|
|
1856
|
-
bypassCache: true
|
|
1852
|
+
apiHost: contextConfig.apiHost
|
|
1857
1853
|
});
|
|
1858
1854
|
try {
|
|
1859
1855
|
const result = await client.get({ preview: true });
|
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, CachedTestClient } 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,11 +35,10 @@ 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 CachedTestClient({
|
|
39
39
|
projectId,
|
|
40
40
|
apiKey,
|
|
41
|
-
apiHost
|
|
42
|
-
bypassCache: false
|
|
41
|
+
apiHost
|
|
43
42
|
});
|
|
44
43
|
const { tests } = await client.get();
|
|
45
44
|
setState({ notConfigured: false, loading: false, error: null, result: tests });
|
|
@@ -384,7 +383,7 @@ import { LoadingIndicator as LoadingIndicator2 } from "@uniformdev/design-system
|
|
|
384
383
|
import { createContext, useContext } from "react";
|
|
385
384
|
|
|
386
385
|
// src/hooks/useContextData.ts
|
|
387
|
-
import { ApiClientError as ApiClientError2,
|
|
386
|
+
import { ApiClientError as ApiClientError2, CachedManifestClient } from "@uniformdev/context/api";
|
|
388
387
|
import { useEffect as useEffect2, useState as useState3 } from "react";
|
|
389
388
|
function useContextData({ apiHost, apiKey, projectId }) {
|
|
390
389
|
const [state, setState] = useState3({
|
|
@@ -401,11 +400,10 @@ function useContextData({ apiHost, apiKey, projectId }) {
|
|
|
401
400
|
const runEffect = async () => {
|
|
402
401
|
setState({ notConfigured: false, loading: true, error: null, result: null });
|
|
403
402
|
try {
|
|
404
|
-
const client = new
|
|
403
|
+
const client = new CachedManifestClient({
|
|
405
404
|
projectId,
|
|
406
405
|
apiKey,
|
|
407
|
-
apiHost
|
|
408
|
-
bypassCache: false
|
|
406
|
+
apiHost
|
|
409
407
|
});
|
|
410
408
|
const result = await client.get({ preview: true });
|
|
411
409
|
setState({ notConfigured: false, loading: false, error: null, result });
|
|
@@ -434,7 +432,7 @@ function useContextData({ apiHost, apiKey, projectId }) {
|
|
|
434
432
|
}
|
|
435
433
|
|
|
436
434
|
// src/hooks/useDimensions.ts
|
|
437
|
-
import { ApiClientError as ApiClientError3,
|
|
435
|
+
import { ApiClientError as ApiClientError3, CachedDimensionClient, computeDimensionDisplayName } from "@uniformdev/context/api";
|
|
438
436
|
import { useEffect as useEffect3, useState as useState4 } from "react";
|
|
439
437
|
|
|
440
438
|
// src/utils/objectify.ts
|
|
@@ -465,11 +463,10 @@ function useDimensions({ apiHost, apiKey, projectId }) {
|
|
|
465
463
|
const runEffect = async () => {
|
|
466
464
|
setState({ notConfigured: false, loading: true, error: null, result: null });
|
|
467
465
|
try {
|
|
468
|
-
const client = new
|
|
466
|
+
const client = new CachedDimensionClient({
|
|
469
467
|
projectId,
|
|
470
468
|
apiKey,
|
|
471
|
-
apiHost
|
|
472
|
-
bypassCache: false
|
|
469
|
+
apiHost
|
|
473
470
|
});
|
|
474
471
|
const dimensions = (await client.get()).dimensions.map((dim) => ({
|
|
475
472
|
...dim,
|
|
@@ -1798,7 +1795,7 @@ function ProjectUIVersion({ children, versionMap, contextConfig }) {
|
|
|
1798
1795
|
import { useEffect as useEffect5, useState as useState8 } from "react";
|
|
1799
1796
|
|
|
1800
1797
|
// src/utils/validateContextConfig.ts
|
|
1801
|
-
import {
|
|
1798
|
+
import { UncachedManifestClient } from "@uniformdev/context/api";
|
|
1802
1799
|
import { validate as validate2 } from "uuid";
|
|
1803
1800
|
var validateContextConfig = async (contextConfig) => {
|
|
1804
1801
|
if (!contextConfig) {
|
|
@@ -1813,11 +1810,10 @@ var validateContextConfig = async (contextConfig) => {
|
|
|
1813
1810
|
if (!validate2(contextConfig.apiKey) && !contextConfig.projectId) {
|
|
1814
1811
|
return { valid: false, error: new Error("projectId is required when using a modern API key.") };
|
|
1815
1812
|
}
|
|
1816
|
-
const client = new
|
|
1813
|
+
const client = new UncachedManifestClient({
|
|
1817
1814
|
projectId: contextConfig.projectId,
|
|
1818
1815
|
apiKey: contextConfig.apiKey,
|
|
1819
|
-
apiHost: contextConfig.apiHost
|
|
1820
|
-
bypassCache: true
|
|
1816
|
+
apiHost: contextConfig.apiHost
|
|
1821
1817
|
});
|
|
1822
1818
|
try {
|
|
1823
1819
|
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.180+0be2307590",
|
|
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,8 +28,8 @@
|
|
|
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.
|
|
31
|
+
"@uniformdev/context": "20.50.2-alpha.180+0be2307590",
|
|
32
|
+
"@uniformdev/design-system": "20.50.2-alpha.180+0be2307590",
|
|
33
33
|
"immer": "11.1.8",
|
|
34
34
|
"react-select": "5.10.2",
|
|
35
35
|
"react-use": "17.6.1",
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"access": "public"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "0be23075901a6fd0acd8166a2bea65fbd5589789"
|
|
58
58
|
}
|