From 464fc54a0b45c5064309e674caf01d3acb3a190c Mon Sep 17 00:00:00 2001 From: marlon-erler Date: Tue, 9 Jul 2024 04:43:05 +0200 Subject: [PATCH] update --- static/bun.lockb | Bin 11434 -> 11417 bytes static/dist/index.js | 62 ++---------------- static/node_modules/bloatless-react/index.ts | 17 +++-- .../node_modules/bloatless-react/package.json | 2 +- static/package.json | 2 +- static/src/model.tsx | 4 +- 6 files changed, 15 insertions(+), 72 deletions(-) diff --git a/static/bun.lockb b/static/bun.lockb index a53018eefb31eb0f3cb08265e68e9c180623300b..843f3462f19ac89155e2ee531aa0affa5ad724ba 100755 GIT binary patch delta 1077 zcmYLIZAep57(VB=&lJ{jb6sybXPLor%#~7FO<}pna?T&&G83nhQWt?1Ld_P^hd(B+ zgIa`6RUw2D5%PPQ-51X_)uBcT zp{-C?044$205yOXzMsa|3czIO|Hj+9ze)1_dEFk zD{u)>RUvpiz_{d*crOYpmZv_X1TVY_cykE;Fp?1` zl|{NJ1?~#DlywP(-~MJ_QGD6x89VXQoi7XRtJWLu_=czsrnA5FVbwvqYHdR|Oq*|X zlr&tbTv0e*d3T)e^vun zS#R+V?}P-KO_seTGeVOP%zpFo!!yS1sp?0fGEV|}nh|#7K4TuATdqAN>J$m0DtWBklFYIXw$uQRkP|Kk%fjVMUSoK~!2vRXWWGOFrAb zC3R}|vP0AdNidzpW8^7J30K6O{717Q`lIXv5e5Y!=Es75$f)c`DiwlBf(-j(MoFE!d*9vr<37(h&vVXuxc9unuIH|M ztf`~?7V|q*xz(Az;0XHfw$}MxkLCEx>z3Z!V9~*!dY#{Sv|EP|ib2TRaMgY7a&tXu zrx8kk*aMgd=mb;)o)GexLYxSg1bGC=`N9-mw*tudgMgeqDa6BoT8Mjud_*#jS_^N>MxglVuBefe* z)wVy{1sLy}1;+Q2$Vjdd7=P{%Fn-dnz$zmB%yQyu0ml2LqdAE}=w~hmRtcX1z8v>^ z5R4Id+zoAYR$$@9fAQ?V$!6@Olc~{wOHr>ZSxufDJ*CPuel9G0vR6BprCnI|wy6g% zE_~W(nn>C@dp&e~raQ~fIk6_6d^;10KfILcGo;1r{<)p^s+igC#e3>I(ne^m#C~m2 z;ISr1VXsC)-4FC@Ju;mVlsFja$ZV+eQOx!L&CP}&>%|8QIz8FKQhAG0quD8-sqXX=SWT+s10WNZD+(~~GaR&8{=nCU+a6Y+ZeUg`#E~t)m zh&s84Hr35DYg5&3QOU$PCPq*0?c8_&c%ruKm#8~&or$45_y)Y&@dJ~OO2GQGbfuNG VvH3ZXT?v$=btz;*fZt@V{0D=k5gh;k diff --git a/static/dist/index.js b/static/dist/index.js index cebbe92..0f16080 100644 --- a/static/dist/index.js +++ b/static/dist/index.js @@ -1,57 +1,5 @@ (() => { - // node_modules/uuid/dist/esm-browser/stringify.js - var byteToHex = []; - for (i = 0; i < 256; ++i) { - byteToHex.push((i + 256).toString(16).slice(1)); - } - var i; - function unsafeStringify(arr, offset = 0) { - return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); - } - - // node_modules/uuid/dist/esm-browser/rng.js - var getRandomValues; - var rnds8 = new Uint8Array(16); - function rng() { - if (!getRandomValues) { - getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto); - if (!getRandomValues) { - throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported"); - } - } - return getRandomValues(rnds8); - } - - // node_modules/uuid/dist/esm-browser/native.js - var randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto); - var native_default = { - randomUUID - }; - - // node_modules/uuid/dist/esm-browser/v4.js - function v4(options, buf, offset) { - if (native_default.randomUUID && !buf && !options) { - return native_default.randomUUID(); - } - options = options || {}; - var rnds = options.random || (options.rng || rng)(); - rnds[6] = rnds[6] & 15 | 64; - rnds[8] = rnds[8] & 63 | 128; - if (buf) { - offset = offset || 0; - for (var i = 0; i < 16; ++i) { - buf[offset + i] = rnds[i]; - } - return buf; - } - return unsafeStringify(rnds); - } - var v4_default = v4; - // node_modules/bloatless-react/index.ts - function UUID() { - return v4_default(); - } var State = class { _value; _bindings = /* @__PURE__ */ new Set(); @@ -99,10 +47,9 @@ remove(...items) { items.forEach((item) => { this.value.delete(item); - const id = item.id; - if (!this.removalHandlers.has(id)) return; - this.removalHandlers.get(id)(item); - this.removalHandlers.delete(id); + if (!this.removalHandlers.has(item)) return; + this.removalHandlers.get(item)(item); + this.removalHandlers.delete(item); }); this.callSubscriptions(); } @@ -115,7 +62,7 @@ [...this.value.values()].forEach(handler); } handleRemoval(item, handler) { - this.removalHandlers.set(item.id, handler); + this.removalHandlers.set(item, handler); } // stringification toString() { @@ -425,7 +372,6 @@ this.channel = channel; this.body = body; } - id = UUID(); }; var isDisconnected = new State(true); var mailboxId = restoreState("mailbox-id", ""); diff --git a/static/node_modules/bloatless-react/index.ts b/static/node_modules/bloatless-react/index.ts index 4a4085a..d80f107 100755 --- a/static/node_modules/bloatless-react/index.ts +++ b/static/node_modules/bloatless-react/index.ts @@ -58,9 +58,9 @@ export class State { } } -export class ListState extends State> { +export class ListState extends State> { private additionHandlers = new Set>(); - private removalHandlers = new Map>(); + private removalHandlers = new Map>(); // init constructor(initialItems?: T[]) { @@ -79,11 +79,10 @@ export class ListState extends State> { remove(...items: T[]): void { items.forEach((item) => { this.value.delete(item); - const id = item.id; - if (!this.removalHandlers.has(id)) return; - this.removalHandlers.get(id)!(item); - this.removalHandlers.delete(id); + if (!this.removalHandlers.has(item)) return; + this.removalHandlers.get(item)!(item); + this.removalHandlers.delete(item); }); this.callSubscriptions(); } @@ -99,7 +98,7 @@ export class ListState extends State> { } handleRemoval(item: T, handler: RemovalSubscription): void { - this.removalHandlers.set(item.id, handler); + this.removalHandlers.set(item, handler); } // stringification @@ -144,7 +143,7 @@ export function restoreState( return state; } -export function restoreListState( +export function restoreListState( localStorageKey: string ): ListState { const storedString = localStorage.getItem(localStorageKey) ?? ""; @@ -163,7 +162,7 @@ export function restoreListState( return state; } -export type ListItemConverter = ( +export type ListItemConverter = ( item: T ) => HTMLElement; diff --git a/static/node_modules/bloatless-react/package.json b/static/node_modules/bloatless-react/package.json index 1e84a58..5b86dd5 100644 --- a/static/node_modules/bloatless-react/package.json +++ b/static/node_modules/bloatless-react/package.json @@ -1,6 +1,6 @@ { "name": "bloatless-react", - "version": "1.2.5-beta1", + "version": "1.2.6", "description": "very minimal and flexible react alternative", "repository": { "type": "git", diff --git a/static/package.json b/static/package.json index 459557d..eb23422 100644 --- a/static/package.json +++ b/static/package.json @@ -1,6 +1,6 @@ { "dependencies": { - "bloatless-react": "1.2.5-beta1", + "bloatless-react": "^1.2.6", "esbuild": "latest", "udn-frontend": "^1.0.6" }, diff --git a/static/src/model.tsx b/static/src/model.tsx index c653ba5..b6340e6 100644 --- a/static/src/model.tsx +++ b/static/src/model.tsx @@ -3,9 +3,7 @@ import * as React from "bloatless-react"; import UDNFrontend from "udn-frontend"; import { translations } from "./translations"; -export class Message implements React.Identifiable { - id = React.UUID(); - +export class Message { constructor(public channel: string, public body: string) {} }