Initial commit: notification-elements-demo app

Interactive Angular 19 demo for @sda/notification-elements-ui with
6 sections: Bell & Feed, Notification Center, Inbox, Comments &
Threads, Mention Input, and Full-Featured layout. Includes mock
data, dark mode toggle, and real-time event log.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Giuliano Silvestro
2026-02-13 21:49:19 +10:00
commit 5d0c9ec7eb
36473 changed files with 3778146 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
import { StreamingOctetReader } from '@jsonjoy.com/buffers/lib/StreamingOctetReader';
import { WsCloseFrame, WsFrameHeader } from './frames';
export declare class WsFrameDecoder {
readonly reader: StreamingOctetReader;
push(uint8: Uint8Array): void;
readFrameHeader(): WsFrameHeader | undefined;
readFrameData(frame: WsFrameHeader, remaining: number, dst: Uint8Array, pos: number): number;
copyFrameData(frame: WsFrameHeader, dst: Uint8Array, pos: number): void;
readCloseFrameData(frame: WsCloseFrame): void;
}

View File

@@ -0,0 +1,117 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.WsFrameDecoder = void 0;
const StreamingOctetReader_1 = require("@jsonjoy.com/buffers/lib/StreamingOctetReader");
const constants_1 = require("./constants");
const errors_1 = require("./errors");
const frames_1 = require("./frames");
class WsFrameDecoder {
constructor() {
this.reader = new StreamingOctetReader_1.StreamingOctetReader();
}
push(uint8) {
this.reader.push(uint8);
}
readFrameHeader() {
try {
const reader = this.reader;
if (reader.size() < 2)
return undefined;
const b0 = reader.u8();
const b1 = reader.u8();
const fin = (b0 >>> 7);
const opcode = b0 & 0b1111;
const maskBit = b1 >>> 7;
let length = b1 & 0b01111111;
if (length === 126) {
if (reader.size() < 2)
return undefined;
length = (reader.u8() << 8) | reader.u8();
}
else if (length === 127) {
if (reader.size() < 8)
return undefined;
reader.skip(4);
length = reader.u32();
}
let mask;
if (maskBit) {
if (reader.size() < 4)
return undefined;
mask = [reader.u8(), reader.u8(), reader.u8(), reader.u8()];
}
if (opcode >= constants_1.WsFrameOpcode.MIN_CONTROL_OPCODE) {
switch (opcode) {
case constants_1.WsFrameOpcode.CLOSE: {
return new frames_1.WsCloseFrame(fin, opcode, length, mask, 0, '');
}
case constants_1.WsFrameOpcode.PING: {
if (length > 125)
throw new errors_1.WsFrameDecodingError();
const data = mask ? reader.bufXor(length, mask, 0) : reader.buf(length);
return new frames_1.WsPingFrame(fin, opcode, length, mask, data);
}
case constants_1.WsFrameOpcode.PONG: {
if (length > 125)
throw new errors_1.WsFrameDecodingError();
const data = mask ? reader.bufXor(length, mask, 0) : reader.buf(length);
return new frames_1.WsPongFrame(fin, opcode, length, mask, data);
}
default: {
throw new errors_1.WsFrameDecodingError();
}
}
}
return new frames_1.WsFrameHeader(fin, opcode, length, mask);
}
catch (err) {
if (err instanceof RangeError)
return undefined;
throw err;
}
}
readFrameData(frame, remaining, dst, pos) {
const reader = this.reader;
const mask = frame.mask;
const readSize = Math.min(reader.size(), remaining);
if (!mask)
reader.copy(readSize, dst, pos);
else {
const alreadyRead = frame.length - remaining;
reader.copyXor(readSize, dst, pos, mask, alreadyRead);
}
return remaining - readSize;
}
copyFrameData(frame, dst, pos) {
const reader = this.reader;
const mask = frame.mask;
const readSize = frame.length;
if (!mask)
reader.copy(readSize, dst, pos);
else
reader.copyXor(readSize, dst, pos, mask, 0);
}
readCloseFrameData(frame) {
let length = frame.length;
if (length > 125)
throw new errors_1.WsFrameDecodingError();
let code = 0;
let reason = '';
if (length > 0) {
if (length < 2)
throw new errors_1.WsFrameDecodingError();
const reader = this.reader;
const mask = frame.mask;
const octet1 = reader.u8() ^ (mask ? mask[0] : 0);
const octet2 = reader.u8() ^ (mask ? mask[1] : 0);
code = (octet1 << 8) | octet2;
length -= 2;
if (length)
reason = reader.utf8(length, mask ?? [0, 0, 0, 0], 2);
}
frame.code = code;
frame.reason = reason;
}
}
exports.WsFrameDecoder = WsFrameDecoder;
//# sourceMappingURL=WsFrameDecoder.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"WsFrameDecoder.js","s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AAI,GAAG,IAAI,CAAC;QAClB,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;IACxB,CAAC;CACF;AAjHD,wCAiHC"}

View File

@@ -0,0 +1,17 @@
import { WsFrameOpcode } from './constants';
import type { IWriter, IWriterGrowable } from '@jsonjoy.com/util/lib/buffers';
export declare class WsFrameEncoder<W extends IWriter & IWriterGrowable = IWriter & IWriterGrowable> {
readonly writer: W;
constructor(writer?: W);
encodePing(data: Uint8Array | null): Uint8Array;
encodePong(data: Uint8Array | null): Uint8Array;
encodeClose(reason: string, code?: number): Uint8Array;
encodeHdr(fin: 0 | 1, opcode: WsFrameOpcode, length: number, mask: number): Uint8Array;
encodeDataMsgHdrFast(length: number): Uint8Array;
writePing(data: Uint8Array | null): void;
writePong(data: Uint8Array | null): void;
writeClose(reason: string, code?: number): void;
writeHdr(fin: 0 | 1, opcode: WsFrameOpcode, length: number, mask: number): void;
writeDataMsgHdrFast(length: number): void;
writeBufXor(buf: Uint8Array, mask: number): void;
}

View File

@@ -0,0 +1,125 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.WsFrameEncoder = void 0;
const Writer_1 = require("@jsonjoy.com/util/lib/buffers/Writer");
const constants_1 = require("./constants");
const errors_1 = require("./errors");
const maskBuf = new Uint8Array(4);
const maskBufView = new DataView(maskBuf.buffer, maskBuf.byteOffset, maskBuf.byteLength);
class WsFrameEncoder {
constructor(writer = new Writer_1.Writer()) {
this.writer = writer;
}
encodePing(data) {
this.writePing(data);
return this.writer.flush();
}
encodePong(data) {
this.writePong(data);
return this.writer.flush();
}
encodeClose(reason, code = 0) {
this.writeClose(reason, code);
return this.writer.flush();
}
encodeHdr(fin, opcode, length, mask) {
this.writeHdr(fin, opcode, length, mask);
return this.writer.flush();
}
encodeDataMsgHdrFast(length) {
this.writeDataMsgHdrFast(length);
return this.writer.flush();
}
writePing(data) {
let length = 0;
if (data && (length = data.length)) {
this.writeHdr(1, constants_1.WsFrameOpcode.PING, length, 0);
this.writer.buf(data, length);
}
else {
this.writeHdr(1, constants_1.WsFrameOpcode.PING, 0, 0);
}
}
writePong(data) {
let length = 0;
if (data && (length = data.length)) {
this.writeHdr(1, constants_1.WsFrameOpcode.PONG, length, 0);
this.writer.buf(data, length);
}
else {
this.writeHdr(1, constants_1.WsFrameOpcode.PONG, 0, 0);
}
}
writeClose(reason, code = 0) {
if (reason || code) {
const reasonLength = reason.length;
const length = 2 + reasonLength;
const writer = this.writer;
writer.ensureCapacity(2 +
2 +
reasonLength * 4);
const lengthX = writer.x + 1;
this.writeHdr(1, constants_1.WsFrameOpcode.CLOSE, length, 0);
writer.u16(code);
if (reasonLength) {
const utf8Length = writer.utf8(reason);
if (utf8Length !== reasonLength) {
if (utf8Length > 126 - 2)
throw new errors_1.WsFrameEncodingError();
writer.uint8[lengthX] = (writer.uint8[lengthX] & 0b10000000) | (utf8Length + 2);
}
}
}
else {
this.writeHdr(1, constants_1.WsFrameOpcode.CLOSE, 0, 0);
}
}
writeHdr(fin, opcode, length, mask) {
const octet1 = (fin << 7) | opcode;
const maskBit = mask ? 0b10000000 : 0b00000000;
const writer = this.writer;
if (length < 126) {
const octet2 = maskBit | length;
writer.u16((octet1 << 8) | octet2);
}
else if (length < 0x10000) {
const octet2 = maskBit | 126;
writer.u32(((octet1 << 8) | octet2) * 0x10000 + length);
}
else {
const octet2 = maskBit | 127;
writer.u16((octet1 << 8) | octet2);
writer.u32(0);
writer.u32(length);
}
if (mask)
writer.u32(mask);
}
writeDataMsgHdrFast(length) {
const writer = this.writer;
if (length < 126) {
writer.u16(33280 + length);
return;
}
if (length < 0x10000) {
writer.u32(2189295616 + length);
return;
}
writer.u16(33407);
writer.u32(0);
writer.u32(length);
}
writeBufXor(buf, mask) {
maskBufView.setUint32(0, mask, false);
const writer = this.writer;
const length = buf.length;
writer.ensureCapacity(length);
let x = writer.x;
const uint8 = writer.uint8;
for (let i = 0; i < length; i++)
uint8[x++] = buf[i] ^ maskBuf[i & 3];
writer.x = x;
}
}
exports.WsFrameEncoder = WsFrameEncoder;
//# sourceMappingURL=WsFrameEncoder.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"WsFrameEncoder.js","sourceRoot":"","sources":["../../src/ws/WsFrameEncoder.ts"],"names":[],"mappings":";;;AAAA,iEAA4D;AAC5D,2CAA0C;AAC1C,qCAA8C;AAG9C,MAAM,OAAO,GAAG,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC;AAClC,MAAM,WAAW,GAAG,IAAI,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;AAEzF,MAAa,cAAc;IACzB,YAA4B,SAAY,IAAI,eAAM,EAAS;QAA/B,WAAM,GAAN,MAAM,CAAyB;IAAG,CAAC;IAExD,UAAU,CAAC,IAAuB;QACvC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACrB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IAC7B,CAAC;IAEM,UAAU,CAAC,IAAuB;QACvC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACrB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IAC7B,CAAC;IAEM,WAAW,CAAC,MAAc,EAAE,IAAI,GAAG,CAAC;QACzC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC9B,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IAC7B,CAAC;IAEM,SAAS,CAAC,GAAU,EAAE,MAAqB,EAAE,MAAc,EAAE,IAAY;QAC9E,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QACzC,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IAC7B,CAAC;IAEM,oBAAoB,CAAC,MAAc;QACxC,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC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C,MAAM,CAAC;QAC3B,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;QAC1B,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QAC9B,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC;QACjB,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAC3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE;YAAE,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACtE,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC;IACf,CAAC;CACF;AArHD,wCAqHC"}

View File

@@ -0,0 +1,9 @@
export declare enum WsFrameOpcode {
CONTINUE = 0,
TEXT = 1,
BINARY = 2,
MIN_CONTROL_OPCODE = 8,
CLOSE = 8,
PING = 9,
PONG = 10
}

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.WsFrameOpcode = void 0;
var WsFrameOpcode;
(function (WsFrameOpcode) {
WsFrameOpcode[WsFrameOpcode["CONTINUE"] = 0] = "CONTINUE";
WsFrameOpcode[WsFrameOpcode["TEXT"] = 1] = "TEXT";
WsFrameOpcode[WsFrameOpcode["BINARY"] = 2] = "BINARY";
WsFrameOpcode[WsFrameOpcode["MIN_CONTROL_OPCODE"] = 8] = "MIN_CONTROL_OPCODE";
WsFrameOpcode[WsFrameOpcode["CLOSE"] = 8] = "CLOSE";
WsFrameOpcode[WsFrameOpcode["PING"] = 9] = "PING";
WsFrameOpcode[WsFrameOpcode["PONG"] = 10] = "PONG";
})(WsFrameOpcode || (exports.WsFrameOpcode = WsFrameOpcode = {}));
//# sourceMappingURL=constants.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/ws/constants.ts"],"names":[],"mappings":";;;AAAA,IAAY,aAeX;AAfD,WAAY,aAAa;IAEvB,yDAAY,CAAA;IAGZ,iDAAQ,CAAA;IACR,qDAAU,CAAA;IAIV,6EAAsB,CAAA;IAEtB,mDAAS,CAAA;IACT,iDAAQ,CAAA;IACR,kDAAS,CAAA;AACX,CAAC,EAfW,aAAa,6BAAb,aAAa,QAexB"}

View File

@@ -0,0 +1,6 @@
export declare class WsFrameDecodingError extends Error {
constructor();
}
export declare class WsFrameEncodingError extends Error {
constructor();
}

16
node_modules/@jsonjoy.com/json-pack/lib/ws/errors.js generated vendored Normal file
View File

@@ -0,0 +1,16 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.WsFrameEncodingError = exports.WsFrameDecodingError = void 0;
class WsFrameDecodingError extends Error {
constructor() {
super('WS_FRAME_DECODING');
}
}
exports.WsFrameDecodingError = WsFrameDecodingError;
class WsFrameEncodingError extends Error {
constructor() {
super('WS_FRAME_ENCODING');
}
}
exports.WsFrameEncodingError = WsFrameEncodingError;
//# sourceMappingURL=errors.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/ws/errors.ts"],"names":[],"mappings":";;;AAAA,MAAa,oBAAqB,SAAQ,KAAK;IAC7C;QACE,KAAK,CAAC,mBAAmB,CAAC,CAAC;IAC7B,CAAC;CACF;AAJD,oDAIC;AAED,MAAa,oBAAqB,SAAQ,KAAK;IAC7C;QACE,KAAK,CAAC,mBAAmB,CAAC,CAAC;IAC7B,CAAC;CACF;AAJD,oDAIC"}

20
node_modules/@jsonjoy.com/json-pack/lib/ws/frames.d.ts generated vendored Normal file
View File

@@ -0,0 +1,20 @@
export declare class WsFrameHeader {
readonly fin: 0 | 1;
readonly opcode: number;
readonly length: number;
readonly mask: undefined | [number, number, number, number];
constructor(fin: 0 | 1, opcode: number, length: number, mask: undefined | [number, number, number, number]);
}
export declare class WsPingFrame extends WsFrameHeader {
readonly data: Uint8Array;
constructor(fin: 0 | 1, opcode: number, length: number, mask: undefined | [number, number, number, number], data: Uint8Array);
}
export declare class WsPongFrame extends WsFrameHeader {
readonly data: Uint8Array;
constructor(fin: 0 | 1, opcode: number, length: number, mask: undefined | [number, number, number, number], data: Uint8Array);
}
export declare class WsCloseFrame extends WsFrameHeader {
code: number;
reason: string;
constructor(fin: 0 | 1, opcode: number, length: number, mask: undefined | [number, number, number, number], code: number, reason: string);
}

35
node_modules/@jsonjoy.com/json-pack/lib/ws/frames.js generated vendored Normal file
View File

@@ -0,0 +1,35 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.WsCloseFrame = exports.WsPongFrame = exports.WsPingFrame = exports.WsFrameHeader = void 0;
class WsFrameHeader {
constructor(fin, opcode, length, mask) {
this.fin = fin;
this.opcode = opcode;
this.length = length;
this.mask = mask;
}
}
exports.WsFrameHeader = WsFrameHeader;
class WsPingFrame extends WsFrameHeader {
constructor(fin, opcode, length, mask, data) {
super(fin, opcode, length, mask);
this.data = data;
}
}
exports.WsPingFrame = WsPingFrame;
class WsPongFrame extends WsFrameHeader {
constructor(fin, opcode, length, mask, data) {
super(fin, opcode, length, mask);
this.data = data;
}
}
exports.WsPongFrame = WsPongFrame;
class WsCloseFrame extends WsFrameHeader {
constructor(fin, opcode, length, mask, code, reason) {
super(fin, opcode, length, mask);
this.code = code;
this.reason = reason;
}
}
exports.WsCloseFrame = WsCloseFrame;
//# sourceMappingURL=frames.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"frames.js","sourceRoot":"","sources":["../../src/ws/frames.ts"],"names":[],"mappings":";;;AAAA,MAAa,aAAa;IACxB,YACkB,GAAU,EACV,MAAc,EACd,MAAc,EACd,IAAkD;QAHlD,QAAG,GAAH,GAAG,CAAO;QACV,WAAM,GAAN,MAAM,CAAQ;QACd,WAAM,GAAN,MAAM,CAAQ;QACd,SAAI,GAAJ,IAAI,CAA8C;IACjE,CAAC;CACL;AAPD,sCAOC;AAED,MAAa,WAAY,SAAQ,aAAa;IAC5C,YACE,GAAU,EACV,MAAc,EACd,MAAc,EACd,IAAkD,EAClC,IAAgB;QAEhC,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QAFjB,SAAI,GAAJ,IAAI,CAAY;IAGlC,CAAC;CACF;AAVD,kCAUC;AAED,MAAa,WAAY,SAAQ,aAAa;IAC5C,YACE,GAAU,EACV,MAAc,EACd,MAAc,EACd,IAAkD,EAClC,IAAgB;QAEhC,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QAFjB,SAAI,GAAJ,IAAI,CAAY;IAGlC,CAAC;CACF;AAVD,kCAUC;AAED,MAAa,YAAa,SAAQ,aAAa;IAC7C,YACE,GAAU,EACV,MAAc,EACd,MAAc,EACd,IAAkD,EAC3C,IAAY,EACZ,MAAc;QAErB,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,CAAC;QAH1B,SAAI,GAAJ,IAAI,CAAQ;QACZ,WAAM,GAAN,MAAM,CAAQ;IAGvB,CAAC;CACF;AAXD,oCAWC"}

View File

@@ -0,0 +1,5 @@
export * from './constants';
export * from './errors';
export * from './frames';
export * from './WsFrameDecoder';
export * from './WsFrameEncoder';

9
node_modules/@jsonjoy.com/json-pack/lib/ws/index.js generated vendored Normal file
View File

@@ -0,0 +1,9 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./constants"), exports);
tslib_1.__exportStar(require("./errors"), exports);
tslib_1.__exportStar(require("./frames"), exports);
tslib_1.__exportStar(require("./WsFrameDecoder"), exports);
tslib_1.__exportStar(require("./WsFrameEncoder"), exports);
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ws/index.ts"],"names":[],"mappings":";;;AAAA,sDAA4B;AAC5B,mDAAyB;AACzB,mDAAyB;AACzB,2DAAiC;AACjC,2DAAiC"}