bitwrench 2.0.25 → 2.0.30
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/README.md +10 -4
- package/dist/bitwrench-bccl.cjs.js +1 -1
- package/dist/bitwrench-bccl.cjs.min.js +1 -1
- package/dist/bitwrench-bccl.cjs.min.js.gz +0 -0
- package/dist/bitwrench-bccl.esm.js +1 -1
- package/dist/bitwrench-bccl.esm.min.js +1 -1
- package/dist/bitwrench-bccl.esm.min.js.gz +0 -0
- package/dist/bitwrench-bccl.umd.js +1 -1
- package/dist/bitwrench-bccl.umd.min.js +1 -1
- package/dist/bitwrench-bccl.umd.min.js.gz +0 -0
- package/dist/bitwrench-code-edit.cjs.js +1 -1
- package/dist/bitwrench-code-edit.cjs.min.js +1 -1
- package/dist/bitwrench-code-edit.es5.js +1 -1
- package/dist/bitwrench-code-edit.es5.min.js +1 -1
- package/dist/bitwrench-code-edit.esm.js +1 -1
- package/dist/bitwrench-code-edit.esm.min.js +1 -1
- package/dist/bitwrench-code-edit.umd.js +1 -1
- package/dist/bitwrench-code-edit.umd.min.js +1 -1
- package/dist/bitwrench-code-edit.umd.min.js.gz +0 -0
- package/dist/bitwrench-debug.js +1 -1
- package/dist/bitwrench-debug.min.js +1 -1
- package/dist/bitwrench-lean.cjs.js +623 -155
- package/dist/bitwrench-lean.cjs.min.js +7 -7
- package/dist/bitwrench-lean.cjs.min.js.gz +0 -0
- package/dist/bitwrench-lean.es5.js +650 -157
- package/dist/bitwrench-lean.es5.min.js +5 -5
- package/dist/bitwrench-lean.es5.min.js.gz +0 -0
- package/dist/bitwrench-lean.esm.js +623 -155
- package/dist/bitwrench-lean.esm.min.js +6 -6
- package/dist/bitwrench-lean.esm.min.js.gz +0 -0
- package/dist/bitwrench-lean.umd.js +623 -155
- package/dist/bitwrench-lean.umd.min.js +7 -7
- package/dist/bitwrench-lean.umd.min.js.gz +0 -0
- package/dist/bitwrench-util-css.cjs.js +1 -1
- package/dist/bitwrench-util-css.cjs.min.js +1 -1
- package/dist/bitwrench-util-css.es5.js +1 -1
- package/dist/bitwrench-util-css.es5.min.js +1 -1
- package/dist/bitwrench-util-css.esm.js +1 -1
- package/dist/bitwrench-util-css.esm.min.js +1 -1
- package/dist/bitwrench-util-css.umd.js +1 -1
- package/dist/bitwrench-util-css.umd.min.js +1 -1
- package/dist/bitwrench-util-css.umd.min.js.gz +0 -0
- package/dist/bitwrench.cjs.js +621 -153
- package/dist/bitwrench.cjs.min.js +6 -6
- package/dist/bitwrench.cjs.min.js.gz +0 -0
- package/dist/bitwrench.css +1 -1
- package/dist/bitwrench.d.ts +18 -11
- package/dist/bitwrench.es5.js +647 -154
- package/dist/bitwrench.es5.min.js +6 -6
- package/dist/bitwrench.es5.min.js.gz +0 -0
- package/dist/bitwrench.esm.js +621 -153
- package/dist/bitwrench.esm.min.js +5 -5
- package/dist/bitwrench.esm.min.js.gz +0 -0
- package/dist/bitwrench.umd.js +621 -153
- package/dist/bitwrench.umd.min.js +6 -6
- package/dist/bitwrench.umd.min.js.gz +0 -0
- package/dist/builds.json +95 -95
- package/dist/bwserve.cjs.js +140 -7
- package/dist/bwserve.esm.js +141 -8
- package/dist/sri.json +45 -45
- package/docs/bitwrench-for-wasm.md +851 -0
- package/docs/bitwrench_api.md +133 -23
- package/docs/llm-bitwrench-guide.md +6 -5
- package/docs/state-management.md +27 -3
- package/docs/thinking-in-bitwrench.md +3 -2
- package/package.json +11 -9
- package/readme.html +17 -8
- package/src/bitwrench.d.ts +18 -11
- package/src/bitwrench.js +617 -148
- package/src/bwserve/bwclient.js +3 -3
- package/src/bwserve/client.js +26 -0
- package/src/bwserve/index.js +110 -3
- package/src/cli/attach.js +7 -5
- package/src/cli/serve.js +53 -10
- package/src/version.js +3 -3
|
Binary file
|
package/dist/bitwrench.css
CHANGED
package/dist/bitwrench.d.ts
CHANGED
|
@@ -315,8 +315,8 @@ export interface Bitwrench {
|
|
|
315
315
|
html(taco: Taco | TacoContent, options?: { raw?: boolean; state?: Record<string, any> }): string;
|
|
316
316
|
/** Generate complete HTML page string */
|
|
317
317
|
htmlPage(opts: { title?: string; css?: string; content?: TacoContent; favicon?: string; [key: string]: any }): string;
|
|
318
|
-
/** Create DOM element from TACO (browser only) */
|
|
319
|
-
createDOM(taco: Taco | TacoContent, options?: Record<string, any>): HTMLElement | DocumentFragment;
|
|
318
|
+
/** Create DOM element from TACO (browser only). SVG TACOs ({t:'svg',...}) use createElementNS. */
|
|
319
|
+
createDOM(taco: Taco | TacoContent, options?: Record<string, any>): HTMLElement | SVGElement | DocumentFragment;
|
|
320
320
|
/** Mount TACO into target, replacing contents */
|
|
321
321
|
DOM(target: string | HTMLElement, taco: Taco | TacoContent, options?: Record<string, any>): void;
|
|
322
322
|
/** Mount TACO and return root element (for el.bw access) */
|
|
@@ -331,24 +331,28 @@ export interface Bitwrench {
|
|
|
331
331
|
update(target: string | HTMLElement): void;
|
|
332
332
|
/** Quick-patch element content or attribute */
|
|
333
333
|
patch(id: string | HTMLElement, content?: TacoContent, attr?: string): HTMLElement | null;
|
|
334
|
+
/** RFC 6902 JSON Patch on plain objects. Mutates and returns obj. @see bw.patch */
|
|
335
|
+
jsonPatch(obj: object, ops: Array<{ op: string; path: string; value?: any; from?: string }>): object;
|
|
334
336
|
/** Batch patch multiple elements */
|
|
335
337
|
patchAll(patches: Record<string, TacoContent> | Array<{ id: string; content?: TacoContent; attr?: string }>): Record<string, HTMLElement>;
|
|
336
338
|
/** Clean up lifecycle hooks, subscriptions, cache */
|
|
337
339
|
cleanup(element: HTMLElement): void;
|
|
338
340
|
|
|
339
341
|
// -- DOM Selection --------------------------------------------------------
|
|
340
|
-
/**
|
|
341
|
-
|
|
342
|
+
/** Resolve target to first matching element. Optional apply: string (textContent), function, TACO (mount), or array. @see bw.$ */
|
|
343
|
+
el(target: string | HTMLElement | null, apply?: string | number | boolean | Function | object | any[]): HTMLElement | null;
|
|
344
|
+
/** CSS selector to array of elements. Optional apply applied to each. @see bw.el */
|
|
345
|
+
$(selector: string | HTMLElement | HTMLElement[], apply?: string | number | boolean | Function | object | any[]): HTMLElement[];
|
|
342
346
|
/** Dispatch DOM event */
|
|
343
347
|
emit(target: string | HTMLElement, eventName: string, detail?: any): void;
|
|
344
348
|
/** Add event listener */
|
|
345
349
|
on(target: string | HTMLElement, eventName: string, handler: (e: Event) => void): void;
|
|
346
350
|
|
|
347
351
|
// -- Pub/Sub --------------------------------------------------------------
|
|
348
|
-
/** Publish to topic */
|
|
352
|
+
/** Publish to topic. Fires exact-match and wildcard subscribers. */
|
|
349
353
|
pub(topic: string, detail?: any): number;
|
|
350
|
-
/** Subscribe to topic; returns unsub() */
|
|
351
|
-
sub(topic: string, handler: (detail: any) => void, el?: HTMLElement): () => void;
|
|
354
|
+
/** Subscribe to topic (or wildcard pattern ending in '*'); returns unsub(). Handler receives (detail, topic). */
|
|
355
|
+
sub(topic: string, handler: (detail: any, topic?: string) => void, el?: HTMLElement): () => void;
|
|
352
356
|
/** Unsubscribe handler from topic */
|
|
353
357
|
unsub(topic: string, handler: Function): number;
|
|
354
358
|
|
|
@@ -365,8 +369,8 @@ export interface Bitwrench {
|
|
|
365
369
|
message(target: string | HTMLElement, action: string, data?: any): any;
|
|
366
370
|
/** Execute wire-protocol message object */
|
|
367
371
|
apply(msg: Record<string, any>): any;
|
|
368
|
-
/** Inspect element
|
|
369
|
-
inspect(target: string | HTMLElement): Record<string, any
|
|
372
|
+
/** Inspect DOM element and subtree, returning plain-object tree with bitwrench metadata */
|
|
373
|
+
inspect(target: string | HTMLElement, depth?: number): Record<string, any> | null;
|
|
370
374
|
|
|
371
375
|
// -- Function Registry ----------------------------------------------------
|
|
372
376
|
funcRegister(fn: Function, name?: string): string;
|
|
@@ -395,8 +399,10 @@ export interface Bitwrench {
|
|
|
395
399
|
loadStyles(config?: StyleConfig, scope?: string): StylesResult | void;
|
|
396
400
|
/** Load CSS reset */
|
|
397
401
|
loadReset(): void;
|
|
398
|
-
/**
|
|
399
|
-
|
|
402
|
+
/** Toggle between primary/alternate theme palettes on all matching elements. @see bw.applyStyles */
|
|
403
|
+
toggleThemeMode(scope?: string | HTMLElement): string;
|
|
404
|
+
/** @deprecated Use bw.toggleThemeMode() instead. Alias kept for one release cycle. */
|
|
405
|
+
toggleStyles(scope?: string | HTMLElement): string;
|
|
400
406
|
/** Remove injected styles */
|
|
401
407
|
clearStyles(scope?: string): void;
|
|
402
408
|
/** Generate type scale from base + ratio */
|
|
@@ -586,6 +592,7 @@ export interface Bitwrench {
|
|
|
586
592
|
|
|
587
593
|
// -- Internal (access at own risk) ----------------------------------------
|
|
588
594
|
_nodeMap: Record<string, HTMLElement>;
|
|
595
|
+
/** @deprecated Use bw.el() instead. Alias kept for one release cycle. */
|
|
589
596
|
_el(id: string): HTMLElement | null;
|
|
590
597
|
_registerNode(el: HTMLElement, uuid: string): void;
|
|
591
598
|
_deregisterNode(el: HTMLElement, uuid: string): void;
|