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,8 @@
import { Reader } from '@jsonjoy.com/buffers/lib/Reader';
import type { BinaryJsonDecoder, PackValue } from '../types';
export declare class UbjsonDecoder implements BinaryJsonDecoder {
reader: Reader;
read(uint8: Uint8Array): PackValue;
decode(uint8: Uint8Array): unknown;
readAny(): PackValue;
}

View File

@@ -0,0 +1,128 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.UbjsonDecoder = void 0;
const Reader_1 = require("@jsonjoy.com/buffers/lib/Reader");
const JsonPackExtension_1 = require("../JsonPackExtension");
class UbjsonDecoder {
constructor() {
this.reader = new Reader_1.Reader();
}
read(uint8) {
this.reader.reset(uint8);
return this.readAny();
}
decode(uint8) {
this.reader.reset(uint8);
return this.readAny();
}
readAny() {
const reader = this.reader;
const octet = reader.u8();
switch (octet) {
case 0x5a:
return null;
case 0x54:
return true;
case 0x46:
return false;
case 0x55:
return reader.u8();
case 0x69:
return reader.i8();
case 0x49: {
const int = reader.view.getInt16(reader.x, false);
reader.x += 2;
return int;
}
case 0x6c: {
const int = reader.view.getInt32(reader.x, false);
reader.x += 4;
return int;
}
case 0x64: {
const num = reader.view.getFloat32(reader.x, false);
reader.x += 4;
return num;
}
case 0x44: {
const num = reader.view.getFloat64(reader.x, false);
reader.x += 8;
return num;
}
case 0x4c: {
const num = reader.view.getBigInt64(reader.x, false);
reader.x += 8;
return num;
}
case 0x53:
return reader.utf8(+this.readAny());
case 0x43:
return String.fromCharCode(reader.u8());
case 0x5b: {
const uint8 = reader.uint8;
const x = reader.x;
if (uint8[x] === 0x24 && uint8[x + 1] === 0x55 && uint8[x + 2] === 0x23) {
reader.x += 3;
const size = +this.readAny();
return reader.buf(size);
}
let type = -1;
if (uint8[x] === 0x24) {
reader.x++;
type = reader.u8();
}
let count = -1;
if (uint8[x] === 0x23) {
reader.x++;
count = reader.u8();
}
if (uint8[x] === 0x24) {
reader.x++;
type = reader.u8();
}
if (count >= 0) {
let wordSize = 1;
switch (type) {
case 0x49:
wordSize = 2;
break;
case 0x6c:
case 0x64:
wordSize = 4;
break;
case 0x44:
case 0x4c:
wordSize = 8;
break;
}
return new JsonPackExtension_1.JsonPackExtension(type, reader.buf(count * wordSize));
}
else {
const arr = [];
while (uint8[reader.x] !== 0x5d)
arr.push(this.readAny());
reader.x++;
return arr;
}
}
case 0x7b: {
const uint8 = reader.uint8;
const obj = {};
while (uint8[reader.x] !== 0x7d) {
const keySize = +this.readAny();
const key = reader.utf8(keySize);
if (key === '__proto__')
throw 6;
obj[key] = this.readAny();
}
reader.x++;
return obj;
}
case 0x4e:
return undefined;
}
return;
}
}
exports.UbjsonDecoder = UbjsonDecoder;
//# sourceMappingURL=UbjsonDecoder.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"UbjsonDecoder.js","sourceRoot":"","sources":["../../src/ubjson/UbjsonDecoder.ts"],"names":[],"mappings":";;;AAAA,4DAAuD;AACvD,4DAAuD;AAIvD,MAAa,aAAa;IAA1B;QACS,WAAM,GAAG,IAAI,eAAM,EAAE,CAAC;IAqH/B,CAAC;IAnHQ,IAAI,CAAC,KAAiB;QAC3B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACzB,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;IAEM,MAAM,CAAC,KAAiB;QAC7B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACzB,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;IACxB,CAAC;IAEM,OAAO;QACZ,MAAM,MAAM,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AM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;oBACjC,IAAI,GAAG,KAAK,WAAW;wBAAE,QAA+B;oBACxD,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;gBAC5B,CAAC;gBACD,MAAM,CAAC,CAAC,EAAE,CAAC;gBACX,OAAO,GAAG,CAAC;YACb,CAAC;YACD,KAAK,IAAI;gBACP,OAAO,SAAS,CAAC;QACrB,CAAC;QACD,OAAO;IACT,CAAC;CACF;AAtHD,sCAsHC"}

View File

@@ -0,0 +1,34 @@
import type { IWriter, IWriterGrowable } from '@jsonjoy.com/buffers/lib';
import type { BinaryJsonEncoder, StreamingBinaryJsonEncoder } from '../types';
export declare class UbjsonEncoder implements BinaryJsonEncoder, StreamingBinaryJsonEncoder {
readonly writer: IWriter & IWriterGrowable;
constructor(writer: IWriter & IWriterGrowable);
encode(value: unknown): Uint8Array;
writeAny(value: unknown): void;
writeNull(): void;
writeUndef(): void;
writeBoolean(bool: boolean): void;
writeNumber(num: number): void;
writeInteger(int: number): void;
writeUInteger(uint: number): void;
writeFloat(float: number): void;
writeBigInt(int: bigint): void;
writeBin(buf: Uint8Array): void;
writeStr(str: string): void;
writeAsciiStr(str: string): void;
writeArr(arr: unknown[]): void;
writeObj(obj: Record<string, unknown>): void;
writeKey(str: string): void;
writeStartStr(): void;
writeStrChunk(str: string): void;
writeEndStr(): void;
writeStartBin(): void;
writeBinChunk(buf: Uint8Array): void;
writeEndBin(): void;
writeStartArr(): void;
writeArrChunk(item: unknown): void;
writeEndArr(): void;
writeStartObj(): void;
writeObjChunk(key: string, value: unknown): void;
writeEndObj(): void;
}

View File

@@ -0,0 +1,218 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.UbjsonEncoder = void 0;
class UbjsonEncoder {
constructor(writer) {
this.writer = writer;
}
encode(value) {
const writer = this.writer;
writer.reset();
this.writeAny(value);
return writer.flush();
}
writeAny(value) {
switch (typeof value) {
case 'boolean':
return this.writeBoolean(value);
case 'number':
return this.writeNumber(value);
case 'string':
return this.writeStr(value);
case 'object': {
if (value === null)
return this.writeNull();
const constructor = value.constructor;
switch (constructor) {
case Array:
return this.writeArr(value);
case Uint8Array:
return this.writeBin(value);
default:
return this.writeObj(value);
}
}
case 'bigint':
return this.writeBigInt(value);
case 'undefined':
return this.writeUndef();
default:
return this.writeNull();
}
}
writeNull() {
this.writer.u8(0x5a);
}
writeUndef() {
this.writer.u8(0x4e);
}
writeBoolean(bool) {
this.writer.u8(bool ? 0x54 : 0x46);
}
writeNumber(num) {
if (num >> 0 === num)
return this.writeInteger(num);
this.writeFloat(num);
}
writeInteger(int) {
const writer = this.writer;
if (int <= 0xff && 0 <= int)
writer.u16(0x5500 | int);
else if (int <= 127 && -128 <= int) {
writer.u16(0x6900);
writer.view.setInt8(writer.x - 1, int);
}
else if (int <= 32767 && -32768 <= int) {
writer.ensureCapacity(3);
writer.u8(0x49);
writer.view.setInt16(writer.x, int, false);
writer.x += 2;
}
else if (int <= 2147483647 && -2147483648 <= int) {
writer.ensureCapacity(5);
writer.u8(0x6c);
writer.view.setInt32(writer.x, int, false);
writer.x += 4;
}
}
writeUInteger(uint) {
const writer = this.writer;
if (uint < 0xff)
writer.u16(0x5500 + uint);
}
writeFloat(float) {
const writer = this.writer;
writer.ensureCapacity(9);
const view = writer.view;
const x = writer.x;
view.setUint8(x, 0x44);
view.setFloat64(x + 1, float, false);
writer.x = x + 9;
}
writeBigInt(int) {
const writer = this.writer;
writer.ensureCapacity(9);
const view = writer.view;
const x = writer.x;
view.setUint8(x, 0x4c);
view.setBigInt64(x + 1, int, false);
writer.x = x + 9;
}
writeBin(buf) {
const writer = this.writer;
const length = buf.length;
writer.u32(1529107747);
this.writeInteger(length);
writer.buf(buf, length);
}
writeStr(str) {
const length = str.length;
const maxLength = length * 4;
const capacity = maxLength + 1 + 5;
const writer = this.writer;
writer.ensureCapacity(capacity);
const uint8 = writer.uint8;
uint8[writer.x++] = 0x53;
const x = writer.x;
const oneByteLength = maxLength < 0xff;
if (oneByteLength) {
uint8[writer.x++] = 0x55;
writer.x++;
}
else {
uint8[writer.x++] = 0x6c;
writer.x += 4;
}
const size = writer.utf8(str);
if (oneByteLength)
uint8[x + 1] = size;
else
writer.view.setUint32(x + 1, size);
}
writeAsciiStr(str) {
this.writeStr(str);
}
writeArr(arr) {
const writer = this.writer;
writer.u8(0x5b);
const length = arr.length;
for (let i = 0; i < length; i++)
this.writeAny(arr[i]);
writer.u8(0x5d);
}
writeObj(obj) {
const writer = this.writer;
const keys = Object.keys(obj);
const length = keys.length;
writer.u8(0x7b);
for (let i = 0; i < length; i++) {
const key = keys[i];
const value = obj[key];
this.writeKey(key);
this.writeAny(value);
}
writer.u8(0x7d);
}
writeKey(str) {
const length = str.length;
const maxLength = length * 4;
const capacity = maxLength + 5;
const writer = this.writer;
writer.ensureCapacity(capacity);
const uint8 = writer.uint8;
const x = writer.x;
const oneByteLength = maxLength < 0xff;
if (oneByteLength) {
uint8[writer.x++] = 0x55;
writer.x++;
}
else {
uint8[writer.x++] = 0x6c;
writer.x += 4;
}
const size = writer.utf8(str);
if (oneByteLength)
uint8[x + 1] = size;
else
writer.view.setUint32(x + 1, size);
}
writeStartStr() {
throw new Error('Method not implemented.');
}
writeStrChunk(str) {
throw new Error('Method not implemented.');
}
writeEndStr() {
throw new Error('Method not implemented.');
}
writeStartBin() {
throw new Error('Method not implemented.');
}
writeBinChunk(buf) {
throw new Error('Method not implemented.');
}
writeEndBin() {
throw new Error('Method not implemented.');
}
writeStartArr() {
this.writer.u8(0x5b);
}
writeArrChunk(item) {
this.writeAny(item);
}
writeEndArr() {
this.writer.u8(0x5d);
}
writeStartObj() {
this.writer.u8(0x7b);
}
writeObjChunk(key, value) {
this.writeKey(key);
this.writeAny(value);
}
writeEndObj() {
this.writer.u8(0x7d);
}
}
exports.UbjsonEncoder = UbjsonEncoder;
//# sourceMappingURL=UbjsonEncoder.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
export * from './UbjsonEncoder';
export * from './UbjsonDecoder';

View File

@@ -0,0 +1,6 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./UbjsonEncoder"), exports);
tslib_1.__exportStar(require("./UbjsonDecoder"), exports);
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ubjson/index.ts"],"names":[],"mappings":";;;AAAA,0DAAgC;AAChC,0DAAgC"}