@graffiti-garden/implementation-decentralized 0.0.4 → 0.0.6

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.
@@ -15,6 +15,7 @@ import"./chunk-RFBBAUMM.js";var e=`.graffiti-modal {
15
15
  border-radius: 1rem;
16
16
  box-shadow: 0 0 2rem black;
17
17
  overflow: hidden;
18
+ position: fixed;
18
19
  opacity: 0;
19
20
  transition: opacity 0.3s;
20
21
  pointer-events: none;
@@ -115,9 +116,18 @@ import"./chunk-RFBBAUMM.js";var e=`.graffiti-modal {
115
116
  color: inherit;
116
117
  }
117
118
 
118
- h1 a:hover {
119
- background: none;
120
- color: inherit;
119
+ @media (hover: hover) and (pointer: fine) {
120
+ h1 a:hover {
121
+ background: none;
122
+ color: inherit;
123
+ }
124
+ }
125
+
126
+ @media (hover: none), (pointer: coarse) {
127
+ h1 a:active {
128
+ background: none;
129
+ color: inherit;
130
+ }
121
131
  }
122
132
 
123
133
  button,
@@ -199,15 +209,30 @@ import"./chunk-RFBBAUMM.js";var e=`.graffiti-modal {
199
209
  text-decoration: none;
200
210
  }
201
211
 
202
- :is(button, ul a, input[type="submit"]):hover {
203
- cursor: pointer;
204
- background: var(--hover);
205
- color: var(--front);
212
+ @media (hover: hover) and (pointer: fine) {
213
+ :is(button, ul a, input[type="submit"]):hover {
214
+ cursor: pointer;
215
+ background: var(--hover);
216
+ color: var(--front);
217
+ }
218
+
219
+ a:hover {
220
+ text-decoration: underline;
221
+ cursor: pointer;
222
+ }
206
223
  }
207
224
 
208
- a:hover {
209
- text-decoration: underline;
210
- cursor: pointer;
225
+ @media (hover: none), (pointer: coarse) {
226
+ :is(button, ul a, input[type="submit"]):active {
227
+ cursor: pointer;
228
+ background: var(--hover);
229
+ color: var(--front);
230
+ }
231
+
232
+ a:active {
233
+ text-decoration: underline;
234
+ cursor: pointer;
235
+ }
211
236
  }
212
237
 
213
238
  form {
@@ -234,10 +259,20 @@ import"./chunk-RFBBAUMM.js";var e=`.graffiti-modal {
234
259
  color: white;
235
260
  }
236
261
 
237
- :is(button, a[type="button"], input[type="submit"]):hover {
238
- background: rgba(202, 122, 204, 0.6);
239
- color: white;
240
- text-decoration: none;
262
+ @media (hover: hover) and (pointer: fine) {
263
+ :is(button, a[type="button"], input[type="submit"]):hover {
264
+ background: rgba(202, 122, 204, 0.6);
265
+ color: white;
266
+ text-decoration: none;
267
+ }
268
+ }
269
+
270
+ @media (hover: none), (pointer: coarse) {
271
+ :is(button, a[type="button"], input[type="submit"]):active {
272
+ background: rgba(202, 122, 204, 0.6);
273
+ color: white;
274
+ text-decoration: none;
275
+ }
241
276
  }
242
277
  }
243
278
 
@@ -253,18 +288,18 @@ import"./chunk-RFBBAUMM.js";var e=`.graffiti-modal {
253
288
 
254
289
  .graffiti-modal::before {
255
290
  content: "";
256
- position: fixed;
257
- left: 0;
258
- right: 0;
291
+ position: absolute;
292
+ inset: calc(-1 * var(--blurpix));
259
293
  z-index: -1;
260
294
  background-image: url(graffiti.jpg);
261
295
  background-size: cover;
262
296
  background-repeat: no-repeat;
263
297
  background-position: 50% 50%;
264
- height: calc(100% + 2 * var(--blurpix));
265
- width: calc(100% + 2 * var(--blurpix));
266
298
  filter: blur(var(--blurpix));
267
- margin: calc(-1 * var(--blurpix));
299
+ border-radius: inherit;
300
+ pointer-events: none;
301
+ transform: translateZ(0);
302
+ overflow: hidden;
268
303
  }
269
304
  `;export{e as default};
270
- //# sourceMappingURL=style-RMTPI5KV-Y5KAOOZR.js.map
305
+ //# sourceMappingURL=style-BOBMBTYJ-ORUSIJTZ.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../node_modules/@graffiti-garden/modal/src/style.css"],
4
+ "sourcesContent": [".graffiti-modal {\n --back: rgba(26, 26, 26, 0.85);\n --halfback: rgba(80, 80, 80, 0.85);\n --halfback2: rgba(26, 26, 26, 0.85);\n --hover: rgba(202, 122, 204, 0.3);\n --frontfaded: rgba(190, 190, 190);\n --front: rgba(240, 240, 240);\n --emph: rgb(202, 122, 204);\n --blurpix: 3px;\n border-color: var(--emph);\n box-sizing: border-box;\n border-width: 2px;\n padding: 0;\n margin: 0;\n border-radius: 1rem;\n box-shadow: 0 0 2rem black;\n overflow: hidden;\n position: fixed;\n opacity: 0;\n transition: opacity 0.3s;\n pointer-events: none;\n min-width: 95dvw;\n min-height: 95dvh;\n height: 95dvh;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: center;\n font-family:\n Inter,\n -apple-system,\n BlinkMacSystemFont,\n \"Segoe UI\",\n Roboto,\n Oxygen,\n Ubuntu,\n Cantarell,\n \"Fira Sans\",\n \"Droid Sans\",\n \"Helvetica Neue\",\n sans-serif;\n color: var(--front);\n font-size: 150%;\n\n * {\n box-sizing: border-box;\n padding: 0;\n margin: 0;\n }\n\n ::selection {\n background: rgba(202, 122, 204, 0.3);\n }\n\n :focus {\n outline: 2px solid var(--front);\n }\n\n header {\n width: 100%;\n display: flex;\n justify-content: flex-end;\n }\n\n main {\n flex: 1;\n max-width: 600px;\n width: 100%;\n gap: 2em;\n padding-inline: clamp(1rem, 4dvw, 3rem);\n padding-block: clamp(1rem, 4dvh, 3rem);\n margin-inline: clamp(1rem, 4dvw, 3rem);\n margin-block: clamp(1rem, 4dvh, 3rem);\n background: var(--back);\n border-radius: 1rem;\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n scrollbar-color: var(--emph) rgba(0, 0, 0, 0);\n }\n\n ul {\n list-style-type: none;\n display: flex;\n flex-direction: column;\n gap: 0.5em;\n align-items: stretch;\n justify-content: stretch;\n }\n\n aside {\n color: var(--frontfaded);\n }\n\n .secondary,\n a:not([type=\"button\"]) {\n color: var(--emph);\n }\n\n h1 {\n font-size: 120%;\n font-family:\n Rock Salt,\n cursive,\n sans-serif;\n letter-spacing: 0.1em;\n text-align: center;\n color: var(--front);\n line-height: 1.5em;\n }\n\n h1 a:not([type=\"button\"]) {\n color: inherit;\n }\n\n @media (hover: hover) and (pointer: fine) {\n h1 a:hover {\n background: none;\n color: inherit;\n }\n }\n\n @media (hover: none), (pointer: coarse) {\n h1 a:active {\n background: none;\n color: inherit;\n }\n }\n\n button,\n input[type=\"submit\"],\n input[type=\"text\"],\n a[type=\"button\"] {\n font-size: inherit;\n width: 100%;\n text-align: center;\n display: block;\n border-radius: 1rem;\n border: 2px solid var(--emph);\n padding: 1em;\n padding-top: 0.5em;\n padding-bottom: 0.5em;\n transition: 0.1s;\n text-overflow: ellipsis;\n background: none;\n line-height: 1.2em;\n }\n\n input[type=\"text\"] {\n font-weight: 500;\n background: var(--front);\n text-align: left;\n color: black;\n }\n\n header button {\n border-radius: 0 0 0 1rem;\n border-right: none;\n border-top: none;\n background-color: var(--halfback2);\n width: fit-content;\n position: relative;\n overflow: hidden;\n }\n\n header button::before {\n z-index: -1;\n top: 0;\n left: 0;\n height: 100%;\n position: absolute;\n width: 100%;\n content: \"\";\n background-color: var(--back);\n }\n\n @media (max-height: 600px) {\n main {\n gap: 1em;\n }\n\n h1 {\n font-size: 100%;\n }\n }\n\n @media (max-width: 600px) {\n main {\n border-radius: 0;\n margin: auto;\n overflow: auto;\n }\n\n header button {\n border-radius: 0;\n border-left: none;\n width: 100%;\n }\n\n html {\n justify-content: safe center;\n }\n }\n\n a {\n text-decoration: none;\n }\n\n @media (hover: hover) and (pointer: fine) {\n :is(button, ul a, input[type=\"submit\"]):hover {\n cursor: pointer;\n background: var(--hover);\n color: var(--front);\n }\n\n a:hover {\n text-decoration: underline;\n cursor: pointer;\n }\n }\n\n @media (hover: none), (pointer: coarse) {\n :is(button, ul a, input[type=\"submit\"]):active {\n cursor: pointer;\n background: var(--hover);\n color: var(--front);\n }\n\n a:active {\n text-decoration: underline;\n cursor: pointer;\n }\n }\n\n form {\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n align-items: stretch;\n gap: 0.5em;\n }\n\n iframe {\n width: 100%;\n height: 100%;\n border: none;\n }\n\n :is(button, a[type=\"button\"], input[type=\"submit\"]).secondary {\n color: rgb(244, 213, 244);\n background: rgba(26, 26, 26, 0.6);\n }\n\n :is(button, a[type=\"button\"], input[type=\"submit\"]):not(.secondary) {\n background: var(--hover);\n color: white;\n }\n\n @media (hover: hover) and (pointer: fine) {\n :is(button, a[type=\"button\"], input[type=\"submit\"]):hover {\n background: rgba(202, 122, 204, 0.6);\n color: white;\n text-decoration: none;\n }\n }\n\n @media (hover: none), (pointer: coarse) {\n :is(button, a[type=\"button\"], input[type=\"submit\"]):active {\n background: rgba(202, 122, 204, 0.6);\n color: white;\n text-decoration: none;\n }\n }\n}\n\n.graffiti-modal[open] {\n pointer-events: inherit;\n opacity: 1;\n}\n\n.graffiti-modal::backdrop {\n background-color: black;\n opacity: 0.5;\n}\n\n.graffiti-modal::before {\n content: \"\";\n position: absolute;\n inset: calc(-1 * var(--blurpix));\n z-index: -1;\n background-image: url(graffiti.jpg);\n background-size: cover;\n background-repeat: no-repeat;\n background-position: 50% 50%;\n filter: blur(var(--blurpix));\n border-radius: inherit;\n pointer-events: none;\n transform: translateZ(0);\n overflow: hidden;\n}\n"],
5
+ "mappings": "4BAAA,IAAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;",
6
+ "names": ["style_default"]
7
+ }
@@ -530,69 +530,77 @@ class GraffitiDecentralized {
530
530
  );
531
531
  let indexedIteratorNexts = iterators.map(async (it, index) => indexedSingleEndpointQueryNext(it, index));
532
532
  let active = indexedIteratorNexts.length;
533
- while (active > 0) {
534
- const next = await Promise.race(indexedIteratorNexts);
535
- if (next.error !== void 0) {
536
- indexedIteratorNexts[next.index] = new Promise(() => {
537
- });
538
- active--;
539
- yield {
540
- error: next.error,
541
- origin: allInboxes[next.index].serviceEndpoint
542
- };
543
- } else if (next.result.done) {
544
- const inbox = allInboxes[next.index];
545
- cursors[inbox.serviceEndpoint] = next.result.value;
546
- indexedIteratorNexts[next.index] = new Promise(() => {
547
- });
548
- active--;
549
- } else {
550
- indexedIteratorNexts[next.index] = indexedSingleEndpointQueryNext(
551
- iterators[next.index],
552
- next.index
553
- );
554
- const { object, tombstone, tags: receivedTags } = next.result.value;
555
- if (tombstone) {
556
- if (tombstones.get(object.url) === true) continue;
557
- tombstones.set(object.url, true);
533
+ try {
534
+ while (active > 0) {
535
+ const next = await Promise.race(indexedIteratorNexts);
536
+ if (next.error !== void 0) {
537
+ indexedIteratorNexts[next.index] = new Promise(() => {
538
+ });
539
+ active--;
558
540
  yield {
559
- tombstone,
560
- object: { url: object.url }
541
+ error: next.error,
542
+ origin: allInboxes[next.index].serviceEndpoint
561
543
  };
544
+ } else if (next.result.done) {
545
+ const inbox = allInboxes[next.index];
546
+ cursors[inbox.serviceEndpoint] = next.result.value;
547
+ indexedIteratorNexts[next.index] = new Promise(() => {
548
+ });
549
+ active--;
562
550
  } else {
563
- if (tombstones.get(object.url) === false) continue;
564
- const matchedTagIndices = tags.reduce(
565
- (acc, tag, tagIndex) => {
566
- for (const receivedTag of receivedTags) {
567
- if (tag.length === receivedTag.length && tag.every((b, i) => receivedTag[i] === b)) {
568
- acc.push(tagIndex);
569
- break;
570
- }
571
- }
572
- return acc;
573
- },
574
- []
551
+ indexedIteratorNexts[next.index] = indexedSingleEndpointQueryNext(
552
+ iterators[next.index],
553
+ next.index
575
554
  );
576
- const matchedChannels = matchedTagIndices.map(
577
- (index) => channels[index]
578
- );
579
- if (matchedChannels.length === 0) {
555
+ const { object, tombstone, tags: receivedTags } = next.result.value;
556
+ if (tombstone) {
557
+ if (tombstones.get(object.url) === true) continue;
558
+ tombstones.set(object.url, true);
580
559
  yield {
581
- error: new Error(
582
- "Inbox returned object without matching channels"
583
- ),
584
- origin: allInboxes[next.index].serviceEndpoint
560
+ tombstone,
561
+ object: { url: object.url }
585
562
  };
586
- }
587
- tombstones.set(object.url, false);
588
- yield {
589
- object: {
590
- ...object,
591
- channels: matchedChannels
563
+ } else {
564
+ if (tombstones.get(object.url) === false) continue;
565
+ const matchedTagIndices = tags.reduce(
566
+ (acc, tag, tagIndex) => {
567
+ for (const receivedTag of receivedTags) {
568
+ if (tag.length === receivedTag.length && tag.every((b, i) => receivedTag[i] === b)) {
569
+ acc.push(tagIndex);
570
+ break;
571
+ }
572
+ }
573
+ return acc;
574
+ },
575
+ []
576
+ );
577
+ const matchedChannels = matchedTagIndices.map(
578
+ (index) => channels[index]
579
+ );
580
+ if (matchedChannels.length === 0) {
581
+ yield {
582
+ error: new Error(
583
+ "Inbox returned object without matching channels"
584
+ ),
585
+ origin: allInboxes[next.index].serviceEndpoint
586
+ };
592
587
  }
593
- };
588
+ tombstones.set(object.url, false);
589
+ yield {
590
+ object: {
591
+ ...object,
592
+ channels: matchedChannels
593
+ }
594
+ };
595
+ }
594
596
  }
595
597
  }
598
+ } finally {
599
+ await Promise.all(
600
+ iterators.map(async (it) => {
601
+ await it.return("");
602
+ })
603
+ );
596
604
  }
597
605
  return {
598
606
  cursor: JSON.stringify({
@@ -754,30 +762,34 @@ class GraffitiDecentralized {
754
762
  );
755
763
  const inFlight = [];
756
764
  let doneValue = null;
757
- while (true) {
758
- while (doneValue === null && inFlight.length < CONCURRENCY) {
759
- const itResult = await iterator.next();
760
- if (itResult.done) {
761
- doneValue = itResult.value;
762
- break;
765
+ try {
766
+ while (true) {
767
+ while (doneValue === null && inFlight.length < CONCURRENCY) {
768
+ const itResult = await iterator.next();
769
+ if (itResult.done) {
770
+ doneValue = itResult.value;
771
+ break;
772
+ }
773
+ const processPromise = this.processOneLabeledMessage(
774
+ inboxEndpoint,
775
+ itResult.value,
776
+ inboxToken,
777
+ recipient
778
+ ).catch((e) => {
779
+ throw e;
780
+ });
781
+ inFlight.push(processPromise);
763
782
  }
764
- const processPromise = this.processOneLabeledMessage(
765
- inboxEndpoint,
766
- itResult.value,
767
- inboxToken,
768
- recipient
769
- ).catch((e) => {
770
- throw e;
771
- });
772
- inFlight.push(processPromise);
773
- }
774
- const nextProcessedPromise = inFlight.shift();
775
- if (!nextProcessedPromise) {
776
- if (doneValue !== null) return doneValue;
777
- throw new Error("Process queue empty but no return value");
783
+ const nextProcessedPromise = inFlight.shift();
784
+ if (!nextProcessedPromise) {
785
+ if (doneValue !== null) return doneValue;
786
+ throw new Error("Process queue empty but no return value");
787
+ }
788
+ const processed = await nextProcessedPromise;
789
+ if (processed) yield processed;
778
790
  }
779
- const processed = await nextProcessedPromise;
780
- if (processed) yield processed;
791
+ } finally {
792
+ await iterator.return("");
781
793
  }
782
794
  }
783
795
  async processOneLabeledMessage(inboxEndpoint, result, inboxToken, recipient) {