bitwrench 2.0.14 → 2.0.16

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 (61) hide show
  1. package/README.md +57 -21
  2. package/dist/bitwrench-bccl.cjs.js +3746 -0
  3. package/dist/bitwrench-bccl.cjs.min.js +40 -0
  4. package/dist/bitwrench-bccl.esm.js +3741 -0
  5. package/dist/bitwrench-bccl.esm.min.js +40 -0
  6. package/dist/bitwrench-bccl.umd.js +3752 -0
  7. package/dist/bitwrench-bccl.umd.min.js +40 -0
  8. package/dist/bitwrench-code-edit.cjs.js +99 -49
  9. package/dist/bitwrench-code-edit.cjs.min.js +23 -0
  10. package/dist/bitwrench-code-edit.es5.js +79 -16
  11. package/dist/bitwrench-code-edit.es5.min.js +9 -2
  12. package/dist/bitwrench-code-edit.esm.js +99 -49
  13. package/dist/bitwrench-code-edit.esm.min.js +9 -2
  14. package/dist/bitwrench-code-edit.umd.js +99 -49
  15. package/dist/bitwrench-code-edit.umd.min.js +9 -2
  16. package/dist/bitwrench-lean.cjs.js +4923 -3248
  17. package/dist/bitwrench-lean.cjs.min.js +35 -6
  18. package/dist/bitwrench-lean.es5.js +6325 -4580
  19. package/dist/bitwrench-lean.es5.min.js +32 -3
  20. package/dist/bitwrench-lean.esm.js +4923 -3248
  21. package/dist/bitwrench-lean.esm.min.js +35 -6
  22. package/dist/bitwrench-lean.umd.js +4923 -3248
  23. package/dist/bitwrench-lean.umd.min.js +35 -6
  24. package/dist/bitwrench.cjs.js +5082 -3667
  25. package/dist/bitwrench.cjs.min.js +38 -8
  26. package/dist/bitwrench.css +2289 -6034
  27. package/dist/bitwrench.es5.js +6862 -5346
  28. package/dist/bitwrench.es5.min.js +34 -5
  29. package/dist/bitwrench.esm.js +5082 -3667
  30. package/dist/bitwrench.esm.min.js +38 -8
  31. package/dist/bitwrench.min.css +1 -0
  32. package/dist/bitwrench.umd.js +5082 -3667
  33. package/dist/bitwrench.umd.min.js +38 -8
  34. package/dist/builds.json +184 -74
  35. package/dist/bwserve.cjs.js +646 -0
  36. package/dist/bwserve.esm.js +638 -0
  37. package/dist/sri.json +36 -26
  38. package/package.json +23 -6
  39. package/readme.html +71 -32
  40. package/src/bitwrench-bccl-entry.js +72 -0
  41. package/src/{bitwrench-components-v2.js → bitwrench-bccl.js} +396 -647
  42. package/src/bitwrench-code-edit.js +98 -48
  43. package/src/bitwrench-color-utils.js +24 -18
  44. package/src/bitwrench-components-stub.js +4 -1
  45. package/src/bitwrench-file-ops.js +180 -0
  46. package/src/bitwrench-lean.js +2 -2
  47. package/src/bitwrench-styles.js +1287 -4029
  48. package/src/bitwrench-utils.js +458 -0
  49. package/src/bitwrench.js +2070 -1292
  50. package/src/bwserve/client.js +182 -0
  51. package/src/bwserve/index.js +352 -0
  52. package/src/bwserve/shell.js +103 -0
  53. package/src/cli/index.js +36 -15
  54. package/src/cli/layout-default.js +18 -18
  55. package/src/cli/serve.js +325 -0
  56. package/src/generate-css.js +73 -53
  57. package/src/version.js +3 -3
  58. package/src/bitwrench-component-base.js +0 -736
  59. package/src/bitwrench-components-inline.js +0 -374
  60. package/src/bitwrench-components.js +0 -610
  61. /package/bin/{bitwrench.js → bwcli.js} +0 -0
package/dist/sri.json CHANGED
@@ -1,31 +1,41 @@
1
1
  {
2
- "version": "2.0.14",
2
+ "version": "2.0.16",
3
3
  "algorithm": "sha384",
4
- "generated": "2026-03-08",
4
+ "generated": "2026-03-12",
5
5
  "files": {
6
- "bitwrench-code-edit.cjs.js": "sha384-NuPgjnP90qmTJh2+OHjD7dEMax23EdkDFLiPZmztnK1Rgxk7DH28DlayzgEaOLDn",
7
- "bitwrench-code-edit.es5.js": "sha384-5GuqE6c+ucctoppDBKLbYZe+cgPS7aURDoeetCPGNBpBBgEokHtZvfMsU73eIlyP",
8
- "bitwrench-code-edit.es5.min.js": "sha384-gOfySPh/0oSN9N/rRmKqQkfFELHA+wP2h5+C4FY4T38HYPXNEr0wTtPyBO+fo6Vw",
9
- "bitwrench-code-edit.esm.js": "sha384-tDVBa46hw2U2LAqzcuVL0HErYb7lm3vusm+qwXkjw2J2drstEBFFIeFjwjQn3uid",
10
- "bitwrench-code-edit.esm.min.js": "sha384-x+cZlIypO7cHNO/EblwGATZK9RMLtf+gK9gTSZQLUbpqz/58Rr3KuK7RTYxbclr7",
11
- "bitwrench-code-edit.umd.js": "sha384-7WECGf8Zo3f+CalzAdPUxLcnSGNZU2CLH5KF/0jlC5e59/agNKBuAq8KAj5kzTZS",
12
- "bitwrench-code-edit.umd.min.js": "sha384-hIlUdnfooER9fRK3CaFv0CbofGkJhMFBwVYjha2vM8da12kxG53VJp8ntUqgH6ER",
13
- "bitwrench-lean.cjs.js": "sha384-lUUI6XztA8iBXUaAwHLEZvkr2qfRdzPpR1HIKbMC02hOFA/YVP9rcJjUcUeaRh1G",
14
- "bitwrench-lean.cjs.min.js": "sha384-YQwhJXo3ZXjk7ijjMJoRBc7T5hMHqUkFIjqChjhfSKdVmPkkNl1wU2sGeypoUJ0V",
15
- "bitwrench-lean.es5.js": "sha384-n+e23c7CBiv5vyOeqK20iNooX+tUcmmWbs7ZzNBgeX/49iyiar1pPUKrre0uqcaH",
16
- "bitwrench-lean.es5.min.js": "sha384-jQSSsfyy/DAjxaixwfQguAz43oE+Pb4EQY4vQ2QmB+AdlK6Be7EOblIbdFAwdKqh",
17
- "bitwrench-lean.esm.js": "sha384-1bivNtIh/1+k3lkkyytUMbOzzzKDI/KnLu/k04KQm4HbBt/5F2y1IbPJQK6AiKua",
18
- "bitwrench-lean.esm.min.js": "sha384-HbXsASM7mEDKCgAUe4+CRcDZ+AzHlIV3d4x4gqqkd7rI29Mv3XzHd6yDP5AK62yv",
19
- "bitwrench-lean.umd.js": "sha384-SUiymoHivY507YLbX3XDAkSfn7feMJ0ElzCh2QNSb6s4al9G97S0ezHOVsa0mnvR",
20
- "bitwrench-lean.umd.min.js": "sha384-dWq237e2APvSFVTD/I1cRabyD4blHO9q/spdZtMKk/gmbPYiOhcocyaXR+SROgM2",
21
- "bitwrench.cjs.js": "sha384-ZzcJBCi9aUwYjx5Sdww/YniuPbDdRstsO7L5L6xyBhH545rD8WR6VRZinjsUHq2J",
22
- "bitwrench.cjs.min.js": "sha384-oFrUX8zWzam5K5xo2wX/cfgE1YEwZ5IH+n7qiTpayqgY4d9Pxlx2PinG7K9gXVGQ",
23
- "bitwrench.css": "sha384-el6NYT+JrKiC7E5kLmTkixAWwvitbQj7cbOEOMTzbTPqiFFBsSNpHXONsNokDbiA",
24
- "bitwrench.es5.js": "sha384-b0vYr/9npKCZTQeEt8wAiZO6bRrr0IPN8TkwSF9JM4y7u3Yx0tBEDTJ7E2outW0s",
25
- "bitwrench.es5.min.js": "sha384-Y8vAGxrgcQ4IdWDwGpjvb3kC+IsitRnA6UmPuxCLpBcdrFRi+C91ZTLMzPo70k+L",
26
- "bitwrench.esm.js": "sha384-KDJY68ddKz2K+5pS9pLt5vibM1+rCIrkflhX0uHZju+4h+hH8TyyOpNtZRRKuhJD",
27
- "bitwrench.esm.min.js": "sha384-oMStlYxxW/E43uP6gZhwXSoqBwcZsZz/tDXnJFanOa7NzJ4GPI7NxDeFsD2FJXeA",
28
- "bitwrench.umd.js": "sha384-k3atU2eNx5HW/2BxlpYfXCC2tcMtfmendk11UcLIUq6v0F/+mWsqZXQ58O5NA/4o",
29
- "bitwrench.umd.min.js": "sha384-A8UhjSRrnhtxSOMcU8veknMpxDW4JvyVpd3VB4MFeMgmBJia9MUdsnZzoekN7OUg"
6
+ "bitwrench-bccl.cjs.js": "sha384-GwR2880Z60SZfdNaioTeRhUBXGyYoVU3MLylTyIPeUFxvodT/3Iet6V/WxyBMD/s",
7
+ "bitwrench-bccl.cjs.min.js": "sha384-Qwl5UPvUPdEYdMTcGKqPBJBsp8QhidEz8fk8yKfbS/3cqtMl5NaXbMJA2BoiwfKh",
8
+ "bitwrench-bccl.esm.js": "sha384-kHXaRUebkB7AJJjvfRyo55LwAljwnGo9QvTxdSAqbEqOYj+3X4O6IpNdKWBJHLcF",
9
+ "bitwrench-bccl.esm.min.js": "sha384-hcQjn5nawieZdF4y8RPH77VCeEFlIGNP+ZU6U/fYnxWfNEyO6d5ss2MRyQ5XFKyx",
10
+ "bitwrench-bccl.umd.js": "sha384-ICOeQchsjmDw5JKGRiTpzOZQFTeHdws4wxVtA9DAo+UVG7OnndU2yUcA9l+FHwH6",
11
+ "bitwrench-bccl.umd.min.js": "sha384-+v9FNivy9NRfWFRXRtkP6ZiEO9BMhazy+wzQtiQt1t2rE5CZW1vuOMNcJvBpzJHc",
12
+ "bitwrench-code-edit.cjs.js": "sha384-khga6vBpxusqbLfrzDgaUuyCoXgpWq74miYSMk7qhkiQP3AfXuAEoZpQnf0DttiS",
13
+ "bitwrench-code-edit.cjs.min.js": "sha384-hYMmfOiiw6x31dBGA2XuVxam6Z9hJlZrp+q3iti0kfSq3/BEDchNLF0y6VR7R4kX",
14
+ "bitwrench-code-edit.es5.js": "sha384-Ck1ishImBFkM4fRKK7oi9zJky7DDeOmXgkK0bSbWgogCMeW7DRpkm47hQRLVVRJw",
15
+ "bitwrench-code-edit.es5.min.js": "sha384-u9ykQEvMQIafDdWpMU3ecIrmx56v4MUCCOMkuyrYgGqR9vwTZZ/+1e/RbsOlNRc5",
16
+ "bitwrench-code-edit.esm.js": "sha384-E324MY+95O5lfS9pNSJo4INbAH19cW757B9nDcWAOtuna8TKMpYGV4ISB0fwOPDe",
17
+ "bitwrench-code-edit.esm.min.js": "sha384-KHv/eyr8QgXCTX0aPVH8K6Yy89AJ/0Kw7furwi5GleEDRWXDIaM2TzAcvJC7BAAA",
18
+ "bitwrench-code-edit.umd.js": "sha384-xXdbDll04ajtBsQX0axgamUFGN6QFMaJ2mRF+NltLk8W6DswOTcuTO3+HeUVowVr",
19
+ "bitwrench-code-edit.umd.min.js": "sha384-rVetnnzXOSu1IUM3rQMdMUy4aPpbzDXZJ6edtYhaf14Wsc3qjsfV/oaE1D3/ic0J",
20
+ "bitwrench-lean.cjs.js": "sha384-6G/GY13bZxw2fJnRYFTKMe5ID44pG00mI5fscEtcGOWsyXU66Z9x96tJ9gW2YFoJ",
21
+ "bitwrench-lean.cjs.min.js": "sha384-jPRTwWe3KtSyw0Jeihuds2mt78akR8sJLrg6KsGpapYOQu4jBEDluhlBxeYTV924",
22
+ "bitwrench-lean.es5.js": "sha384-HALcGiNdWAwTXHOSWBIM5Z8HNLqEiZxKkpshXV8aQYQEmi7ExZk5wVUSFnszt4Gx",
23
+ "bitwrench-lean.es5.min.js": "sha384-SesnIRrNdnucw77WgRDRqGYBoUOxLNuSjAvp9PncwRNLOHvE8xqSwq8O7lUCoHB6",
24
+ "bitwrench-lean.esm.js": "sha384-nuPtftCDpQZkupIb1qenEZgKMZSzvvKtwRomD8zIK4hJTsGYnvxA7z/ZhcmnjvAz",
25
+ "bitwrench-lean.esm.min.js": "sha384-96C4eWKwPY/T4/ZsVpoIldnThALDBRiE6RZ31U/gwyVVfoH2MZNAxzhH3IMPpqbf",
26
+ "bitwrench-lean.umd.js": "sha384-HRRlhaZtoFpQ+OJDjgTwsSs1pOJYcounIAVWNG8JB6OigF0dd/WAYV/kYpdfz1Hj",
27
+ "bitwrench-lean.umd.min.js": "sha384-F7r80Hn3REIH3VWG5YUtY+KujQE0cpGeQq833CJCfcaE5/c0dWoNvsNS1OGf2XE0",
28
+ "bitwrench.cjs.js": "sha384-Ew7bPhGDSA1Byb6Taso9W66aZo8H+/85RjHd1aH3uVfNz09qnPclOxbLAnHBhksT",
29
+ "bitwrench.cjs.min.js": "sha384-BdutYGxq7G9Tn/9J06jDSSCc1iK6aKEJ1KxjRbknZk8Et1gNmF0MomzELHmZfKQC",
30
+ "bitwrench.css": "sha384-TLf4tWABJynZ7cb9epG9VhRM1IvuK5k4VD5wHE2esbGXcuKzG6iArqimHPzZDLD2",
31
+ "bitwrench.es5.js": "sha384-gVwhjeTvWn5LhP1OqLAtS8sE/L8prV0zVV9KNJf+rKX3tJYdDAVNxLq1bvuXgggd",
32
+ "bitwrench.es5.min.js": "sha384-T7NCr/fxfLL7stlgkfrwZGSIYVXIF21e9M8K5QcWdElNFCBIGWlT59usFIDLgyMm",
33
+ "bitwrench.esm.js": "sha384-9a7cFRy55OaBzng4m6ixCUiSYWb+FN+7RcG2NyboJVQF0j6SnR0WpYR3ur8Hh8PH",
34
+ "bitwrench.esm.min.js": "sha384-XO2NYqeiOAvrmCZnFSPuC8yctfeZ6bfcPQhWMSbiDRwMDqqBwXyOpsVhUxjpflCo",
35
+ "bitwrench.min.css": "sha384-Sl7+BxWfINNnNdN+ZCL1s/p4Hn+5WeJPciWS9svNuzal8h9baX19xGeOJNzradRY",
36
+ "bitwrench.umd.js": "sha384-SBGSd5W8l78ZzK8XUU5FeHLE2fBB+WDgHJPtt9LkKBGkvP0TPVmfTwxcsLYA4MFO",
37
+ "bitwrench.umd.min.js": "sha384-jW9jzpLC07lcZ0KD7uXE8hi9J75zyCaogD5Goam0Dvmm4aofdJhy6iCVXe8Aj0jY",
38
+ "bwserve.cjs.js": "sha384-0mM2vNKrqS6RjlakI/4hmnnNte8/tjhiCiXZ+h+6+/IbhuyEWp1+CGXXnX97ZRZO",
39
+ "bwserve.esm.js": "sha384-dr2iHz8bI12AK7TMIzLc48Kvb4sIQ90w34isDil4EKtcasOeYg3Y5PjTGF3SWKqe"
30
40
  }
31
41
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bitwrench",
3
- "version": "2.0.14",
3
+ "version": "2.0.16",
4
4
  "description": "A library for javascript UI functions.",
5
5
  "main": "./dist/bitwrench.umd.js",
6
6
  "repository": {
@@ -13,7 +13,7 @@
13
13
  "author": "manu a. chatterjee <deftio@deftio.com> (https://deftio.com/)",
14
14
  "license": "BSD-2-Clause",
15
15
  "bin": {
16
- "bitwrench": "./bin/bitwrench.js"
16
+ "bwcli": "./bin/bwcli.js"
17
17
  },
18
18
  "type": "module",
19
19
  "module": "./dist/bitwrench.esm.js",
@@ -22,6 +22,20 @@
22
22
  "import": "./dist/bitwrench.esm.js",
23
23
  "require": "./dist/bitwrench.cjs.js",
24
24
  "default": "./dist/bitwrench.umd.js"
25
+ },
26
+ "./lean": {
27
+ "import": "./dist/bitwrench-lean.esm.js",
28
+ "require": "./dist/bitwrench-lean.cjs.js",
29
+ "default": "./dist/bitwrench-lean.umd.js"
30
+ },
31
+ "./bccl": {
32
+ "import": "./dist/bitwrench-bccl.esm.js",
33
+ "require": "./dist/bitwrench-bccl.cjs.js",
34
+ "default": "./dist/bitwrench-bccl.umd.js"
35
+ },
36
+ "./bwserve": {
37
+ "import": "./dist/bwserve.esm.js",
38
+ "require": "./dist/bwserve.cjs.js"
25
39
  }
26
40
  },
27
41
  "types": "./dist/bitwrench.d.ts",
@@ -72,8 +86,8 @@
72
86
  },
73
87
  "scripts": {
74
88
  "generate-version": "node tools/generate-version.cjs",
75
- "prebuild": "npm run generate-version",
76
- "build": "rollup --config && npm run build:css",
89
+ "prebuild": "npm run generate-version && npm run lint",
90
+ "build": "rollup --config && npm run build:css && npm run build:metrics",
77
91
  "build:css": "node src/generate-css.js",
78
92
  "build:readme": "node tools/build-readme.js",
79
93
  "build:watch": "rollup --config --watch",
@@ -81,7 +95,8 @@
81
95
  "build_1_x": "./tools/update-bw-package.js package.json package.json && ./tools/export-bw-default-css.js bitwrench.css && uglifyjs bitwrench.js -o bitwrench.min.js && uglifyjs bitwrench_ESM.js -o bitwrench_ESM.min.js && ./tools/umd2ModuleHack.js && npm pack",
82
96
  "cleanbuild": "npm run clean && npm run build && npm run build:generated",
83
97
  "oldtest": "./node_modules/mocha/bin/mocha test/bitwrench_test.js --reporter spec",
84
- "test": "c8 --reporter=text mocha ./test/bitwrench_ci.js ./test/bitwrench_test_coverage.js ./test/bitwrench_test_pubsub.js ./test/bitwrench_test_theme.js ./test/bitwrench_test_nodemap.js ./test/bitwrench_test_components.js -r jsdom-global/register",
98
+ "test": "c8 --reporter=text mocha ./test/bitwrench_ci.js ./test/bitwrench_test_coverage.js ./test/bitwrench_test_pubsub.js ./test/bitwrench_test_theme.js ./test/bitwrench_test_nodemap.js ./test/bitwrench_test_components.js ./test/bitwrench_test_component_handle.js ./test/bitwrench_test_coverage_gaps.js ./test/bitwrench_test_bwserve.js -r jsdom-global/register",
99
+ "test:bwserve": "mocha ./test/bitwrench_test_bwserve.js -r jsdom-global/register",
85
100
  "test:components": "mocha ./test/bitwrench_test_components.js -r jsdom-global/register",
86
101
  "test:v1": "c8 --reporter=text mocha ./test/bitwrench_test.js -r jsdom-global/",
87
102
  "test:pending": "mocha ./test/bitwrench_test_pending.js -r jsdom-global/",
@@ -102,8 +117,10 @@
102
117
  "test:examples": "playwright test tests/examples.spec.js",
103
118
  "test:coverage": "c8 --reporter=html --reporter=text mocha ./test/bitwrench_ci.js -r jsdom-global/",
104
119
  "build:api-reference": "node tools/build-api-reference.js",
120
+ "build:api-md": "node tools/build-api-markdown.js",
105
121
  "build:builds": "node tools/build-builds-manifest.js",
106
- "build:generated": "npm run generate-sri && npm run build:builds && npm run build:readme && npm run build:api-reference",
122
+ "build:metrics": "node tools/build-metrics.cjs",
123
+ "build:generated": "npm run generate-sri && npm run build:builds && npm run build:readme && npm run build:api-reference && npm run build:api-md",
107
124
  "build:release": "npm run cleanbuild && npm run test && node tools/build-release.js",
108
125
  "release": "node tools/release.js",
109
126
  "start-release": "node tools/start-release.js"
package/readme.html CHANGED
@@ -3,7 +3,7 @@
3
3
  <head>
4
4
  <meta charset="UTF-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <meta name="generator" content="bitwrench v2.0.14">
6
+ <meta name="generator" content="bitwrench v2.0.16">
7
7
  <title>bitwrench.js - README</title>
8
8
  <link rel="icon" type="image/x-icon" href="images/favicon.ico">
9
9
  <script src="dist/bitwrench.umd.js"></script>
@@ -44,15 +44,15 @@
44
44
  }
45
45
  .readme-body img { max-width: 100%; height: auto; }
46
46
  .readme-body table { border-collapse: collapse; width: 100%; margin: 1em 0; }
47
- .readme-body th, .readme-body td { border: 1px solid var(--bw-card-border); padding: 0.5em 0.75em; text-align: left; }
48
- .readme-body th { background: var(--bw-teal-bg); font-weight: 600; }
49
- .readme-body h2 { border-bottom: 1px solid var(--bw-card-border); padding-bottom: 0.3em; }
50
- .readme-body a { color: var(--bw-teal); }
51
- .readme-body a:hover { color: var(--bw-teal-dark); }
52
- .readme-body pre { background: var(--bw-code-bg); border-radius: 6px; overflow-x: auto; border: 1px solid rgba(0,0,0,0.1); }
53
- .readme-body pre code { display: block; padding: 1rem; color: var(--bw-code-text); font-family: var(--bw-font-mono); font-size: 0.8125rem; line-height: 1.6; background: transparent; border: none; }
54
- .readme-body code:not(pre code) { background: var(--bw-teal-light); color: var(--bw-teal-dark); padding: 0.15em 0.4em; border-radius: 3px; font-size: 0.85em; font-family: var(--bw-font-mono); }
55
- .readme-body blockquote { border-left: 4px solid var(--bw-teal); margin-left: 0; padding-left: 1em; color: var(--bw-text-secondary); }
47
+ .readme-body th, .readme-body td { border: 1px solid var(--bw_card_border); padding: 0.5em 0.75em; text-align: left; }
48
+ .readme-body th { background: var(--bw_teal_bg); font-weight: 600; }
49
+ .readme-body h2 { border-bottom: 1px solid var(--bw_card_border); padding-bottom: 0.3em; }
50
+ .readme-body a { color: var(--bw_teal); }
51
+ .readme-body a:hover { color: var(--bw_teal_dark); }
52
+ .readme-body pre { background: var(--bw_code_bg); border-radius: 6px; overflow-x: auto; border: 1px solid rgba(0,0,0,0.1); }
53
+ .readme-body pre code { display: block; padding: 1rem; color: var(--bw_code_text); font-family: var(--bw_font_mono); font-size: 0.8125rem; line-height: 1.6; background: transparent; border: none; }
54
+ .readme-body code:not(pre code) { background: var(--bw_teal_light); color: var(--bw_teal_dark); padding: 0.15em 0.4em; border-radius: 3px; font-size: 0.85em; font-family: var(--bw_font_mono); }
55
+ .readme-body blockquote { border-left: 4px solid var(--bw_teal); margin-left: 0; padding-left: 1em; color: var(--bw_text_secondary); }
56
56
  </style>
57
57
  </head>
58
58
  <body>
@@ -96,7 +96,8 @@ const bw = require(&#39;bitwrench&#39;);</code></pre><p>Or include directly in a
96
96
  <li class="quikdown-li"><strong class="quikdown-strong">Built-in reactivity</strong> — <code class="quikdown-code">bw.update()</code> re-renders components when state changes, <code class="quikdown-code">bw.patch()</code> updates individual elements by ID, <code class="quikdown-code">bw.pub()</code>/<code class="quikdown-code">bw.sub()</code> provides decoupled messaging between any part of the application</li>
97
97
  <li class="quikdown-li"><strong class="quikdown-strong">CSS and theme generation</strong> — <code class="quikdown-code">bw.css()</code> generates stylesheets from objects, <code class="quikdown-code">bw.generateTheme()</code> derives a complete visual theme (buttons, alerts, badges, cards, forms, tables, dark mode) from 2-3 seed colors</li>
98
98
  <li class="quikdown-li"><strong class="quikdown-strong">45+ ready-made components</strong> — cards, buttons, sortable tables, form inputs, modals, dropdowns, accordions, tooltips, popovers, toasts, timelines, steppers, file uploads, stat cards — each a single function call that returns a composable object</li>
99
- <li class="quikdown-li"><strong class="quikdown-strong">Static site CLI</strong> — the <code class="quikdown-code">bitwrench</code> command converts Markdown, HTML, and JSON files into styled, self-contained pages with theme support</li>
99
+ <li class="quikdown-li"><strong class="quikdown-strong">Server-driven UI (bwserve)</strong> — push TACO rendering commands from Node.js to the browser over SSE; same protocol works from C (ESP32), Python, Rust, or any language via the <code class="quikdown-code">bwcli serve</code> pipe server</li>
100
+ <li class="quikdown-li"><strong class="quikdown-strong">Static site CLI</strong> — the <code class="quikdown-code">bwcli</code> command converts Markdown, HTML, and JSON files into styled, self-contained pages with theme support</li>
100
101
  <li class="quikdown-li"><strong class="quikdown-strong">Utilities</strong> — color interpolation, random data generation, lorem ipsum, cookies, URL params, file I/O for both browser and Node.js</li>
101
102
  </ul><h2 class="quikdown-h2">Getting Started</h2>
102
103
  <p><pre class="quikdown-pre"><code class="language-html">&lt;!DOCTYPE html&gt;
@@ -123,23 +124,24 @@ const bw = require(&#39;bitwrench&#39;);</code></pre><p>Or include directly in a
123
124
  &lt;/script&gt;
124
125
  &lt;/body&gt;
125
126
  &lt;/html&gt;</code></pre></p><h2 class="quikdown-h2">Adding State</h2>
126
- <p>The <code class="quikdown-code">o</code> key adds state and a render function to any element. When state changes, call <code class="quikdown-code">bw.update()</code> to re-render:</p><pre class="quikdown-pre"><code class="language-javascript">bw.DOM(&#39;#counter&#39;, {
127
- t: &#39;div&#39;,
127
+ <p>Wrap any TACO in <code class="quikdown-code">bw.component()</code> to get a reactive component with <code class="quikdown-code">.get()</code>, <code class="quikdown-code">.set()</code>, and template bindings:</p><pre class="quikdown-pre"><code class="language-javascript">var counter = bw.component({
128
+ t: &#39;div&#39;, c: [
129
+ { t: &#39;span&#39;, c: &#39;Count: ${count}&#39; },
130
+ { t: &#39;button&#39;, c: &#39;+1&#39;, a: {
131
+ onclick: function() { counter.set(&#39;count&#39;, counter.get(&#39;count&#39;) + 1); }
132
+ }}
133
+ ],
128
134
  o: {
129
135
  state: { count: 0 },
130
- render: function(el) {
131
- var s = el._bw_state;
132
- bw.DOM(el, {
133
- t: &#39;div&#39;, c: [
134
- { t: &#39;span&#39;, c: &#39;Count: &#39; + s.count },
135
- { t: &#39;button&#39;, a: {
136
- onclick: function() { s.count++; bw.update(el); }
137
- }, c: &#39;+1&#39; }
138
- ]
139
- });
136
+ methods: {
137
+ reset: function(comp) { comp.set(&#39;count&#39;, 0); }
140
138
  }
141
139
  }
142
- });</code></pre><p>For communication between components, use pub/sub:</p><pre class="quikdown-pre"><code class="language-javascript">bw.sub(&#39;item-added&#39;, function(detail) {
140
+ });
141
+
142
+ bw.DOM(&#39;#app&#39;, counter);
143
+ counter.set(&#39;count&#39;, 42); // DOM updates automatically
144
+ counter.reset(); // methods from o.methods are callable on the handle</code></pre><p>For low-level control, you can also use <code class="quikdown-code">o.render</code> + <code class="quikdown-code">bw.update()</code> directly — see the <a class="quikdown-a" href="docs/state-management.md">State Management guide</a>.</p><p>For communication between components, use pub/sub:</p><pre class="quikdown-pre"><code class="language-javascript">bw.sub(&#39;item-added&#39;, function(detail) {
143
145
  console.log(&#39;New item:&#39;, detail.name);
144
146
  });
145
147
 
@@ -167,6 +169,10 @@ bw.toggleTheme(); // switch between primary and alternate palettes</code></pre>
167
169
  <td class="quikdown-td">Mount an object to a DOM element</td>
168
170
  </tr>
169
171
  <tr class="quikdown-tr">
172
+ <td class="quikdown-td"><code class="quikdown-code">bw.component(taco)</code></td>
173
+ <td class="quikdown-td">Wrap a TACO in a ComponentHandle with <code class="quikdown-code">.get()/.set()</code> reactive API</td>
174
+ </tr>
175
+ <tr class="quikdown-tr">
170
176
  <td class="quikdown-td"><code class="quikdown-code">bw.css(rules)</code></td>
171
177
  <td class="quikdown-td">Generate CSS from a JS object</td>
172
178
  </tr>
@@ -187,6 +193,10 @@ bw.toggleTheme(); // switch between primary and alternate palettes</code></pre>
187
193
  <td class="quikdown-td">Re-render via the element&#39;s <code class="quikdown-code">o.render</code> function</td>
188
194
  </tr>
189
195
  <tr class="quikdown-tr">
196
+ <td class="quikdown-td"><code class="quikdown-code">bw.message(target, action, data)</code></td>
197
+ <td class="quikdown-td">Send a message to a component by tag name</td>
198
+ </tr>
199
+ <tr class="quikdown-tr">
190
200
  <td class="quikdown-td"><code class="quikdown-code">bw.pub(topic, detail)</code></td>
191
201
  <td class="quikdown-td">Publish a message to subscribers</td>
192
202
  </tr>
@@ -194,16 +204,34 @@ bw.toggleTheme(); // switch between primary and alternate palettes</code></pre>
194
204
  <td class="quikdown-td"><code class="quikdown-code">bw.sub(topic, handler)</code></td>
195
205
  <td class="quikdown-td">Subscribe to a topic; returns an unsub function</td>
196
206
  </tr>
207
+ <tr class="quikdown-tr">
208
+ <td class="quikdown-td"><code class="quikdown-code">bw.inspect(target)</code></td>
209
+ <td class="quikdown-td">Debug a component in the browser console</td>
210
+ </tr>
211
+ <tr class="quikdown-tr">
212
+ <td class="quikdown-td"><code class="quikdown-code">bw.clientConnect(url, opts)</code></td>
213
+ <td class="quikdown-td">Connect to a bwserve SSE endpoint</td>
214
+ </tr>
215
+ <tr class="quikdown-tr">
216
+ <td class="quikdown-td"><code class="quikdown-code">bw.clientApply(msg)</code></td>
217
+ <td class="quikdown-td">Apply a bwserve protocol message to the DOM</td>
218
+ </tr>
219
+ <tr class="quikdown-tr">
220
+ <td class="quikdown-td"><code class="quikdown-code">bw.clientParse(str)</code></td>
221
+ <td class="quikdown-td">Parse strict or r-prefix relaxed JSON</td>
222
+ </tr>
197
223
  </tbody>
198
224
  </table><p>See the full <a class="quikdown-a" href="https://deftio.github.io/bitwrench/pages/08-api-reference.html" rel="noopener noreferrer">API Reference</a> for all functions.</p><h2 class="quikdown-h2">CLI</h2>
199
225
  <p>Convert Markdown, HTML, or JSON files to styled standalone pages:</p><pre class="quikdown-pre"><code class="language-bash"># Convert Markdown to a self-contained HTML page
200
- bitwrench README.md -o index.html --standalone
226
+ bwcli README.md -o index.html --standalone
201
227
 
202
228
  # Apply a theme preset
203
- bitwrench doc.md -o doc.html --standalone --theme ocean
229
+ bwcli doc.md -o doc.html --standalone --theme ocean
204
230
 
205
231
  # Custom colors
206
- bitwrench doc.md -o doc.html --standalone --theme &quot;#336699,#cc6633&quot;</code></pre><p>Flags: <code class="quikdown-code">--output/-o</code>, <code class="quikdown-code">--standalone/-s</code>, <code class="quikdown-code">--cdn</code>, <code class="quikdown-code">--theme/-t</code>, <code class="quikdown-code">--css/-c</code>, <code class="quikdown-code">--title</code>, <code class="quikdown-code">--favicon/-f</code>, <code class="quikdown-code">--highlight</code>, <code class="quikdown-code">--verbose/-v</code></p><h2 class="quikdown-h2">Build Formats</h2>
232
+ bwcli doc.md -o doc.html --standalone --theme &quot;#336699,#cc6633&quot;</code></pre><p>Flags: <code class="quikdown-code">--output/-o</code>, <code class="quikdown-code">--standalone/-s</code>, <code class="quikdown-code">--cdn</code>, <code class="quikdown-code">--theme/-t</code>, <code class="quikdown-code">--css/-c</code>, <code class="quikdown-code">--title</code>, <code class="quikdown-code">--favicon/-f</code>, <code class="quikdown-code">--highlight</code>, <code class="quikdown-code">--verbose/-v</code></p><h3 class="quikdown-h3">Pipe Server</h3>
233
+ <p><code class="quikdown-code">bwcli serve</code> turns any language into a bwserve backend — send JSON protocol messages via HTTP POST or stdin, and connected browsers update in real time:</p><pre class="quikdown-pre"><code class="language-bash">bwcli serve --port 8080 --input-port 9000
234
+ curl -X POST http://localhost:9000 -d &#39;{&quot;type&quot;:&quot;patch&quot;,&quot;target&quot;:&quot;temp&quot;,&quot;content&quot;:&quot;23.5 C&quot;}&#39;</code></pre><h2 class="quikdown-h2">Build Formats</h2>
207
235
  <table class="quikdown-table">
208
236
  <thead class="quikdown-thead">
209
237
  <tr class="quikdown-tr">
@@ -235,19 +263,30 @@ bitwrench doc.md -o doc.html --standalone --theme &quot;#336699,#cc6633&quot;</c
235
263
  </tr>
236
264
  </tbody>
237
265
  </table><p>All formats include source maps. A separate CSS file (<code class="quikdown-code">bitwrench.css</code>) is also available for use without JavaScript.</p><h2 class="quikdown-h2">Documentation</h2>
238
- <ul class="quikdown-ul">
239
- <li class="quikdown-li"><a class="quikdown-a" href="https://deftio.github.io/bitwrench/pages/" rel="noopener noreferrer">Interactive docs and demos</a> — full tutorial site with live examples</li>
266
+ <strong class="quikdown-strong">Guides</strong> (in <code class="quikdown-code">docs/</code>):</p><ul class="quikdown-ul">
267
+ <li class="quikdown-li"><a class="quikdown-a" href="docs/taco-format.md">TACO Format</a> — the <code class="quikdown-code">{t, a, c, o}</code> object format</li>
268
+ <li class="quikdown-li"><a class="quikdown-a" href="docs/state-management.md">State Management</a> — three-level component model, ComponentHandle, reactive state</li>
269
+ <li class="quikdown-li"><a class="quikdown-a" href="docs/component-library.md">Component Library</a> — all 50+ <code class="quikdown-code">make*()</code> functions with signatures and examples</li>
270
+ <li class="quikdown-li"><a class="quikdown-a" href="docs/theming.md">Theming</a> — palette-driven theme generation, presets, design tokens</li>
271
+ <li class="quikdown-li"><a class="quikdown-a" href="docs/cli.md">CLI</a> — the <code class="quikdown-code">bwcli</code> command for file conversion and pipe server</li>
272
+ <li class="quikdown-li"><a class="quikdown-a" href="docs/bwserve.md">bwserve</a> — server-driven UI protocol (SSE, actions, embedded devices)</li>
273
+ <li class="quikdown-li"><a class="quikdown-a" href="docs/llm-bitwrench-guide.md">LLM Guide</a> — compact single-file reference for AI-assisted development</li>
274
+ </ul><p><strong class="quikdown-strong">Tutorials:</strong></p><ul class="quikdown-ul">
275
+ <li class="quikdown-li"><a class="quikdown-a" href="docs/tutorial-website.md">Build a Website</a> — multi-section landing page from TACO objects</li>
276
+ <li class="quikdown-li"><a class="quikdown-a" href="docs/tutorial-bwserve.md">bwserve Dashboard</a> — Streamlit-style server-push dashboard</li>
277
+ <li class="quikdown-li"><a class="quikdown-a" href="docs/tutorial-embedded.md">ESP32 IoT Dashboard</a> — embedded sensor dashboard with C macros</li>
278
+ </ul><p><strong class="quikdown-strong">Interactive demos</strong> (live site):</p><ul class="quikdown-ul">
240
279
  <li class="quikdown-li"><a class="quikdown-a" href="https://deftio.github.io/bitwrench/pages/00-quick-start.html" rel="noopener noreferrer">Quick Start</a> — first steps with <code class="quikdown-code">bw.DOM()</code></li>
241
280
  <li class="quikdown-li"><a class="quikdown-a" href="https://deftio.github.io/bitwrench/pages/01-components.html" rel="noopener noreferrer">Components</a> — buttons, cards, alerts, badges, navbars</li>
242
281
  <li class="quikdown-li"><a class="quikdown-a" href="https://deftio.github.io/bitwrench/pages/03-styling.html" rel="noopener noreferrer">Styling &amp; Theming</a> — CSS generation and theming strategies</li>
243
- <li class="quikdown-li"><a class="quikdown-a" href="https://deftio.github.io/bitwrench/pages/05-state.html" rel="noopener noreferrer">State &amp; Interactivity</a> — <code class="quikdown-code">bw.patch()</code>, <code class="quikdown-code">bw.update()</code>, pub/sub</li>
282
+ <li class="quikdown-li"><a class="quikdown-a" href="https://deftio.github.io/bitwrench/pages/05-state.html" rel="noopener noreferrer">State &amp; Interactivity</a> — state patterns and ComponentHandle</li>
244
283
  <li class="quikdown-li"><a class="quikdown-a" href="https://deftio.github.io/bitwrench/pages/06-tic-tac-toe-tutorial.html" rel="noopener noreferrer">Tic Tac Toe Tutorial</a> — step-by-step game with state management</li>
245
284
  <li class="quikdown-li"><a class="quikdown-a" href="https://deftio.github.io/bitwrench/pages/07-framework-comparison.html" rel="noopener noreferrer">Framework Comparison</a> — bitwrench vs React, Vue, Svelte</li>
246
- <li class="quikdown-li"><a class="quikdown-a" href="https://deftio.github.io/bitwrench/pages/10-themes.html" rel="noopener noreferrer">Themes</a> — interactive theme generator with presets, dark mode, and CSS export</li>
285
+ <li class="quikdown-li"><a class="quikdown-a" href="https://deftio.github.io/bitwrench/pages/10-themes.html" rel="noopener noreferrer">Themes</a> — interactive theme generator with presets and CSS export</li>
247
286
  </ul><h2 class="quikdown-h2">Development</h2>
248
287
  <p><pre class="quikdown-pre"><code class="language-bash">npm install # install dev dependencies
249
288
  npm run build # build all dist formats (UMD, ESM, CJS, ES5)
250
- npm test # run unit tests (558 tests)
289
+ npm test # run unit tests (1000+ tests)
251
290
  npm run test:cli # run CLI tests (49 tests)
252
291
  npm run test:e2e # run Playwright browser tests
253
292
  npm run lint # run ESLint
@@ -0,0 +1,72 @@
1
+ /**
2
+ * bitwrench-bccl-entry.js — Standalone entry point for BCCL component library.
3
+ *
4
+ * Use this alongside bitwrench-lean when you want the core library and
5
+ * BCCL components as separate files. The UMD build auto-registers all
6
+ * make*() functions onto the global `bw` object if present.
7
+ *
8
+ * Usage (browser):
9
+ * <script src="bitwrench-lean.umd.min.js"></script>
10
+ * <script src="bitwrench-bccl.umd.min.js"></script>
11
+ *
12
+ * Usage (ESM):
13
+ * import bw from 'bitwrench/lean';
14
+ * import { registerBCCL } from 'bitwrench/bccl';
15
+ * registerBCCL(bw);
16
+ *
17
+ * @module bitwrench-bccl
18
+ * @license BSD-2-Clause
19
+ */
20
+
21
+ import * as components from './bitwrench-bccl.js';
22
+
23
+ /**
24
+ * Register all BCCL components onto a bitwrench instance.
25
+ * Called automatically in UMD builds when `bw` is a global.
26
+ *
27
+ * @param {Object} bw - The bitwrench instance to register on
28
+ */
29
+ export function registerBCCL(bw) {
30
+ if (!bw) return;
31
+
32
+ // Register all make* functions
33
+ Object.entries(components).forEach(function(entry) {
34
+ var name = entry[0], fn = entry[1];
35
+ if (name.indexOf('make') === 0) {
36
+ bw[name] = fn;
37
+ }
38
+ });
39
+
40
+ // Factory dispatch: bw.make('card', props) → bw.makeCard(props)
41
+ bw.make = components.make;
42
+
43
+ // Component registry
44
+ bw.BCCL = components.BCCL;
45
+
46
+ // Variant class helper
47
+ bw.variantClass = components.variantClass;
48
+
49
+ // Create functions that return handles
50
+ if (typeof bw.renderComponent === 'function') {
51
+ Object.entries(components).forEach(function(entry) {
52
+ var name = entry[0], fn = entry[1];
53
+ if (name.indexOf('make') === 0) {
54
+ var createName = 'create' + name.substring(4);
55
+ bw[createName] = function(props) {
56
+ var taco = fn(props);
57
+ return bw.renderComponent(taco);
58
+ };
59
+ }
60
+ });
61
+ }
62
+ }
63
+
64
+ // Re-export all components for direct import
65
+ export { BCCL, make, variantClass } from './bitwrench-bccl.js';
66
+
67
+ // UMD auto-registration: if `bw` exists as a global, register automatically
68
+ if (typeof window !== 'undefined' && typeof window.bw !== 'undefined') {
69
+ registerBCCL(window.bw);
70
+ } else if (typeof globalThis !== 'undefined' && typeof globalThis.bw !== 'undefined') {
71
+ registerBCCL(globalThis.bw);
72
+ }