@dxos/react-list 0.1.13 → 0.1.16

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 (70) hide show
  1. package/dist/lib/browser/index.mjs +527 -0
  2. package/dist/lib/browser/index.mjs.map +7 -0
  3. package/dist/lib/browser/meta.json +1 -0
  4. package/dist/{src → types/src}/components/List/List.d.ts +0 -0
  5. package/dist/types/src/components/List/List.d.ts.map +1 -0
  6. package/dist/{src → types/src}/components/List/List.stories.d.ts +0 -0
  7. package/dist/types/src/components/List/List.stories.d.ts.map +1 -0
  8. package/dist/{src → types/src}/components/List/index.d.ts +0 -0
  9. package/dist/types/src/components/List/index.d.ts.map +1 -0
  10. package/dist/{src → types/src}/components/ListPrimitive/ListPrimitive.d.ts +4 -4
  11. package/dist/types/src/components/ListPrimitive/ListPrimitive.d.ts.map +1 -0
  12. package/dist/{src → types/src}/components/ListPrimitive/ListPrimitive.stories.d.ts +0 -0
  13. package/dist/types/src/components/ListPrimitive/ListPrimitive.stories.d.ts.map +1 -0
  14. package/dist/{src → types/src}/components/ListPrimitive/index.d.ts +0 -0
  15. package/dist/types/src/components/ListPrimitive/index.d.ts.map +1 -0
  16. package/dist/{src → types/src}/components/index.d.ts +0 -0
  17. package/dist/types/src/components/index.d.ts.map +1 -0
  18. package/dist/{src → types/src}/hooks/index.d.ts +0 -0
  19. package/dist/types/src/hooks/index.d.ts.map +1 -0
  20. package/dist/{src → types/src}/hooks/usePropStatefully.d.ts +0 -0
  21. package/dist/types/src/hooks/usePropStatefully.d.ts.map +1 -0
  22. package/dist/{src → types/src}/index.d.ts +0 -0
  23. package/dist/types/src/index.d.ts.map +1 -0
  24. package/dist/{src → types/src}/model.d.ts +0 -0
  25. package/dist/types/src/model.d.ts.map +1 -0
  26. package/dist/{src → types/src}/testing/index.d.ts +0 -0
  27. package/dist/types/src/testing/index.d.ts.map +1 -0
  28. package/dist/{src → types/src}/testing/templateForComponent.d.ts +0 -0
  29. package/dist/types/src/testing/templateForComponent.d.ts.map +1 -0
  30. package/package.json +13 -15
  31. package/src/components/ListPrimitive/ListPrimitive.tsx +33 -18
  32. package/dist/src/components/List/List.d.ts.map +0 -1
  33. package/dist/src/components/List/List.js +0 -99
  34. package/dist/src/components/List/List.js.map +0 -1
  35. package/dist/src/components/List/List.stories.d.ts.map +0 -1
  36. package/dist/src/components/List/List.stories.js +0 -117
  37. package/dist/src/components/List/List.stories.js.map +0 -1
  38. package/dist/src/components/List/index.d.ts.map +0 -1
  39. package/dist/src/components/List/index.js +0 -21
  40. package/dist/src/components/List/index.js.map +0 -1
  41. package/dist/src/components/ListPrimitive/ListPrimitive.d.ts.map +0 -1
  42. package/dist/src/components/ListPrimitive/ListPrimitive.js +0 -222
  43. package/dist/src/components/ListPrimitive/ListPrimitive.js.map +0 -1
  44. package/dist/src/components/ListPrimitive/ListPrimitive.stories.d.ts.map +0 -1
  45. package/dist/src/components/ListPrimitive/ListPrimitive.stories.js +0 -42
  46. package/dist/src/components/ListPrimitive/ListPrimitive.stories.js.map +0 -1
  47. package/dist/src/components/ListPrimitive/index.d.ts.map +0 -1
  48. package/dist/src/components/ListPrimitive/index.js +0 -21
  49. package/dist/src/components/ListPrimitive/index.js.map +0 -1
  50. package/dist/src/components/index.d.ts.map +0 -1
  51. package/dist/src/components/index.js +0 -21
  52. package/dist/src/components/index.js.map +0 -1
  53. package/dist/src/hooks/index.d.ts.map +0 -1
  54. package/dist/src/hooks/index.js +0 -21
  55. package/dist/src/hooks/index.js.map +0 -1
  56. package/dist/src/hooks/usePropStatefully.d.ts.map +0 -1
  57. package/dist/src/hooks/usePropStatefully.js +0 -30
  58. package/dist/src/hooks/usePropStatefully.js.map +0 -1
  59. package/dist/src/index.d.ts.map +0 -1
  60. package/dist/src/index.js +0 -22
  61. package/dist/src/index.js.map +0 -1
  62. package/dist/src/model.d.ts.map +0 -1
  63. package/dist/src/model.js +0 -9
  64. package/dist/src/model.js.map +0 -1
  65. package/dist/src/testing/index.d.ts.map +0 -1
  66. package/dist/src/testing/index.js +0 -21
  67. package/dist/src/testing/index.js.map +0 -1
  68. package/dist/src/testing/templateForComponent.d.ts.map +0 -1
  69. package/dist/src/testing/templateForComponent.js +0 -18
  70. package/dist/src/testing/templateForComponent.js.map +0 -1
@@ -0,0 +1,527 @@
1
+ // packages/apps/patterns/react-list/src/components/List/List.tsx
2
+ import React2, { useCallback as useCallback2 } from "react";
3
+ import { ObjectModel } from "@dxos/object-model";
4
+ import { useSelection, useSpace } from "@dxos/react-client";
5
+ import { Loading } from "@dxos/react-ui";
6
+ import { useTranslation as useTranslation2 } from "@dxos/react-uikit";
7
+
8
+ // packages/apps/patterns/react-list/src/model.ts
9
+ var LIST_TYPE = "dxos:type/list";
10
+ var LIST_ITEM_TYPE = "dxos:type/list-item";
11
+
12
+ // packages/apps/patterns/react-list/src/components/ListPrimitive/ListPrimitive.tsx
13
+ import debounce from "lodash.debounce";
14
+ import { Minus, Plus } from "phosphor-react";
15
+ import React, { useCallback, useMemo, useState as useState2 } from "react";
16
+ import { defaultFocus, Input, useTranslation, getSize, Button, randomString as randomString2, defaultGroup, defaultHover, mx } from "@dxos/react-uikit";
17
+
18
+ // packages/apps/patterns/react-list/src/hooks/usePropStatefully.ts
19
+ import { useEffect, useRef, useState } from "react";
20
+ import { randomString } from "@dxos/react-uikit";
21
+ var isEqual = (a, b) => a === b;
22
+ var usePropStatefully = (propsValue, equivalentPredicate) => {
23
+ const [value, setValue] = useState(propsValue);
24
+ const [valueSession, setValueSession] = useState(randomString());
25
+ const mounted = useRef(false);
26
+ const predicate = equivalentPredicate != null ? equivalentPredicate : isEqual;
27
+ useEffect(() => {
28
+ if (mounted.current && !predicate(propsValue, value)) {
29
+ setValue(propsValue);
30
+ setValueSession(randomString());
31
+ } else {
32
+ mounted.current = true;
33
+ }
34
+ }, [
35
+ propsValue
36
+ ]);
37
+ return [
38
+ value,
39
+ setValue,
40
+ valueSession
41
+ ];
42
+ };
43
+
44
+ // packages/apps/patterns/react-list/src/components/ListPrimitive/ListPrimitive.tsx
45
+ function _extends() {
46
+ _extends = Object.assign || function(target) {
47
+ for (var i = 1; i < arguments.length; i++) {
48
+ var source = arguments[i];
49
+ for (var key in source) {
50
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
51
+ target[key] = source[key];
52
+ }
53
+ }
54
+ }
55
+ return target;
56
+ };
57
+ return _extends.apply(this, arguments);
58
+ }
59
+ var isListItemChangedAction = (o) => "listItemId" in o;
60
+ var isListItemCreatedAction = (o) => "created" in o;
61
+ var isListItemDeletedAction = (o) => "deleted" in o;
62
+ var defaultCreateListItemId = async () => randomString2(8);
63
+ var ListItemPrimitive = ({ id, title: propsTitle, description: propsDescription, annotations: propsAnnotations, updateItem, deleteItem, createItem, updateOrder, orderIndex, isLast, autoFocus }) => {
64
+ const checkId = `${id}__checkbox`;
65
+ const labelId = `${id}__title`;
66
+ const descriptionId = `${id}__description`;
67
+ const { t } = useTranslation("appkit");
68
+ const rejectTextUpdatesWhenFocused = useCallback((a, b) => {
69
+ var _a;
70
+ return ((_a = document.activeElement) == null ? void 0 : _a.getAttribute("data-itemid")) === id ? true : a === b;
71
+ }, [
72
+ id
73
+ ]);
74
+ const [title, setTitle, titleSession] = usePropStatefully(propsTitle != null ? propsTitle : "", rejectTextUpdatesWhenFocused);
75
+ const [description, _setDescription, _descriptionSession] = usePropStatefully(propsDescription != null ? propsDescription : "", rejectTextUpdatesWhenFocused);
76
+ const [annotations, setAnnotations] = useState2(propsAnnotations != null ? propsAnnotations : {});
77
+ const isDone = (annotations == null ? void 0 : annotations.state) === "done";
78
+ const onChangeTitle = useCallback((nextValue) => {
79
+ setTitle(nextValue);
80
+ updateItem({
81
+ id,
82
+ title: nextValue
83
+ });
84
+ }, []);
85
+ const _onChangeDescription = useCallback((nextValue) => {
86
+ _setDescription(nextValue);
87
+ updateItem({
88
+ id,
89
+ description: nextValue
90
+ });
91
+ }, []);
92
+ const _onClickMoveUp = useCallback(() => {
93
+ updateOrder(id, -1);
94
+ }, [
95
+ updateOrder,
96
+ id
97
+ ]);
98
+ const _onClickMoveDown = useCallback(() => {
99
+ updateOrder(id, 1);
100
+ }, [
101
+ updateOrder,
102
+ id
103
+ ]);
104
+ const onChangeCheckbox = useCallback(() => {
105
+ const nextAnnotations = {
106
+ ...annotations,
107
+ state: isDone ? "init" : "done"
108
+ };
109
+ setAnnotations(nextAnnotations);
110
+ updateItem({
111
+ id,
112
+ annotations: nextAnnotations
113
+ });
114
+ }, [
115
+ annotations,
116
+ isDone
117
+ ]);
118
+ const onClickDelete = useCallback(() => {
119
+ deleteItem(id);
120
+ }, [
121
+ deleteItem,
122
+ id
123
+ ]);
124
+ const onKeyUp = useCallback((e) => {
125
+ var _a, _b, _c;
126
+ switch (e.key) {
127
+ case "Enter":
128
+ if (!e.shiftKey) {
129
+ if (isLast) {
130
+ createItem();
131
+ } else {
132
+ (_a = document.querySelector(`input[data-orderindex="${orderIndex + 1}"]`)) == null ? void 0 : _a.focus();
133
+ }
134
+ }
135
+ break;
136
+ case "PageDown":
137
+ (_b = document.querySelector(`input[data-orderindex="${orderIndex + 1}"]`)) == null ? void 0 : _b.focus();
138
+ break;
139
+ case "PageUp":
140
+ (_c = document.querySelector(`input[data-orderindex="${orderIndex - 1}"]`)) == null ? void 0 : _c.focus();
141
+ break;
142
+ }
143
+ }, [
144
+ orderIndex,
145
+ isLast
146
+ ]);
147
+ const inputSlots = useMemo(() => ({
148
+ root: {
149
+ className: "m-0"
150
+ },
151
+ input: {
152
+ className: "border-0 rounded",
153
+ autoFocus: true,
154
+ "data-orderindex": orderIndex,
155
+ "data-itemid": id,
156
+ onKeyUp
157
+ }
158
+ }), [
159
+ orderIndex,
160
+ id,
161
+ onKeyUp
162
+ ]);
163
+ return /* @__PURE__ */ React.createElement("li", _extends({
164
+ key: id,
165
+ className: "flex items-center gap-2 pli-4 mbe-2",
166
+ "aria-labelledby": labelId
167
+ }, description && {
168
+ "aria-describedby": descriptionId
169
+ }), /* @__PURE__ */ React.createElement("input", _extends({}, {
170
+ type: "checkbox",
171
+ id: checkId,
172
+ ...description && {
173
+ "aria-describedby": descriptionId
174
+ },
175
+ className: mx(getSize(5), "text-primary-600 bg-neutral-50 rounded-full border-neutral-300 dark:bg-neutral-800 dark:border-neutral-600 cursor-pointer", defaultFocus, defaultHover({})),
176
+ onChange: onChangeCheckbox,
177
+ checked: isDone
178
+ })), /* @__PURE__ */ React.createElement("label", {
179
+ htmlFor: checkId,
180
+ id: labelId,
181
+ className: "sr-only"
182
+ }, title), /* @__PURE__ */ React.createElement("span", {
183
+ id: descriptionId,
184
+ className: "sr-only"
185
+ }, description), /* @__PURE__ */ React.createElement("div", {
186
+ role: "none",
187
+ className: "grow"
188
+ }, /* @__PURE__ */ React.createElement(Input, {
189
+ key: titleSession,
190
+ label: t("list item title label"),
191
+ placeholder: t("list item title placeholder"),
192
+ labelVisuallyHidden: true,
193
+ initialValue: title,
194
+ onChange: onChangeTitle,
195
+ slots: inputSlots
196
+ })), /* @__PURE__ */ React.createElement(Button, {
197
+ onClick: onClickDelete,
198
+ variant: "ghost",
199
+ className: "p-1 self-stretch"
200
+ }, /* @__PURE__ */ React.createElement(Minus, {
201
+ className: getSize(4)
202
+ }), /* @__PURE__ */ React.createElement("span", {
203
+ className: "sr-only"
204
+ }, t("delete list item label"))));
205
+ };
206
+ var itemsEquivalent = (a, b) => {
207
+ var _a, _b;
208
+ const aKeys = Object.keys(a);
209
+ const bKeys = Object.keys(b);
210
+ for (let i = 0; i < aKeys.length; i++) {
211
+ const key = aKeys[i];
212
+ if (key !== bKeys[i] || a[key].title !== b[key].title || ((_a = a[key].annotations) == null ? void 0 : _a.state) !== ((_b = b[key].annotations) == null ? void 0 : _b.state)) {
213
+ return false;
214
+ }
215
+ }
216
+ return true;
217
+ };
218
+ var ListPrimitive = ({ id: listId, title: propsTitle, description: propsDescription, items: propsItems, onAction, createListItemId = defaultCreateListItemId, onChangePeriod = 0, ...divProps }) => {
219
+ const { t } = useTranslation("appkit");
220
+ const [creating, setCreating] = useState2(false);
221
+ const [autoFocus, setAutofocus] = useState2(null);
222
+ const rejectTextUpdatesWhenFocused = useCallback((a, b) => {
223
+ var _a;
224
+ return ((_a = document.activeElement) == null ? void 0 : _a.getAttribute("data-itemid")) === listId ? true : a === b;
225
+ }, [
226
+ listId
227
+ ]);
228
+ const titleId = `${listId}__title`;
229
+ const [title, setTitle, titleSession] = usePropStatefully(propsTitle != null ? propsTitle : "", rejectTextUpdatesWhenFocused);
230
+ const propagateTitle = useCallback((nextValue) => {
231
+ return onAction == null ? void 0 : onAction({
232
+ listId,
233
+ next: {
234
+ title: nextValue
235
+ }
236
+ });
237
+ }, [
238
+ onAction
239
+ ]);
240
+ const debouncedPropagateTitle = useMemo(() => debounce(propagateTitle, onChangePeriod), [
241
+ propagateTitle
242
+ ]);
243
+ const onChangeTitle = useCallback((nextValue) => {
244
+ setTitle(nextValue);
245
+ debouncedPropagateTitle(nextValue);
246
+ }, [
247
+ onAction,
248
+ listId
249
+ ]);
250
+ const descriptionId = `${listId}__description`;
251
+ const [description, setDescription, _descriptionSession] = usePropStatefully(propsDescription != null ? propsDescription : "", rejectTextUpdatesWhenFocused);
252
+ const propagateDescription = useCallback((nextValue) => onAction == null ? void 0 : onAction({
253
+ listId,
254
+ next: {
255
+ description: nextValue
256
+ }
257
+ }), [
258
+ onAction
259
+ ]);
260
+ const debouncedPropagateDescription = useMemo(() => debounce(propagateDescription, onChangePeriod), [
261
+ propagateDescription
262
+ ]);
263
+ const _onChangeDescription = useCallback((nextValue) => {
264
+ setDescription(nextValue);
265
+ debouncedPropagateDescription(nextValue);
266
+ }, [
267
+ onAction,
268
+ listId
269
+ ]);
270
+ const [items, setItems, itemsSession] = usePropStatefully(propsItems != null ? propsItems : {}, itemsEquivalent);
271
+ const order = Object.keys(items);
272
+ const propagateItem = useCallback(({ id, ...next }) => {
273
+ return onAction == null ? void 0 : onAction({
274
+ listId,
275
+ listItemId: id,
276
+ next
277
+ });
278
+ }, [
279
+ listId,
280
+ onAction
281
+ ]);
282
+ const debouncedPropagateItem = useMemo(() => debounce(propagateItem, onChangePeriod), [
283
+ propagateItem
284
+ ]);
285
+ const updateItem = useCallback(({ id, ...next }) => {
286
+ setItems(Object.assign(items, {
287
+ [id]: {
288
+ ...items[id],
289
+ ...next
290
+ }
291
+ }));
292
+ "title" in next && debouncedPropagateItem({
293
+ id,
294
+ title: next.title
295
+ });
296
+ "description" in next && debouncedPropagateItem({
297
+ id,
298
+ description: next.description
299
+ });
300
+ "annotations" in next && (onAction == null ? void 0 : onAction({
301
+ listId,
302
+ listItemId: id,
303
+ next: {
304
+ annotations: next.annotations
305
+ }
306
+ }));
307
+ }, [
308
+ items,
309
+ listId,
310
+ onAction
311
+ ]);
312
+ const updateOrder = useCallback((id, delta) => {
313
+ const fromIndex = order.indexOf(id);
314
+ const toIndex = fromIndex + delta;
315
+ const nextOrder = Array.from(order);
316
+ nextOrder.splice(fromIndex, 1);
317
+ nextOrder.splice(toIndex, 0, id);
318
+ const nextItems = nextOrder.reduce((acc, listItemId) => {
319
+ acc[listItemId] = items[listItemId];
320
+ return acc;
321
+ }, {});
322
+ setItems(nextItems);
323
+ onAction == null ? void 0 : onAction({
324
+ listId,
325
+ next: {}
326
+ });
327
+ }, [
328
+ items,
329
+ onAction
330
+ ]);
331
+ const deleteItem = useCallback((id) => {
332
+ if (items[id]) {
333
+ const { [id]: deletedItem, ...nextItems } = items;
334
+ setItems(nextItems);
335
+ onAction == null ? void 0 : onAction({
336
+ listId,
337
+ next: {},
338
+ deleted: {
339
+ id,
340
+ ...deletedItem
341
+ }
342
+ });
343
+ }
344
+ }, [
345
+ items,
346
+ onAction
347
+ ]);
348
+ const createItem = useCallback(() => {
349
+ setCreating(true);
350
+ return createListItemId().then((id) => {
351
+ const next = {
352
+ items: {
353
+ ...items,
354
+ [id]: {}
355
+ }
356
+ };
357
+ const created = {
358
+ id
359
+ };
360
+ setItems(next.items);
361
+ setAutofocus(id);
362
+ onAction == null ? void 0 : onAction({
363
+ listId,
364
+ next: {},
365
+ created
366
+ });
367
+ }).finally(() => setCreating(false));
368
+ }, [
369
+ items,
370
+ createListItemId,
371
+ onAction
372
+ ]);
373
+ const inputSlots = useMemo(() => ({
374
+ root: {
375
+ className: "mli-2 mbs-0 mbe-2"
376
+ },
377
+ input: {
378
+ className: "border-0 rounded text-xl font-display font-semibold",
379
+ "data-itemid": listId
380
+ }
381
+ }), [
382
+ listId
383
+ ]);
384
+ return /* @__PURE__ */ React.createElement("div", _extends({
385
+ role: "group"
386
+ }, divProps, {
387
+ className: mx(defaultGroup({
388
+ elevation: 3,
389
+ spacing: "pbs-2 pbe-1"
390
+ }), divProps.className),
391
+ "aria-labelledby": titleId
392
+ }, description && {
393
+ "aria-describedby": descriptionId
394
+ }), /* @__PURE__ */ React.createElement("span", {
395
+ id: titleId,
396
+ className: "sr-only"
397
+ }, title), description && /* @__PURE__ */ React.createElement("span", {
398
+ id: descriptionId,
399
+ className: "sr-only"
400
+ }, description), /* @__PURE__ */ React.createElement(Input, {
401
+ key: titleSession,
402
+ label: t("list title label"),
403
+ placeholder: t("list title placeholder"),
404
+ labelVisuallyHidden: true,
405
+ initialValue: title,
406
+ onChange: onChangeTitle,
407
+ slots: inputSlots
408
+ }), /* @__PURE__ */ React.createElement("ol", {
409
+ className: "contents"
410
+ }, order.map((listItemId, index) => {
411
+ return /* @__PURE__ */ React.createElement(ListItemPrimitive, _extends({
412
+ key: `${itemsSession}__${listItemId}`,
413
+ orderIndex: index,
414
+ isLast: index === order.length - 1
415
+ }, {
416
+ id: listItemId,
417
+ updateItem,
418
+ updateOrder,
419
+ deleteItem,
420
+ createItem
421
+ }, items[listItemId], {
422
+ autoFocus: listItemId === autoFocus
423
+ }));
424
+ })), /* @__PURE__ */ React.createElement("div", {
425
+ role: "none",
426
+ className: "mli-4 mlb-4"
427
+ }, /* @__PURE__ */ React.createElement(Button, {
428
+ className: "is-full",
429
+ onClick: createItem,
430
+ disabled: creating
431
+ }, /* @__PURE__ */ React.createElement(Plus, {
432
+ className: getSize(5)
433
+ }), /* @__PURE__ */ React.createElement("span", {
434
+ className: "sr-only"
435
+ }, t("add list item label")))));
436
+ };
437
+
438
+ // packages/apps/patterns/react-list/src/components/List/List.tsx
439
+ function _extends2() {
440
+ _extends2 = Object.assign || function(target) {
441
+ for (var i = 1; i < arguments.length; i++) {
442
+ var source = arguments[i];
443
+ for (var key in source) {
444
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
445
+ target[key] = source[key];
446
+ }
447
+ }
448
+ }
449
+ return target;
450
+ };
451
+ return _extends2.apply(this, arguments);
452
+ }
453
+ var ListLoaded = ({ space, list, listItems: propsListItems }) => {
454
+ var _a, _b, _c;
455
+ const listItems = (_a = useSelection(list == null ? void 0 : list.select().children().filter({
456
+ type: LIST_ITEM_TYPE
457
+ }))) != null ? _a : propsListItems;
458
+ const onAction = useCallback2(async (action) => {
459
+ if (isListItemDeletedAction(action)) {
460
+ const subject = space.database.getItem(action.deleted.id);
461
+ return subject == null ? void 0 : subject.model.set("annotations.deleted", true);
462
+ } else if (isListItemCreatedAction(action)) {
463
+ } else if (isListItemChangedAction(action)) {
464
+ const subject1 = space.database.getItem(action.listItemId);
465
+ return Promise.all(Object.keys(action.next).map((prop) => {
466
+ return subject1 == null ? void 0 : subject1.model.set(prop, action.next[prop]);
467
+ }));
468
+ } else {
469
+ return Promise.all(Object.keys(action.next).map((prop) => {
470
+ return list == null ? void 0 : list.model.set(prop, action.next[prop]);
471
+ }));
472
+ }
473
+ }, [
474
+ list,
475
+ listItems
476
+ ]);
477
+ const createListItemId = useCallback2(async () => {
478
+ const listItem = await (space == null ? void 0 : space.database.createItem({
479
+ model: ObjectModel,
480
+ type: LIST_ITEM_TYPE,
481
+ parent: list.id
482
+ }));
483
+ return listItem.id;
484
+ }, [
485
+ space
486
+ ]);
487
+ return /* @__PURE__ */ React2.createElement(ListPrimitive, _extends2({}, {
488
+ id: list.id,
489
+ title: (_b = list.model.get("title")) != null ? _b : "",
490
+ description: (_c = list.model.get("description")) != null ? _c : "",
491
+ items: (listItems != null ? listItems : []).filter((item) => !item.model.get("annotations.deleted")).reduce((acc, item) => {
492
+ acc[item.id] = {
493
+ title: item.model.get("title"),
494
+ description: item.model.get("description"),
495
+ annotations: item.model.get("annotations")
496
+ };
497
+ return acc;
498
+ }, {}),
499
+ onChangePeriod: 640,
500
+ onAction,
501
+ createListItemId
502
+ }));
503
+ };
504
+ var List = ({ spaceKey, itemId }) => {
505
+ var _a;
506
+ const { t } = useTranslation2("uikit");
507
+ const space = useSpace(spaceKey);
508
+ const list = ((_a = useSelection(space == null ? void 0 : space.database.select({
509
+ id: itemId
510
+ }))) != null ? _a : [])[0];
511
+ const listItems = useSelection(list == null ? void 0 : list.select().children().filter({
512
+ type: LIST_ITEM_TYPE
513
+ }));
514
+ return space && list && listItems ? /* @__PURE__ */ React2.createElement(ListLoaded, _extends2({}, {
515
+ space,
516
+ list,
517
+ listItems
518
+ })) : /* @__PURE__ */ React2.createElement(Loading, {
519
+ label: t("generic loading label")
520
+ });
521
+ };
522
+ export {
523
+ LIST_ITEM_TYPE,
524
+ LIST_TYPE,
525
+ List
526
+ };
527
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/List/home/runner/work/dxos/dxos/packages/apps/patterns/react-list/src/components/List/List.tsx", "../../../src/home/runner/work/dxos/dxos/packages/apps/patterns/react-list/src/model.ts", "../../../src/components/ListPrimitive/home/runner/work/dxos/dxos/packages/apps/patterns/react-list/src/components/ListPrimitive/ListPrimitive.tsx", "../../../src/hooks/home/runner/work/dxos/dxos/packages/apps/patterns/react-list/src/hooks/usePropStatefully.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2022 DXOS.org\n//\n\nimport React, { useCallback } from 'react';\n\nimport { Item, PublicKey, Space } from '@dxos/client';\nimport { ObjectModel } from '@dxos/object-model';\nimport { useSelection, useSpace } from '@dxos/react-client';\nimport { Loading } from '@dxos/react-ui';\nimport { useTranslation } from '@dxos/react-uikit';\n\nimport { LIST_ITEM_TYPE } from '../../model';\nimport {\n ListPrimitive,\n ListAction,\n ListItems,\n isListItemChangedAction,\n isListItemDeletedAction,\n isListItemCreatedAction,\n ListItemProps,\n ListPrimitiveProps\n} from '../ListPrimitive';\n\ninterface ListLoadedProps {\n space: Space;\n list: Item<ObjectModel>;\n listItems: Item<ObjectModel>[];\n}\n\nexport interface ListProps {\n spaceKey: PublicKey;\n itemId: Item<ObjectModel>['id'];\n}\n\nconst ListLoaded = ({ space, list, listItems: propsListItems }: ListLoadedProps) => {\n const listItems = useSelection(list?.select().children().filter({ type: LIST_ITEM_TYPE })) ?? propsListItems;\n\n const onAction = useCallback(\n async (action: ListAction) => {\n if (isListItemDeletedAction(action)) {\n const subject = space.database.getItem(action.deleted.id);\n // TODO(thure): use Echo’s native deletion\n return subject?.model.set('annotations.deleted', true);\n } else if (isListItemCreatedAction(action)) {\n // do nothing?\n } else if (isListItemChangedAction(action)) {\n const subject = space.database.getItem(action.listItemId);\n return Promise.all(\n (Object.keys(action.next) as (keyof ListItemProps)[]).map((prop) => {\n return subject?.model.set(prop, action.next[prop]);\n })\n );\n } else {\n return Promise.all(\n (Object.keys(action.next) as (keyof ListPrimitiveProps)[]).map((prop) => {\n return list?.model.set(prop, action.next[prop]);\n })\n );\n }\n },\n [list, listItems]\n );\n\n const createListItemId = useCallback(async () => {\n const listItem = await space?.database.createItem({\n model: ObjectModel,\n type: LIST_ITEM_TYPE,\n parent: list.id\n });\n return listItem.id;\n }, [space]);\n\n return (\n <ListPrimitive\n {...{\n id: list.id,\n title: list.model.get('title') ?? '',\n description: list.model.get('description') ?? '',\n items: (listItems ?? [])\n // TODO(thure): use Echo’s native deletion\n .filter((item) => !item.model.get('annotations.deleted'))\n .reduce((acc: ListItems, item) => {\n acc[item.id] = {\n title: item.model.get('title'),\n description: item.model.get('description'),\n annotations: item.model.get('annotations')\n };\n return acc;\n }, {}),\n onChangePeriod: 640,\n onAction,\n createListItemId\n }}\n />\n );\n};\n\nexport const List = ({ spaceKey, itemId }: ListProps) => {\n const { t } = useTranslation('uikit');\n\n const space = useSpace(spaceKey);\n const list = (useSelection(space?.database.select({ id: itemId })) ?? [])[0];\n const listItems = useSelection(list?.select().children().filter({ type: LIST_ITEM_TYPE }));\n\n // TODO(thure): this should become `Suspense` when the above hooks support it\n return space && list && listItems ? (\n <ListLoaded {...{ space, list, listItems }} />\n ) : (\n <Loading label={t('generic loading label')} />\n );\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nexport const LIST_TYPE = 'dxos:type/list';\nexport const LIST_ITEM_TYPE = 'dxos:type/list-item';\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport debounce from 'lodash.debounce';\nimport { Minus, Plus } from 'phosphor-react';\nimport React, { ComponentProps, useCallback, useMemo, useState, KeyboardEvent } from 'react';\n\nimport {\n defaultFocus,\n Input,\n useTranslation,\n getSize,\n Button,\n randomString,\n defaultGroup,\n defaultHover,\n mx\n} from '@dxos/react-uikit';\n\nimport { usePropStatefully } from '../../hooks';\n\ntype ListId = string;\ntype ListItemId = string;\n\nexport interface ListItemProps {\n id: ListItemId;\n title?: string;\n description?: string;\n annotations?: Record<string, string | boolean>;\n}\n\nexport type ListItems = Record<ListItemId, Omit<ListItemProps, 'id'>>;\n\ninterface SharedListActionProps {\n listId: ListId;\n}\n\ninterface SharedListItemActionProps extends SharedListActionProps {\n listItemId: ListItemId;\n}\n\nexport interface ListItemChangedAction extends SharedListItemActionProps {\n next: Partial<ListItemProps>;\n}\n\nexport interface ListChangedAction extends SharedListActionProps {\n next: Partial<ListPrimitiveProps>;\n}\n\nexport interface ListItemCreatedAction extends SharedListActionProps {\n created: Pick<ListItemProps, 'id'> & Partial<Omit<ListItemProps, 'id'>>;\n}\n\nexport interface ListItemDeletedAction extends SharedListActionProps {\n deleted: Pick<ListItemProps, 'id'> & Partial<Omit<ListItemProps, 'id'>>;\n}\n\nexport type ListAction = ListItemChangedAction | ListChangedAction | ListItemCreatedAction | ListItemDeletedAction;\n\nexport const isListItemChangedAction = (o: any): o is ListItemChangedAction => 'listItemId' in o;\nexport const isListItemCreatedAction = (o: any): o is ListItemCreatedAction => 'created' in o;\nexport const isListItemDeletedAction = (o: any): o is ListItemDeletedAction => 'deleted' in o;\n\nexport interface ListPrimitiveProps {\n id: ListId;\n title?: string;\n description?: string;\n}\n\nexport interface ListPrimitiveComponentProps extends ListPrimitiveProps, Omit<ComponentProps<'div'>, 'id'> {\n items: ListItems;\n onAction?: (action: ListAction) => void;\n createListItemId?: () => Promise<ListItemId>;\n onChangePeriod?: number;\n}\n\nexport interface ListItemPrimitiveComponentProps extends ListItemProps, Omit<ComponentProps<'li'>, 'id' | 'title'> {\n updateItem: (item: ListItemProps) => void;\n updateOrder: (id: ListItemId, delta: number) => void;\n deleteItem: (id: ListItemId) => void;\n createItem: () => void;\n orderIndex: number;\n isLast?: boolean;\n autoFocus?: boolean;\n}\n\nconst defaultCreateListItemId = async () => randomString(8);\n\nconst ListItemPrimitive = ({\n id,\n title: propsTitle,\n description: propsDescription,\n annotations: propsAnnotations,\n updateItem,\n deleteItem,\n createItem,\n updateOrder,\n orderIndex,\n isLast,\n autoFocus\n}: ListItemPrimitiveComponentProps) => {\n const checkId = `${id}__checkbox`;\n const labelId = `${id}__title`;\n const descriptionId = `${id}__description`;\n\n const { t } = useTranslation('appkit');\n\n const rejectTextUpdatesWhenFocused = useCallback(\n (a: string, b: string) => {\n return document.activeElement?.getAttribute('data-itemid') === id ? true : a === b;\n },\n [id]\n );\n\n const [title, setTitle, titleSession] = usePropStatefully<string>(propsTitle ?? '', rejectTextUpdatesWhenFocused);\n\n const [description, _setDescription, _descriptionSession] = usePropStatefully<string>(\n propsDescription ?? '',\n rejectTextUpdatesWhenFocused\n );\n\n const [annotations, setAnnotations] = useState(propsAnnotations ?? {});\n const isDone = annotations?.state === 'done';\n\n const onChangeTitle = useCallback((nextValue: string) => {\n setTitle(nextValue);\n updateItem({ id, title: nextValue });\n }, []);\n\n const _onChangeDescription = useCallback((nextValue: string) => {\n _setDescription(nextValue);\n updateItem({ id, description: nextValue });\n }, []);\n\n const _onClickMoveUp = useCallback(() => {\n updateOrder(id, -1);\n }, [updateOrder, id]);\n const _onClickMoveDown = useCallback(() => {\n updateOrder(id, 1);\n }, [updateOrder, id]);\n\n const onChangeCheckbox = useCallback(() => {\n const nextAnnotations = { ...annotations, state: isDone ? 'init' : 'done' };\n setAnnotations(nextAnnotations);\n updateItem({ id, annotations: nextAnnotations });\n }, [annotations, isDone]);\n\n const onClickDelete = useCallback(() => {\n deleteItem(id);\n }, [deleteItem, id]);\n\n const onKeyUp = useCallback(\n (e: KeyboardEvent<HTMLInputElement>) => {\n switch (e.key) {\n case 'Enter':\n if (!e.shiftKey) {\n if (isLast) {\n createItem();\n } else {\n (\n document.querySelector(`input[data-orderindex=\"${orderIndex + 1}\"]`) as HTMLElement | undefined\n )?.focus();\n }\n }\n break;\n case 'PageDown':\n (document.querySelector(`input[data-orderindex=\"${orderIndex + 1}\"]`) as HTMLElement | undefined)?.focus();\n break;\n case 'PageUp':\n (document.querySelector(`input[data-orderindex=\"${orderIndex - 1}\"]`) as HTMLElement | undefined)?.focus();\n break;\n }\n },\n [orderIndex, isLast]\n );\n\n const inputSlots = useMemo(\n () => ({\n root: { className: 'm-0' },\n input: {\n className: 'border-0 rounded',\n autoFocus: true,\n 'data-orderindex': orderIndex,\n 'data-itemid': id,\n onKeyUp\n }\n }),\n [orderIndex, id, onKeyUp]\n );\n\n return (\n <li\n key={id}\n className='flex items-center gap-2 pli-4 mbe-2'\n aria-labelledby={labelId}\n {...(description && { 'aria-describedby': descriptionId })}\n >\n <input\n {...{\n type: 'checkbox',\n id: checkId,\n ...(description && {\n 'aria-describedby': descriptionId\n }),\n className: mx(\n getSize(5),\n 'text-primary-600 bg-neutral-50 rounded-full border-neutral-300 dark:bg-neutral-800 dark:border-neutral-600 cursor-pointer',\n defaultFocus,\n defaultHover({})\n ),\n onChange: onChangeCheckbox,\n checked: isDone\n }}\n />\n <label htmlFor={checkId} id={labelId} className='sr-only'>\n {title}\n </label>\n <span id={descriptionId} className='sr-only'>\n {description}\n </span>\n <div role='none' className='grow'>\n <Input\n key={titleSession}\n label={t('list item title label')}\n placeholder={t('list item title placeholder')}\n labelVisuallyHidden\n initialValue={title}\n onChange={onChangeTitle}\n slots={inputSlots}\n />\n {/* TODO(thure): Re-enable this when descriptions become relevant */}\n {/* <Input */}\n {/* key={descriptionSession} */}\n {/* label={t('list item description label')} */}\n {/* placeholder={t('list item description placeholder')} */}\n {/* labelVisuallyHidden */}\n {/* initialValue={description} */}\n {/* onChange={onChangeDescription} */}\n {/* data-itemid={id} */}\n {/* /> */}\n </div>\n {/* TODO(thure): Restore these, or implement drag & drop, when how best to change order in Echo is clarified. */}\n {/* <ButtonGroup className='flex flex-col items-stretch'> */}\n {/* <Button compact rounding='rounded-bs-md border-be-0' disabled={isFirst} onClick={onClickMoveUp}> */}\n {/* <CaretUp /> */}\n {/* <span className='sr-only'>{t('move list item up label')}</span> */}\n {/* </Button> */}\n {/* <Button compact rounding='rounded-be-md' disabled={isLast} onClick={onClickMoveDown}> */}\n {/* <CaretDown /> */}\n {/* <span className='sr-only'>{t('move list item down label')}</span> */}\n {/* </Button> */}\n {/* </ButtonGroup> */}\n <Button onClick={onClickDelete} variant='ghost' className='p-1 self-stretch'>\n <Minus className={getSize(4)} />\n <span className='sr-only'>{t('delete list item label')}</span>\n </Button>\n </li>\n );\n};\n\nconst itemsEquivalent = (a: ListItems, b: ListItems) => {\n const aKeys = Object.keys(a);\n const bKeys = Object.keys(b);\n for (let i = 0; i < aKeys.length; i++) {\n const key = aKeys[i];\n if (key !== bKeys[i] || a[key].title !== b[key].title || a[key].annotations?.state !== b[key].annotations?.state) {\n return false;\n }\n }\n return true;\n};\n\nexport const ListPrimitive = ({\n id: listId,\n title: propsTitle,\n description: propsDescription,\n items: propsItems,\n onAction,\n createListItemId = defaultCreateListItemId,\n onChangePeriod = 0,\n ...divProps\n}: ListPrimitiveComponentProps) => {\n const { t } = useTranslation('appkit');\n\n const [creating, setCreating] = useState(false);\n const [autoFocus, setAutofocus] = useState<string | null>(null);\n\n const rejectTextUpdatesWhenFocused = useCallback(\n (a: string, b: string) => {\n return document.activeElement?.getAttribute('data-itemid') === listId ? true : a === b;\n },\n [listId]\n );\n\n // Title\n\n const titleId = `${listId}__title`;\n const [title, setTitle, titleSession] = usePropStatefully(propsTitle ?? '', rejectTextUpdatesWhenFocused);\n const propagateTitle = useCallback(\n (nextValue: string) => {\n return onAction?.({ listId, next: { title: nextValue } });\n },\n [onAction]\n );\n const debouncedPropagateTitle = useMemo(() => debounce(propagateTitle, onChangePeriod), [propagateTitle]);\n const onChangeTitle = useCallback(\n (nextValue: string) => {\n setTitle(nextValue);\n debouncedPropagateTitle(nextValue);\n },\n [onAction, listId]\n );\n\n // Description\n\n const descriptionId = `${listId}__description`;\n const [description, setDescription, _descriptionSession] = usePropStatefully(\n propsDescription ?? '',\n rejectTextUpdatesWhenFocused\n );\n const propagateDescription = useCallback(\n (nextValue: string) => onAction?.({ listId, next: { description: nextValue } }),\n [onAction]\n );\n const debouncedPropagateDescription = useMemo(\n () => debounce(propagateDescription, onChangePeriod),\n [propagateDescription]\n );\n const _onChangeDescription = useCallback(\n (nextValue: string) => {\n setDescription(nextValue);\n debouncedPropagateDescription(nextValue);\n },\n [onAction, listId]\n );\n\n // Items & order\n\n const [items, setItems, itemsSession] = usePropStatefully(propsItems ?? {}, itemsEquivalent);\n const order = Object.keys(items);\n\n const propagateItem = useCallback(\n ({ id, ...next }: Pick<ListItemProps, 'id'> & Partial<Omit<ListItemProps, 'id'>>) => {\n return onAction?.({ listId, listItemId: id, next });\n },\n [listId, onAction]\n );\n const debouncedPropagateItem = useMemo(() => debounce(propagateItem, onChangePeriod), [propagateItem]);\n const updateItem = useCallback(\n ({ id, ...next }: Pick<ListItemProps, 'id'> & Partial<Omit<ListItemProps, 'id'>>) => {\n setItems(Object.assign(items, { [id]: { ...items[id], ...next } }));\n 'title' in next && debouncedPropagateItem({ id, title: next.title });\n 'description' in next && debouncedPropagateItem({ id, description: next.description });\n 'annotations' in next && onAction?.({ listId, listItemId: id, next: { annotations: next.annotations } });\n },\n [items, listId, onAction]\n );\n\n const updateOrder = useCallback(\n (id: ListItemId, delta: number) => {\n const fromIndex = order.indexOf(id);\n const toIndex = fromIndex + delta;\n const nextOrder = Array.from(order);\n nextOrder.splice(fromIndex, 1);\n nextOrder.splice(toIndex, 0, id);\n const nextItems = nextOrder.reduce((acc: ListItems, listItemId) => {\n acc[listItemId] = items[listItemId];\n return acc;\n }, {});\n setItems(nextItems);\n onAction?.({ listId, next: {} });\n },\n [items, onAction]\n );\n\n const deleteItem = useCallback(\n (id: ListItemId) => {\n if (items[id]) {\n const { [id]: deletedItem, ...nextItems } = items;\n setItems(nextItems);\n onAction?.({ listId, next: {}, deleted: { id, ...deletedItem } });\n }\n },\n [items, onAction]\n );\n\n const createItem = useCallback(() => {\n setCreating(true);\n return createListItemId()\n .then((id) => {\n const next = {\n items: { ...items, [id]: {} }\n };\n const created = { id };\n setItems(next.items);\n setAutofocus(id);\n onAction?.({ listId, next: {}, created });\n })\n .finally(() => setCreating(false));\n }, [items, createListItemId, onAction]);\n\n // Render\n\n const inputSlots = useMemo(\n () => ({\n root: { className: 'mli-2 mbs-0 mbe-2' },\n input: {\n className: 'border-0 rounded text-xl font-display font-semibold',\n 'data-itemid': listId\n }\n }),\n [listId]\n );\n\n return (\n <div\n role='group'\n {...divProps}\n className={mx(defaultGroup({ elevation: 3, spacing: 'pbs-2 pbe-1' }), divProps.className)}\n aria-labelledby={titleId}\n {...(description && { 'aria-describedby': descriptionId })}\n >\n <span id={titleId} className='sr-only'>\n {title}\n </span>\n {description && (\n <span id={descriptionId} className='sr-only'>\n {description}\n </span>\n )}\n <Input\n key={titleSession}\n label={t('list title label')}\n placeholder={t('list title placeholder')}\n labelVisuallyHidden\n initialValue={title}\n onChange={onChangeTitle}\n slots={inputSlots}\n />\n {/* TODO(thure): Re-enable this when relevant */}\n {/* <Input */}\n {/* key={descriptionSession} */}\n {/* label={t('list description label')} */}\n {/* placeholder={t('list description placeholder')} */}\n {/* labelVisuallyHidden */}\n {/* initialValue={description} */}\n {/* onChange={onChangeDescription} */}\n {/* className='mli-4' */}\n {/* data-itemid={listId} */}\n {/* /> */}\n <ol className='contents'>\n {order.map((listItemId, index) => {\n return (\n <ListItemPrimitive\n key={`${itemsSession}__${listItemId}`}\n orderIndex={index}\n isLast={index === order.length - 1}\n {...{ id: listItemId, updateItem, updateOrder, deleteItem, createItem }}\n {...items[listItemId]}\n autoFocus={listItemId === autoFocus}\n />\n );\n })}\n </ol>\n <div role='none' className='mli-4 mlb-4'>\n <Button className='is-full' onClick={createItem} disabled={creating}>\n <Plus className={getSize(5)} />\n <span className='sr-only'>{t('add list item label')}</span>\n </Button>\n </div>\n </div>\n );\n};\n", "//\n// Copyright 2022 DXOS.org\n//\n\nimport { useEffect, useRef, useState, Dispatch, SetStateAction } from 'react';\n\nimport { randomString } from '@dxos/react-uikit';\n\nconst isEqual = <T>(a: T, b: T) => a === b;\n\n/**\n * @deprecated\n */\nexport const usePropStatefully = <T>(\n propsValue: T,\n equivalentPredicate?: (a: T, b: T) => boolean\n): [T, Dispatch<SetStateAction<T>>, string] => {\n const [value, setValue] = useState<T>(propsValue);\n const [valueSession, setValueSession] = useState(randomString());\n const mounted = useRef(false);\n const predicate = equivalentPredicate ?? isEqual<T>;\n\n useEffect(() => {\n if (mounted.current && !predicate(propsValue, value)) {\n setValue(propsValue);\n setValueSession(randomString());\n } else {\n mounted.current = true;\n }\n }, [propsValue]);\n\n return [value, setValue, valueSession];\n};\n"],
5
+ "mappings": ";AAIA,OAAOA,UAASC,eAAAA,oBAAmB;AAGnC,SAASC,mBAAmB;AAC5B,SAASC,cAAcC,gBAAgB;AACvC,SAASC,eAAe;AACxB,SAASC,kBAAAA,uBAAsB;;;ACN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+B;EAAO,EAAA,MAAjD7C,YAAwD,CAAA,GAAI;AAC1E,QAAMF,YAAYE,aAAaH,6BAAMI,SAASC,WAAWC,OAAO;IAAEC,MAAMC;EAAe,EAAA;AAGvF,SAAOT,SAASC,QAAQC,YACtB,gBAAAkC,OAAA,cAACrC,YAAAA,UAAAA,CAAAA,GAAe;IAAEC;IAAOC;IAAMC;EAAU,CAAA,CAAA,IAEzC,gBAAAkC,OAAA,cAACiB,SAAAA;IAAQC,OAAOJ,EAAE,uBAAA;;AAElB;",
6
+ "names": ["React", "useCallback", "ObjectModel", "useSelection", "useSpace", "Loading", "useTranslation", "LIST_TYPE", "LIST_ITEM_TYPE", "debounce", "Minus", "Plus", "React", "useCallback", "useMemo", "useState", "defaultFocus", "Input", "useTranslation", "getSize", "Button", "randomString", "defaultGroup", "defaultHover", "mx", "useEffect", "useRef", "useState", "randomString", "isEqual", "a", "b", "usePropStatefully", "propsValue", "equivalentPredicate", "value", "setValue", "valueSession", "setValueSession", "mounted", "predicate", "current", "isListItemChangedAction", "o", "isListItemCreatedAction", "isListItemDeletedAction", "defaultCreateListItemId", "randomString", "ListItemPrimitive", "id", "title", "propsTitle", "description", "propsDescription", "annotations", "propsAnnotations", "updateItem", "deleteItem", "createItem", "updateOrder", "orderIndex", "isLast", "autoFocus", "checkId", "labelId", "descriptionId", "t", "useTranslation", "rejectTextUpdatesWhenFocused", "useCallback", "a", "b", "document", "activeElement", "getAttribute", "setTitle", "titleSession", "usePropStatefully", "_setDescription", "_descriptionSession", "setAnnotations", "useState", "isDone", "state", "onChangeTitle", "nextValue", "_onChangeDescription", "_onClickMoveUp", "_onClickMoveDown", "onChangeCheckbox", "nextAnnotations", "onClickDelete", "onKeyUp", "e", "key", "shiftKey", "querySelector", "focus", "inputSlots", "useMemo", "root", "className", "input", "li", "aria-labelledby", "type", "mx", "getSize", "defaultFocus", "defaultHover", "onChange", "checked", "label", "htmlFor", "span", "div", "role", "Input", "placeholder", "labelVisuallyHidden", "initialValue", "slots", "Button", "onClick", "variant", "Minus", "itemsEquivalent", "aKeys", "Object", "keys", "bKeys", "i", "length", "ListPrimitive", "listId", "items", "propsItems", "onAction", "createListItemId", "onChangePeriod", "divProps", "creating", "setCreating", "setAutofocus", "titleId", "propagateTitle", "next", "debouncedPropagateTitle", "debounce", "setDescription", "propagateDescription", "debouncedPropagateDescription", "setItems", "itemsSession", "order", "propagateItem", "listItemId", "debouncedPropagateItem", "assign", "delta", "fromIndex", "indexOf", "toIndex", "nextOrder", "Array", "from", "splice", "nextItems", "reduce", "acc", "deletedItem", "deleted", "then", "created", "finally", "defaultGroup", "elevation", "spacing", "ol", "map", "index", "disabled", "Plus", "_extends", "ListLoaded", "space", "list", "listItems", "propsListItems", "useSelection", "select", "children", "filter", "type", "LIST_ITEM_TYPE", "onAction", "useCallback", "action", "isListItemDeletedAction", "subject", "database", "getItem", "deleted", "id", "model", "set", "isListItemCreatedAction", "isListItemChangedAction", "listItemId", "Promise", "all", "Object", "keys", "next", "map", "prop", "createListItemId", "listItem", "createItem", "ObjectModel", "parent", "React", "ListPrimitive", "title", "get", "description", "items", "item", "reduce", "acc", "annotations", "onChangePeriod", "List", "spaceKey", "itemId", "t", "useTranslation", "useSpace", "Loading", "label"]
7
+ }
@@ -0,0 +1 @@
1
+ {"inputs":{"packages/apps/patterns/react-list/src/model.ts":{"bytes":720,"imports":[]},"packages/apps/patterns/react-list/src/hooks/usePropStatefully.ts":{"bytes":3279,"imports":[]},"packages/apps/patterns/react-list/src/hooks/index.ts":{"bytes":497,"imports":[{"path":"packages/apps/patterns/react-list/src/hooks/usePropStatefully.ts","kind":"import-statement"}]},"packages/apps/patterns/react-list/src/components/ListPrimitive/ListPrimitive.tsx":{"bytes":46433,"imports":[{"path":"packages/apps/patterns/react-list/src/hooks/index.ts","kind":"import-statement"}]},"packages/apps/patterns/react-list/src/components/ListPrimitive/index.ts":{"bytes":513,"imports":[{"path":"packages/apps/patterns/react-list/src/components/ListPrimitive/ListPrimitive.tsx","kind":"import-statement"}]},"packages/apps/patterns/react-list/src/components/List/List.tsx":{"bytes":12472,"imports":[{"path":"packages/apps/patterns/react-list/src/model.ts","kind":"import-statement"},{"path":"packages/apps/patterns/react-list/src/components/ListPrimitive/index.ts","kind":"import-statement"}]},"packages/apps/patterns/react-list/src/components/List/index.ts":{"bytes":476,"imports":[{"path":"packages/apps/patterns/react-list/src/components/List/List.tsx","kind":"import-statement"}]},"packages/apps/patterns/react-list/src/components/index.ts":{"bytes":468,"imports":[{"path":"packages/apps/patterns/react-list/src/components/List/index.ts","kind":"import-statement"}]},"packages/apps/patterns/react-list/src/index.ts":{"bytes":551,"imports":[{"path":"packages/apps/patterns/react-list/src/components/index.ts","kind":"import-statement"},{"path":"packages/apps/patterns/react-list/src/model.ts","kind":"import-statement"}]}},"outputs":{"packages/apps/patterns/react-list/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":33492},"packages/apps/patterns/react-list/dist/lib/browser/index.mjs":{"imports":[],"exports":["LIST_ITEM_TYPE","LIST_TYPE","List"],"entryPoint":"packages/apps/patterns/react-list/src/index.ts","inputs":{"packages/apps/patterns/react-list/src/components/List/List.tsx":{"bytesInOutput":3223},"packages/apps/patterns/react-list/src/model.ts":{"bytesInOutput":78},"packages/apps/patterns/react-list/src/components/ListPrimitive/ListPrimitive.tsx":{"bytesInOutput":12102},"packages/apps/patterns/react-list/src/hooks/usePropStatefully.ts":{"bytesInOutput":716},"packages/apps/patterns/react-list/src/hooks/index.ts":{"bytesInOutput":0},"packages/apps/patterns/react-list/src/components/ListPrimitive/index.ts":{"bytesInOutput":0},"packages/apps/patterns/react-list/src/components/List/index.ts":{"bytesInOutput":0},"packages/apps/patterns/react-list/src/components/index.ts":{"bytesInOutput":0},"packages/apps/patterns/react-list/src/index.ts":{"bytesInOutput":0}},"bytes":16627}}}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../../../../src/components/List/List.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAS,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAuBjD,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,CAAC;CACjC;AAiED,eAAO,MAAM,IAAI,yBAA0B,SAAS,gBAanD,CAAC"}
@@ -0,0 +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,EAAE,MAAM,cAAc,CAAC;AAU7D,OAAO,EAAQ,SAAS,EAAE,MAAM,QAAQ,CAAC;;;;;;AAKzC,wBAIE;AAsBF,eAAO,MAAM,OAAO;;;EAAqC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/List/index.ts"],"names":[],"mappings":"AAIA,cAAc,QAAQ,CAAC"}
@@ -1,13 +1,13 @@
1
1
  import { ComponentProps } from 'react';
2
- type ListId = string;
3
- type ListItemId = string;
2
+ declare type ListId = string;
3
+ declare type ListItemId = string;
4
4
  export interface ListItemProps {
5
5
  id: ListItemId;
6
6
  title?: string;
7
7
  description?: string;
8
8
  annotations?: Record<string, string | boolean>;
9
9
  }
10
- export type ListItems = Record<ListItemId, Omit<ListItemProps, 'id'>>;
10
+ export declare type ListItems = Record<ListItemId, Omit<ListItemProps, 'id'>>;
11
11
  interface SharedListActionProps {
12
12
  listId: ListId;
13
13
  }
@@ -26,7 +26,7 @@ export interface ListItemCreatedAction extends SharedListActionProps {
26
26
  export interface ListItemDeletedAction extends SharedListActionProps {
27
27
  deleted: Pick<ListItemProps, 'id'> & Partial<Omit<ListItemProps, 'id'>>;
28
28
  }
29
- export type ListAction = ListItemChangedAction | ListChangedAction | ListItemCreatedAction | ListItemDeletedAction;
29
+ export declare type ListAction = ListItemChangedAction | ListChangedAction | ListItemCreatedAction | ListItemDeletedAction;
30
30
  export declare const isListItemChangedAction: (o: any) => o is ListItemChangedAction;
31
31
  export declare const isListItemCreatedAction: (o: any) => o is ListItemCreatedAction;
32
32
  export declare const isListItemDeletedAction: (o: any) => o is ListItemDeletedAction;