bitwrench 2.0.20 → 2.0.22

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.
Files changed (53) hide show
  1. package/README.md +0 -4
  2. package/dist/bitwrench-bccl.cjs.js +1 -1
  3. package/dist/bitwrench-bccl.cjs.min.js +1 -1
  4. package/dist/bitwrench-bccl.esm.js +1 -1
  5. package/dist/bitwrench-bccl.esm.min.js +1 -1
  6. package/dist/bitwrench-bccl.umd.js +1 -1
  7. package/dist/bitwrench-bccl.umd.min.js +1 -1
  8. package/dist/bitwrench-code-edit.cjs.js +1 -1
  9. package/dist/bitwrench-code-edit.cjs.min.js +1 -1
  10. package/dist/bitwrench-code-edit.es5.js +1 -1
  11. package/dist/bitwrench-code-edit.es5.min.js +1 -1
  12. package/dist/bitwrench-code-edit.esm.js +1 -1
  13. package/dist/bitwrench-code-edit.esm.min.js +1 -1
  14. package/dist/bitwrench-code-edit.umd.js +1 -1
  15. package/dist/bitwrench-code-edit.umd.min.js +1 -1
  16. package/dist/bitwrench-debug.js +1 -1
  17. package/dist/bitwrench-debug.min.js +1 -1
  18. package/dist/bitwrench-lean.cjs.js +344 -30
  19. package/dist/bitwrench-lean.cjs.min.js +14 -6
  20. package/dist/bitwrench-lean.es5.js +379 -29
  21. package/dist/bitwrench-lean.es5.min.js +12 -4
  22. package/dist/bitwrench-lean.esm.js +344 -30
  23. package/dist/bitwrench-lean.esm.min.js +14 -6
  24. package/dist/bitwrench-lean.umd.js +344 -30
  25. package/dist/bitwrench-lean.umd.min.js +14 -6
  26. package/dist/bitwrench-util-css.cjs.js +1 -1
  27. package/dist/bitwrench-util-css.cjs.min.js +1 -1
  28. package/dist/bitwrench-util-css.es5.js +1 -1
  29. package/dist/bitwrench-util-css.es5.min.js +1 -1
  30. package/dist/bitwrench-util-css.esm.js +1 -1
  31. package/dist/bitwrench-util-css.esm.min.js +1 -1
  32. package/dist/bitwrench-util-css.umd.js +1 -1
  33. package/dist/bitwrench-util-css.umd.min.js +1 -1
  34. package/dist/bitwrench.cjs.js +344 -30
  35. package/dist/bitwrench.cjs.min.js +14 -6
  36. package/dist/bitwrench.css +65 -14
  37. package/dist/bitwrench.es5.js +379 -29
  38. package/dist/bitwrench.es5.min.js +13 -5
  39. package/dist/bitwrench.esm.js +344 -30
  40. package/dist/bitwrench.esm.min.js +15 -7
  41. package/dist/bitwrench.min.css +1 -1
  42. package/dist/bitwrench.umd.js +344 -30
  43. package/dist/bitwrench.umd.min.js +14 -6
  44. package/dist/builds.json +87 -87
  45. package/dist/bwserve.cjs.js +2 -2
  46. package/dist/bwserve.esm.js +2 -2
  47. package/dist/sri.json +46 -46
  48. package/package.json +5 -6
  49. package/readme.html +3 -3
  50. package/src/bitwrench-router.js +282 -0
  51. package/src/bitwrench-styles.js +59 -27
  52. package/src/bitwrench.js +6 -0
  53. package/src/version.js +3 -3
package/README.md CHANGED
@@ -26,8 +26,6 @@ bw.html(page); // -> HTML string (Node.js, emails, SSR)
26
26
 
27
27
  Each object has four keys: **t** (tag), **a** (attributes), **c** (content), **o** (options for state/lifecycle). Nest them, loop them, compose them -- it's just JavaScript.
28
28
 
29
- ![Hero example output](./images/hero-example.png)
30
-
31
29
  ### Why bitwrench?
32
30
 
33
31
  **One file, everywhere.** At ~38KB gzipped with zero dependencies, bitwrench runs on anything with a browser -- phones, tablets, Raspberry Pi, even ESP32 microcontrollers. The device serves a single HTML page and pushes data as JSON; bitwrench handles all rendering, styling, and state on the client. No Node.js, no build step, no internet connection required.
@@ -302,8 +300,6 @@ All formats include source maps. A separate CSS file (`bitwrench.css`) is also a
302
300
 
303
301
  **Is this a framework?** -- No. Bitwrench is a library (~38KB gzipped). No lifecycle to learn, no project structure to follow. Import it, call functions, done.
304
302
 
305
- **Does it scale to large apps?** -- Bitwrench targets single-page tools, dashboards, prototypes, embedded UIs, and content sites -- apps where a single HTML file or a handful of files is the right form factor. For a 500-route SPA with team-scale state management, React or Vue is a better fit.
306
-
307
303
  **How does bitwrench compare to React/Vue?** -- They solve different problems at different scales. React and Vue provide a component model, virtual DOM, and ecosystem for large team-built SPAs. Bitwrench provides rendering and state primitives in a single file with no build step, aimed at single-page tools, dashboards, embedded devices, and server-driven UIs. They coexist fine -- use whichever fits the job.
308
304
 
309
305
  **How does CSS work?** -- Bitwrench doesn't own your CSS. Use any external stylesheet, Tailwind, or CSS file you want -- bitwrench doesn't interfere. On top of that, `bw.css()` generates CSS from JS objects (with `@media`, `@keyframes`, pseudo-classes), `bw.s()` composes inline style objects, and `bw.loadStyles()` derives a complete design system from 2 seed colors. You can use all three together or none at all.
@@ -1,4 +1,4 @@
1
- /*! bitwrench-bccl v2.0.20 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
1
+ /*! bitwrench-bccl v2.0.22 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
2
2
  'use strict';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- /*! bitwrench-bccl v2.0.20 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
1
+ /*! bitwrench-bccl v2.0.22 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
2
2
  "use strict";
3
3
  /**
4
4
  * Bitwrench v2 Components
@@ -1,4 +1,4 @@
1
- /*! bitwrench-bccl v2.0.20 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
1
+ /*! bitwrench-bccl v2.0.22 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
2
2
  /**
3
3
  * Bitwrench v2 Components
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! bitwrench-bccl v2.0.20 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
1
+ /*! bitwrench-bccl v2.0.22 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
2
2
  /**
3
3
  * Bitwrench v2 Components
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! bitwrench-bccl v2.0.20 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
1
+ /*! bitwrench-bccl v2.0.22 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
4
4
  typeof define === 'function' && define.amd ? define(['exports'], factory) :
@@ -1,4 +1,4 @@
1
- /*! bitwrench-bccl v2.0.20 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
1
+ /*! bitwrench-bccl v2.0.22 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
2
2
  !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).bwBCCL={})}(this,function(e){"use strict";
3
3
  /**
4
4
  * Bitwrench v2 Components
@@ -1,4 +1,4 @@
1
- /*! bitwrench v2.0.20 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
1
+ /*! bitwrench v2.0.22 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
2
2
  'use strict';
3
3
 
4
4
  Object.defineProperty(exports, '__esModule', { value: true });
@@ -1,4 +1,4 @@
1
- /*! bitwrench v2.0.20 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
1
+ /*! bitwrench v2.0.22 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
2
2
  "use strict";Object.defineProperty(exports,"__esModule",{value:!0});
3
3
  /**
4
4
  * bitwrench-code-edit.js - syntax-highlighted contenteditable code editor addon
@@ -1,4 +1,4 @@
1
- /*! bitwrench v2.0.20 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
1
+ /*! bitwrench v2.0.22 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
4
4
  typeof define === 'function' && define.amd ? define(['exports'], factory) :
@@ -1,4 +1,4 @@
1
- /*! bitwrench v2.0.20 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
1
+ /*! bitwrench v2.0.22 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
2
2
  !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).bwCodeEdit={})}(this,function(e){"use strict";
3
3
  /**
4
4
  * bitwrench-code-edit.js - syntax-highlighted contenteditable code editor addon
@@ -1,4 +1,4 @@
1
- /*! bitwrench v2.0.20 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
1
+ /*! bitwrench v2.0.22 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
2
2
  /**
3
3
  * bitwrench-code-edit.js - syntax-highlighted contenteditable code editor addon
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! bitwrench v2.0.20 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
1
+ /*! bitwrench v2.0.22 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
2
2
  /**
3
3
  * bitwrench-code-edit.js - syntax-highlighted contenteditable code editor addon
4
4
  *
@@ -1,4 +1,4 @@
1
- /*! bitwrench v2.0.20 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
1
+ /*! bitwrench v2.0.22 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
4
4
  typeof define === 'function' && define.amd ? define(['exports'], factory) :
@@ -1,4 +1,4 @@
1
- /*! bitwrench v2.0.20 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
1
+ /*! bitwrench v2.0.22 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
2
2
  !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).bwCodeEdit={})}(this,function(e){"use strict";
3
3
  /**
4
4
  * bitwrench-code-edit.js - syntax-highlighted contenteditable code editor addon
@@ -1,4 +1,4 @@
1
- /*! bitwrench-debug v2.0.20 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
1
+ /*! bitwrench-debug v2.0.22 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
4
4
  typeof define === 'function' && define.amd ? define(factory) :
@@ -1,3 +1,3 @@
1
- /*! bitwrench-debug v2.0.20 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
1
+ /*! bitwrench-debug v2.0.22 | BSD-2-Clause | https://deftio.github.com/bitwrench/pages */
2
2
  !function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(e="undefined"!=typeof globalThis?globalThis:e||self).bwd=n()}(this,function(){"use strict";function e(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var n={exports:{}};return function(e){!function(){var n={};function o(e){return new Promise(function(n,o){var t=document.createElement("script");t.src=e,t.onload=function(){n()},t.onerror=function(){o(new Error("Failed to load "+e))},document.head.appendChild(t)})}function t(e,n,o){if(!e||n>o)return null;var l={tag:e.tagName?e.tagName.toLowerCase():"#text"};if(e.id&&(l.id=e.id),e.className&&"string"==typeof e.className&&(l.cls=e.className.split(" ").slice(0,5).join(" ")),e.children&&e.children.length>0&&n<o){l.children=[];for(var i=0;i<Math.min(e.children.length,20);i++){var r=t(e.children[i],n+1,o);r&&l.children.push(r)}}return l}function l(e,n){if(e){var o=e.tag||"?";if(e.id&&(o+="#"+e.id),e.cls&&(o+="."+e.cls.split(" ").join(".")),console.log(" ".repeat(n)+o),e.children)for(var t=0;t<e.children.length;t++)l(e.children[t],n+1)}}var i={tree:function(e,n){e=e||"body",n=n||3;var o=document.querySelector(e);if(!o)return console.log('(no element found for "'+e+'")'),null;var i=t(o,0,n);return l(i,0),i},listen:function(e,o){var t=e+":::"+o;if(n[t])console.log("[bwd] already listening for "+o+" on "+e);else{var l=function(n){var t=n.target.closest?n.target.closest(e):null;t&&console.log("[bwd] "+o+" on "+e+" -> "+t.tagName+(t.id?"#"+t.id:"")+(t.textContent?' "'+t.textContent.slice(0,50).trim()+'"':""))};document.addEventListener(o,l,!0),n[t]={fn:l,event:o},console.log("[bwd] listening for "+o+" on "+e)}},unlisten:function(e,o){var t=e+":::"+o,l=n[t];l?(document.removeEventListener(l.event,l.fn,!0),delete n[t],console.log("[bwd] stopped listening for "+o+" on "+e)):console.log("[bwd] no listener for "+o+" on "+e)},state:function(e){e=e||".bw_lc";for(var n=document.querySelectorAll(e),o=[],t=0;t<n.length;t++){var l=n[t],i="";"undefined"!=typeof window&&window.bw&&window.bw.getUUID&&(i=window.bw.getUUID(l)||""),o.push({id:l.id||"",uuid:i,state:l._bw_state||null})}return 0===o.length?console.log('[bwd] no stateful elements found for "'+e+'"'):"function"==typeof console.table?console.table(o):console.log(o),o},screenshot:function(e){e=e||"body";var n=document.querySelector(e);return n?("undefined"!=typeof window&&window.html2canvas?Promise.resolve(window.html2canvas):o("https://cdn.jsdelivr.net/npm/html2canvas@1.4.1/dist/html2canvas.min.js").then(function(){return window.html2canvas})).then(function(o){return console.log("[bwd] capturing "+e+" ..."),o(n,{useCORS:!0})}).then(function(e){var n="screenshot-"+Date.now()+".png";e.toBlob(function(e){if("undefined"!=typeof window&&window.bw&&window.bw.saveClientFile)window.bw.saveClientFile(n,e);else{var o=document.createElement("a");o.href=URL.createObjectURL(e),o.download=n,o.click(),URL.revokeObjectURL(o.href)}console.log("[bwd] saved: "+n)})}).catch(function(e){console.error("[bwd] screenshot failed: "+e.message)}):(console.log('[bwd] no element found for "'+e+'"'),Promise.resolve(null))},_listeners:n};function r(){console.log("[bwd] bitwrench debug toolkit ready"),console.log(" bwd.tree(sel?, depth?) -- print DOM tree"),console.log(" bwd.listen(sel, event) -- log events"),console.log(" bwd.unlisten(sel, event) -- stop logging"),console.log(" bwd.state(sel?) -- dump stateful elements"),console.log(" bwd.screenshot(sel?) -- capture screenshot")}e.exports&&(e.exports=i),"undefined"!=typeof window&&(window.bwd=i),"undefined"!=typeof window&&(window.bw&&window.bw.version?r():(console.log("[bwd] bitwrench not detected, loading from CDN..."),o("https://cdn.jsdelivr.net/npm/bitwrench@2/dist/bitwrench.umd.min.js").then(function(){r()}).catch(function(e){console.warn("[bwd] could not load bitwrench: "+e.message),console.log("[bwd] toolkit ready (limited -- bw.* not available)"),console.log(" bwd.tree, bwd.listen, bwd.unlisten still work")})))}()}(n),e(n.exports)});
3
3
  //# sourceMappingURL=bitwrench-debug.min.js.map