jazz-tools 0.19.11 → 0.19.12
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/.turbo/turbo-build.log +46 -46
- package/CHANGELOG.md +12 -0
- package/dist/{chunk-HX5S6W5E.js → chunk-AGF4HEDH.js} +56 -27
- package/dist/chunk-AGF4HEDH.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/inspector/{chunk-C6BJPHBQ.js → chunk-YQNK5Y7B.js} +47 -35
- package/dist/inspector/chunk-YQNK5Y7B.js.map +1 -0
- package/dist/inspector/{custom-element-GJVBPZES.js → custom-element-KYV64IOC.js} +47 -35
- package/dist/inspector/{custom-element-GJVBPZES.js.map → custom-element-KYV64IOC.js.map} +1 -1
- package/dist/inspector/index.js +1 -1
- package/dist/inspector/register-custom-element.js +1 -1
- package/dist/inspector/standalone.js +1 -1
- package/dist/inspector/tests/utils/transactions-changes.test.d.ts +2 -0
- package/dist/inspector/tests/utils/transactions-changes.test.d.ts.map +1 -0
- package/dist/inspector/utils/transactions-changes.d.ts +13 -13
- package/dist/inspector/utils/transactions-changes.d.ts.map +1 -1
- package/dist/react/index.js +4 -1
- package/dist/react/index.js.map +1 -1
- package/dist/react/provider.d.ts.map +1 -1
- package/dist/react-core/index.js +2 -2
- package/dist/react-core/index.js.map +1 -1
- package/dist/react-native/index.js +4 -1
- package/dist/react-native/index.js.map +1 -1
- package/dist/react-native-core/index.js +4 -1
- package/dist/react-native-core/index.js.map +1 -1
- package/dist/react-native-core/provider.d.ts.map +1 -1
- package/dist/testing.js +1 -1
- package/dist/tools/implementation/ContextManager.d.ts.map +1 -1
- package/dist/tools/subscribe/SubscriptionScope.d.ts +3 -6
- package/dist/tools/subscribe/SubscriptionScope.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/inspector/tests/utils/transactions-changes.test.ts +102 -0
- package/src/inspector/ui/icons/add-icon.tsx +3 -3
- package/src/inspector/utils/history.ts +6 -6
- package/src/inspector/utils/transactions-changes.ts +37 -3
- package/src/inspector/viewer/history-view.tsx +13 -13
- package/src/react/provider.tsx +6 -1
- package/src/react-core/hooks.ts +2 -2
- package/src/react-core/tests/useSuspenseCoState.test.tsx +47 -0
- package/src/react-native-core/provider.tsx +6 -1
- package/src/tools/implementation/ContextManager.ts +10 -0
- package/src/tools/subscribe/SubscriptionScope.ts +61 -39
- package/dist/chunk-HX5S6W5E.js.map +0 -1
- package/dist/inspector/chunk-C6BJPHBQ.js.map +0 -1
|
@@ -32595,9 +32595,9 @@ function AddIcon(props) {
|
|
|
32595
32595
|
"path",
|
|
32596
32596
|
{
|
|
32597
32597
|
d: "M4 12H20M12 4V20",
|
|
32598
|
-
|
|
32599
|
-
|
|
32600
|
-
|
|
32598
|
+
strokeWidth: "2",
|
|
32599
|
+
strokeLinecap: "round",
|
|
32600
|
+
strokeLinejoin: "round"
|
|
32601
32601
|
}
|
|
32602
32602
|
)
|
|
32603
32603
|
}
|
|
@@ -34343,43 +34343,55 @@ var import_react19 = __toESM(require_react(), 1);
|
|
|
34343
34343
|
import { styled as styled19 } from "goober";
|
|
34344
34344
|
|
|
34345
34345
|
// src/inspector/utils/transactions-changes.ts
|
|
34346
|
-
var isGroupExtension = (change) => {
|
|
34346
|
+
var isGroupExtension = (coValue, change) => {
|
|
34347
|
+
if (coValue.core.isGroup() === false) return false;
|
|
34347
34348
|
return change?.op === "set" && change?.value === "extend";
|
|
34348
34349
|
};
|
|
34349
|
-
var isGroupExtendRevocation = (change) => {
|
|
34350
|
+
var isGroupExtendRevocation = (coValue, change) => {
|
|
34351
|
+
if (coValue.core.isGroup() === false) return false;
|
|
34350
34352
|
return change?.op === "set" && change?.value === "revoked";
|
|
34351
34353
|
};
|
|
34352
|
-
var isGroupPromotion = (change) => {
|
|
34354
|
+
var isGroupPromotion = (coValue, change) => {
|
|
34355
|
+
if (coValue.core.isGroup() === false) return false;
|
|
34353
34356
|
return change?.op === "set" && change?.key.startsWith("parent_co_");
|
|
34354
34357
|
};
|
|
34355
|
-
var isUserPromotion = (change) => {
|
|
34358
|
+
var isUserPromotion = (coValue, change) => {
|
|
34359
|
+
if (coValue.core.isGroup() === false) return false;
|
|
34356
34360
|
return change?.op === "set" && (isCoId(change?.key) || change?.key === "everyone");
|
|
34357
34361
|
};
|
|
34358
|
-
var isKeyRevelation = (change) => {
|
|
34362
|
+
var isKeyRevelation = (coValue, change) => {
|
|
34363
|
+
if (coValue.core.isGroup() === false && coValue.headerMeta?.type !== "account")
|
|
34364
|
+
return false;
|
|
34359
34365
|
return change?.op === "set" && change?.key.includes("_for_");
|
|
34360
34366
|
};
|
|
34361
|
-
var isPropertySet = (change) => {
|
|
34367
|
+
var isPropertySet = (coValue, change) => {
|
|
34362
34368
|
return change?.op === "set" && "key" in change && "value" in change;
|
|
34363
34369
|
};
|
|
34364
|
-
var isPropertyDeletion = (change) => {
|
|
34370
|
+
var isPropertyDeletion = (coValue, change) => {
|
|
34365
34371
|
return change?.op === "del" && "key" in change;
|
|
34366
34372
|
};
|
|
34367
|
-
var isItemAppend = (change) => {
|
|
34373
|
+
var isItemAppend = (coValue, change) => {
|
|
34374
|
+
if (coValue.type !== "colist" && coValue.type !== "coplaintext") return false;
|
|
34368
34375
|
return change?.op === "app" && "after" in change && "value" in change;
|
|
34369
34376
|
};
|
|
34370
|
-
var isItemPrepend = (change) => {
|
|
34377
|
+
var isItemPrepend = (coValue, change) => {
|
|
34378
|
+
if (coValue.type !== "colist" && coValue.type !== "coplaintext") return false;
|
|
34371
34379
|
return change?.op === "pre" && "before" in change && "value" in change;
|
|
34372
34380
|
};
|
|
34373
|
-
var isItemDeletion = (change) => {
|
|
34381
|
+
var isItemDeletion = (coValue, change) => {
|
|
34382
|
+
if (coValue.type !== "colist" && coValue.type !== "coplaintext") return false;
|
|
34374
34383
|
return change?.op === "del" && "insertion" in change;
|
|
34375
34384
|
};
|
|
34376
|
-
var isStreamStart = (change) => {
|
|
34385
|
+
var isStreamStart = (coValue, change) => {
|
|
34386
|
+
if (coValue.type !== "coStream") return false;
|
|
34377
34387
|
return change?.type === "start" && "mimeType" in change;
|
|
34378
34388
|
};
|
|
34379
|
-
var isStreamChunk = (change) => {
|
|
34389
|
+
var isStreamChunk = (coValue, change) => {
|
|
34390
|
+
if (coValue.type !== "coStream") return false;
|
|
34380
34391
|
return change?.type === "chunk" && "chunk" in change;
|
|
34381
34392
|
};
|
|
34382
|
-
var isStreamEnd = (change) => {
|
|
34393
|
+
var isStreamEnd = (coValue, change) => {
|
|
34394
|
+
if (coValue.type !== "coStream") return false;
|
|
34383
34395
|
return change?.type === "end";
|
|
34384
34396
|
};
|
|
34385
34397
|
|
|
@@ -34411,8 +34423,8 @@ function getTransactionChanges(tx, coValue) {
|
|
|
34411
34423
|
if (isCoPlainText(coValue)) {
|
|
34412
34424
|
if (tx.changes === void 0 || tx.changes.length === 0) return [];
|
|
34413
34425
|
const firstChange = tx.changes[0];
|
|
34414
|
-
if (isItemAppend(firstChange) && tx.changes.every(
|
|
34415
|
-
(c) => isItemAppend(c) && areSameOpIds(c.after, firstChange.after)
|
|
34426
|
+
if (isItemAppend(coValue, firstChange) && tx.changes.every(
|
|
34427
|
+
(c) => isItemAppend(coValue, c) && areSameOpIds(c.after, firstChange.after)
|
|
34416
34428
|
)) {
|
|
34417
34429
|
const changes = tx.changes;
|
|
34418
34430
|
if (firstChange.after !== "start") {
|
|
@@ -34426,8 +34438,8 @@ function getTransactionChanges(tx, coValue) {
|
|
|
34426
34438
|
}
|
|
34427
34439
|
];
|
|
34428
34440
|
}
|
|
34429
|
-
if (isItemPrepend(firstChange) && tx.changes.every(
|
|
34430
|
-
(c) => isItemPrepend(c) && areSameOpIds(c.before, firstChange.before)
|
|
34441
|
+
if (isItemPrepend(coValue, firstChange) && tx.changes.every(
|
|
34442
|
+
(c) => isItemPrepend(coValue, c) && areSameOpIds(c.before, firstChange.before)
|
|
34431
34443
|
)) {
|
|
34432
34444
|
const changes = tx.changes;
|
|
34433
34445
|
if (firstChange.before !== "end") {
|
|
@@ -34441,7 +34453,7 @@ function getTransactionChanges(tx, coValue) {
|
|
|
34441
34453
|
}
|
|
34442
34454
|
];
|
|
34443
34455
|
}
|
|
34444
|
-
if (isItemDeletion(firstChange) && tx.changes.every((c) => isItemDeletion(c))) {
|
|
34456
|
+
if (isItemDeletion(coValue, firstChange) && tx.changes.every((c) => isItemDeletion(coValue, c))) {
|
|
34445
34457
|
let changesAreConsecutive2 = function(changes) {
|
|
34446
34458
|
if (changes.length < 2) return false;
|
|
34447
34459
|
const mapping = coValueBeforeDeletions.mapping.idxAfterOpID;
|
|
@@ -34611,29 +34623,29 @@ function getHistory(coValue) {
|
|
|
34611
34623
|
});
|
|
34612
34624
|
}
|
|
34613
34625
|
function mapTransactionToAction(change, coValue) {
|
|
34614
|
-
if (isUserPromotion(change)) {
|
|
34626
|
+
if (isUserPromotion(coValue, change)) {
|
|
34615
34627
|
if (change.value === "revoked") {
|
|
34616
34628
|
return `${change.key} has been revoked`;
|
|
34617
34629
|
}
|
|
34618
34630
|
return `${change.key} has been promoted to ${change.value}`;
|
|
34619
34631
|
}
|
|
34620
|
-
if (isGroupExtension(change)) {
|
|
34632
|
+
if (isGroupExtension(coValue, change)) {
|
|
34621
34633
|
const child = change.key.slice(6);
|
|
34622
34634
|
return `Group became a member of ${child}`;
|
|
34623
34635
|
}
|
|
34624
|
-
if (isGroupExtendRevocation(change)) {
|
|
34636
|
+
if (isGroupExtendRevocation(coValue, change)) {
|
|
34625
34637
|
const child = change.key.slice(6);
|
|
34626
34638
|
return `Group's membership of ${child} has been revoked.`;
|
|
34627
34639
|
}
|
|
34628
|
-
if (isGroupPromotion(change)) {
|
|
34640
|
+
if (isGroupPromotion(coValue, change)) {
|
|
34629
34641
|
const parent = change.key.slice(7);
|
|
34630
34642
|
return `Group ${parent} has been promoted to ${change.value}`;
|
|
34631
34643
|
}
|
|
34632
|
-
if (isKeyRevelation(change)) {
|
|
34644
|
+
if (isKeyRevelation(coValue, change)) {
|
|
34633
34645
|
const [key, target] = change.key.split("_for_");
|
|
34634
34646
|
return `Key "${key}" has been revealed to "${target}"`;
|
|
34635
34647
|
}
|
|
34636
|
-
if (isItemAppend(change)) {
|
|
34648
|
+
if (isItemAppend(coValue, change)) {
|
|
34637
34649
|
if (change.after === "start") {
|
|
34638
34650
|
return `"${change.value}" has been appended`;
|
|
34639
34651
|
}
|
|
@@ -34643,7 +34655,7 @@ function mapTransactionToAction(change, coValue) {
|
|
|
34643
34655
|
}
|
|
34644
34656
|
return `"${change.value}" has been inserted after "${after.value}"`;
|
|
34645
34657
|
}
|
|
34646
|
-
if (isItemPrepend(change)) {
|
|
34658
|
+
if (isItemPrepend(coValue, change)) {
|
|
34647
34659
|
if (change.before === "end") {
|
|
34648
34660
|
return `"${change.value}" has been prepended`;
|
|
34649
34661
|
}
|
|
@@ -34653,26 +34665,26 @@ function mapTransactionToAction(change, coValue) {
|
|
|
34653
34665
|
}
|
|
34654
34666
|
return `"${change.value}" has been inserted before "${before.value}"`;
|
|
34655
34667
|
}
|
|
34656
|
-
if (isItemDeletion(change)) {
|
|
34668
|
+
if (isItemDeletion(coValue, change)) {
|
|
34657
34669
|
const insertion = findListChange(change.insertion, coValue);
|
|
34658
34670
|
if (insertion === void 0) {
|
|
34659
34671
|
return `An undefined item has been deleted`;
|
|
34660
34672
|
}
|
|
34661
34673
|
return `"${insertion.value}" has been deleted`;
|
|
34662
34674
|
}
|
|
34663
|
-
if (isStreamStart(change)) {
|
|
34675
|
+
if (isStreamStart(coValue, change)) {
|
|
34664
34676
|
return `Stream started with mime type "${change.mimeType}" and file name "${change.fileName}"`;
|
|
34665
34677
|
}
|
|
34666
|
-
if (isStreamChunk(change)) {
|
|
34678
|
+
if (isStreamChunk(coValue, change)) {
|
|
34667
34679
|
return `Stream chunk added`;
|
|
34668
34680
|
}
|
|
34669
|
-
if (isStreamEnd(change)) {
|
|
34681
|
+
if (isStreamEnd(coValue, change)) {
|
|
34670
34682
|
return `Stream ended`;
|
|
34671
34683
|
}
|
|
34672
|
-
if (isPropertySet(change)) {
|
|
34684
|
+
if (isPropertySet(coValue, change)) {
|
|
34673
34685
|
return `Property "${change.key}" has been set to ${JSON.stringify(change.value)}`;
|
|
34674
34686
|
}
|
|
34675
|
-
if (isPropertyDeletion(change)) {
|
|
34687
|
+
if (isPropertyDeletion(coValue, change)) {
|
|
34676
34688
|
return `Property "${change.key}" has been deleted`;
|
|
34677
34689
|
}
|
|
34678
34690
|
if (change.op === "custom") {
|
|
@@ -36078,4 +36090,4 @@ react/cjs/react-jsx-runtime.development.js:
|
|
|
36078
36090
|
* LICENSE file in the root directory of this source tree.
|
|
36079
36091
|
*)
|
|
36080
36092
|
*/
|
|
36081
|
-
//# sourceMappingURL=custom-element-
|
|
36093
|
+
//# sourceMappingURL=custom-element-KYV64IOC.js.map
|