@dxos/react-list 0.1.10 → 0.1.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/List/List.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;AAIpB,OAAO,EAAsB,SAAS,
|
|
1
|
+
{"version":3,"file":"List.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/List/List.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,YAAY,CAAC;AAIpB,OAAO,EAAsB,SAAS,EAAE,MAAM,cAAc,CAAC;AAU7D,OAAO,EAAQ,SAAS,EAAE,MAAM,QAAQ,CAAC;;;;;;AAKzC,wBAIE;AAsBF,eAAO,MAAM,OAAO;;;EAAqC,CAAC"}
|
|
@@ -31,13 +31,14 @@ require("@dxosTheme");
|
|
|
31
31
|
const react_1 = __importStar(require("react"));
|
|
32
32
|
const async_1 = require("@dxos/async");
|
|
33
33
|
const client_1 = require("@dxos/client");
|
|
34
|
+
const testing_1 = require("@dxos/client/testing");
|
|
34
35
|
const debug_1 = require("@dxos/debug");
|
|
35
36
|
const object_model_1 = require("@dxos/object-model");
|
|
36
37
|
const react_async_1 = require("@dxos/react-async");
|
|
37
38
|
const react_client_1 = require("@dxos/react-client");
|
|
38
39
|
const react_uikit_1 = require("@dxos/react-uikit");
|
|
39
40
|
const model_1 = require("../../model");
|
|
40
|
-
const
|
|
41
|
+
const testing_2 = require("../../testing");
|
|
41
42
|
const List_1 = require("./List");
|
|
42
43
|
// TODO(wittjosiah): @dxos/log.
|
|
43
44
|
const log = console.log;
|
|
@@ -60,14 +61,14 @@ const Template = (args) => {
|
|
|
60
61
|
}, [space]);
|
|
61
62
|
return (react_1.default.createElement("main", { className: 'max-is-lg mli-auto pli-7 mbs-7' }, item && space ? react_1.default.createElement(List_1.List, { ...args, itemId: item.id, spaceKey: space === null || space === void 0 ? void 0 : space.key }) : react_1.default.createElement(react_uikit_1.Loading, { label: 'Loading\u2026' })));
|
|
62
63
|
};
|
|
63
|
-
exports.Default = (0,
|
|
64
|
+
exports.Default = (0, testing_2.templateForComponent)(Template)({});
|
|
64
65
|
exports.Default.args = {};
|
|
65
66
|
exports.Default.decorators = [
|
|
66
67
|
// TODO(wittjosiah): Factor out.
|
|
67
68
|
(Story) => {
|
|
68
69
|
const n = 2;
|
|
69
70
|
const clients = (0, react_1.useMemo)(() => {
|
|
70
|
-
const testBuilder = new
|
|
71
|
+
const testBuilder = new testing_1.TestBuilder();
|
|
71
72
|
return [...Array(n)].map(() => new client_1.Client({ services: testBuilder.createClientServicesHost() }));
|
|
72
73
|
}, []);
|
|
73
74
|
const [spaceKey, setSpaceKey] = (0, react_1.useState)();
|
|
@@ -77,14 +78,13 @@ exports.Default.decorators = [
|
|
|
77
78
|
await Promise.all(clients.map((client) => client.halo.createProfile()));
|
|
78
79
|
log('identity created');
|
|
79
80
|
const space = await clients[0].echo.createSpace();
|
|
80
|
-
log('space created');
|
|
81
|
+
log('space created', { space: space.key });
|
|
81
82
|
await Promise.all(clients.slice(1).map(async (client) => {
|
|
82
|
-
const success1 = new async_1.Trigger();
|
|
83
|
-
const success2 = new async_1.Trigger();
|
|
84
83
|
const observable1 = await space.createInvitation({ type: client_1.Invitation.Type.INTERACTIVE_TESTING });
|
|
85
84
|
log('invitation created');
|
|
86
85
|
const observable2 = await client.echo.acceptInvitation(observable1.invitation);
|
|
87
86
|
log('invitation accepted');
|
|
87
|
+
const success1 = new async_1.Trigger();
|
|
88
88
|
observable1.subscribe({
|
|
89
89
|
onSuccess: (invitation) => {
|
|
90
90
|
success1.wake(invitation);
|
|
@@ -92,6 +92,7 @@ exports.Default.decorators = [
|
|
|
92
92
|
},
|
|
93
93
|
onError: (err) => (0, debug_1.raise)(err)
|
|
94
94
|
});
|
|
95
|
+
const success2 = new async_1.Trigger();
|
|
95
96
|
observable2.subscribe({
|
|
96
97
|
onSuccess: (invitation) => {
|
|
97
98
|
success2.wake(invitation);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.stories.js","sourceRoot":"","sources":["../../../../src/components/List/List.stories.tsx"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;AAEF,sBAAoB;AACpB,+CAAiD;AAEjD,uCAAsC;AACtC,
|
|
1
|
+
{"version":3,"file":"List.stories.js","sourceRoot":"","sources":["../../../../src/components/List/List.stories.tsx"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;AAEF,sBAAoB;AACpB,+CAAiD;AAEjD,uCAAsC;AACtC,yCAA6D;AAC7D,kDAAmD;AACnD,uCAAoC;AACpC,qDAAiD;AACjD,mDAAmD;AACnD,qDAA4E;AAC5E,mDAA4C;AAE5C,uCAAwC;AACxC,2CAAqD;AACrD,iCAAyC;AAEzC,+BAA+B;AAC/B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;AAExB,kBAAe;IACb,KAAK,EAAE,iBAAiB;IACxB,SAAS,EAAE,WAAI;IACf,QAAQ,EAAE,EAAE;CACb,CAAC;AAEF,MAAM,QAAQ,GAAG,CAAC,IAAoF,EAAE,EAAE;;IACxG,MAAM,KAAK,GAAG,IAAA,uBAAQ,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACtC,MAAM,CAAC,IAAI,CAAC,GAAG,MAAA,IAAA,2BAAY,EAAC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,iBAAS,EAAE,CAAC,CAAC,mCAAI,EAAE,CAAC;IAE/E,IAAA,4BAAc,EAAC,KAAK,IAAI,EAAE;QACxB,IAAI,IAAI,CAAC,EAAE,KAAK,CAAC,EAAE;YACjB,MAAM,CAAA,KAAK,aAAL,KAAK,u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GED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-list",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11",
|
|
4
4
|
"description": "A list editing experience component for DXOS.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -17,23 +17,23 @@
|
|
|
17
17
|
"lodash.throttle": "^4.1.1",
|
|
18
18
|
"react": "^18.2.0",
|
|
19
19
|
"react-dom": "^18.2.0",
|
|
20
|
-
"@dxos/client": "0.1.
|
|
21
|
-
"@dxos/config": "0.1.
|
|
22
|
-
"@dxos/object-model": "0.1.
|
|
23
|
-
"@dxos/react-appkit": "0.1.
|
|
24
|
-
"@dxos/react-async": "0.1.
|
|
25
|
-
"@dxos/react-client": "0.1.
|
|
26
|
-
"@dxos/react-ui": "0.1.
|
|
27
|
-
"@dxos/react-uikit": "0.1.
|
|
20
|
+
"@dxos/client": "0.1.11",
|
|
21
|
+
"@dxos/config": "0.1.11",
|
|
22
|
+
"@dxos/object-model": "0.1.11",
|
|
23
|
+
"@dxos/react-appkit": "0.1.11",
|
|
24
|
+
"@dxos/react-async": "0.1.11",
|
|
25
|
+
"@dxos/react-client": "0.1.11",
|
|
26
|
+
"@dxos/react-ui": "0.1.11",
|
|
27
|
+
"@dxos/react-uikit": "0.1.11"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/lodash.throttle": "^4.1.1",
|
|
31
31
|
"@types/react": "^18.0.21",
|
|
32
32
|
"@types/react-dom": "^18.0.6",
|
|
33
33
|
"phosphor-react": "^1.4.1",
|
|
34
|
-
"@dxos/async": "0.1.
|
|
35
|
-
"@dxos/debug": "0.1.
|
|
36
|
-
"@dxos/vite-plugin": "0.1.
|
|
34
|
+
"@dxos/async": "0.1.11",
|
|
35
|
+
"@dxos/debug": "0.1.11",
|
|
36
|
+
"@dxos/vite-plugin": "0.1.11"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"phosphor-react": "^1.4.1"
|
|
@@ -6,7 +6,8 @@ import '@dxosTheme';
|
|
|
6
6
|
import React, { useMemo, useState } from 'react';
|
|
7
7
|
|
|
8
8
|
import { Trigger } from '@dxos/async';
|
|
9
|
-
import { Client, Invitation, PublicKey
|
|
9
|
+
import { Client, Invitation, PublicKey } from '@dxos/client';
|
|
10
|
+
import { TestBuilder } from '@dxos/client/testing';
|
|
10
11
|
import { raise } from '@dxos/debug';
|
|
11
12
|
import { ObjectModel } from '@dxos/object-model';
|
|
12
13
|
import { useAsyncEffect } from '@dxos/react-async';
|
|
@@ -53,9 +54,10 @@ Default.decorators = [
|
|
|
53
54
|
(Story) => {
|
|
54
55
|
const n = 2;
|
|
55
56
|
const clients = useMemo(() => {
|
|
56
|
-
const testBuilder = new
|
|
57
|
+
const testBuilder = new TestBuilder();
|
|
57
58
|
return [...Array(n)].map(() => new Client({ services: testBuilder.createClientServicesHost() }));
|
|
58
59
|
}, []);
|
|
60
|
+
|
|
59
61
|
const [spaceKey, setSpaceKey] = useState<PublicKey>();
|
|
60
62
|
|
|
61
63
|
useAsyncEffect(async () => {
|
|
@@ -66,19 +68,17 @@ Default.decorators = [
|
|
|
66
68
|
log('identity created');
|
|
67
69
|
|
|
68
70
|
const space = await clients[0].echo.createSpace();
|
|
69
|
-
log('space created');
|
|
71
|
+
log('space created', { space: space.key });
|
|
70
72
|
|
|
71
73
|
await Promise.all(
|
|
72
74
|
clients.slice(1).map(async (client) => {
|
|
73
|
-
const success1 = new Trigger<Invitation>();
|
|
74
|
-
const success2 = new Trigger<Invitation>();
|
|
75
|
-
|
|
76
75
|
const observable1 = await space.createInvitation({ type: Invitation.Type.INTERACTIVE_TESTING });
|
|
77
76
|
log('invitation created');
|
|
78
77
|
|
|
79
78
|
const observable2 = await client.echo.acceptInvitation(observable1.invitation!);
|
|
80
79
|
log('invitation accepted');
|
|
81
80
|
|
|
81
|
+
const success1 = new Trigger<Invitation>();
|
|
82
82
|
observable1.subscribe({
|
|
83
83
|
onSuccess: (invitation) => {
|
|
84
84
|
success1.wake(invitation);
|
|
@@ -87,6 +87,7 @@ Default.decorators = [
|
|
|
87
87
|
onError: (err) => raise(err)
|
|
88
88
|
});
|
|
89
89
|
|
|
90
|
+
const success2 = new Trigger<Invitation>();
|
|
90
91
|
observable2.subscribe({
|
|
91
92
|
onSuccess: (invitation: Invitation) => {
|
|
92
93
|
success2.wake(invitation);
|