@ibgib/core-gib 0.0.4

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 (330) hide show
  1. package/.vscode/core-gib-snippets.code-snippets +189 -0
  2. package/.vscode/launch.json +24 -0
  3. package/.vscode/settings.json +56 -0
  4. package/.vscode/tasks.json +37 -0
  5. package/CHANGELOG.md +11 -0
  6. package/README.md +215 -0
  7. package/dist/common/aws-constants.d.mts +7 -0
  8. package/dist/common/aws-constants.d.mts.map +1 -0
  9. package/dist/common/aws-constants.mjs +7 -0
  10. package/dist/common/aws-constants.mjs.map +1 -0
  11. package/dist/common/bin/bin-types.d.mts +17 -0
  12. package/dist/common/bin/bin-types.d.mts.map +1 -0
  13. package/dist/common/bin/bin-types.mjs +3 -0
  14. package/dist/common/bin/bin-types.mjs.map +1 -0
  15. package/dist/common/cache/cache-types.d.mts +57 -0
  16. package/dist/common/cache/cache-types.d.mts.map +1 -0
  17. package/dist/common/cache/cache-types.mjs +2 -0
  18. package/dist/common/cache/cache-types.mjs.map +1 -0
  19. package/dist/common/comment/comment-constants.d.mts +11 -0
  20. package/dist/common/comment/comment-constants.d.mts.map +1 -0
  21. package/dist/common/comment/comment-constants.mjs +11 -0
  22. package/dist/common/comment/comment-constants.mjs.map +1 -0
  23. package/dist/common/comment/comment-helper.d.mts +59 -0
  24. package/dist/common/comment/comment-helper.d.mts.map +1 -0
  25. package/dist/common/comment/comment-helper.mjs +173 -0
  26. package/dist/common/comment/comment-helper.mjs.map +1 -0
  27. package/dist/common/comment/comment-types.d.mts +16 -0
  28. package/dist/common/comment/comment-types.d.mts.map +1 -0
  29. package/dist/common/comment/comment-types.mjs +2 -0
  30. package/dist/common/comment/comment-types.mjs.map +1 -0
  31. package/dist/common/display/display-helper.d.mts +19 -0
  32. package/dist/common/display/display-helper.d.mts.map +1 -0
  33. package/dist/common/display/display-helper.mjs +68 -0
  34. package/dist/common/display/display-helper.mjs.map +1 -0
  35. package/dist/common/display/display-types.d.mts +97 -0
  36. package/dist/common/display/display-types.d.mts.map +1 -0
  37. package/dist/common/display/display-types.mjs +37 -0
  38. package/dist/common/display/display-types.mjs.map +1 -0
  39. package/dist/common/encrypt/encrypt-constants.d.mts +27 -0
  40. package/dist/common/encrypt/encrypt-constants.d.mts.map +1 -0
  41. package/dist/common/encrypt/encrypt-constants.mjs +27 -0
  42. package/dist/common/encrypt/encrypt-constants.mjs.map +1 -0
  43. package/dist/common/encrypt/encrypt-types.d.mts +116 -0
  44. package/dist/common/encrypt/encrypt-types.d.mts.map +1 -0
  45. package/dist/common/encrypt/encrypt-types.mjs +9 -0
  46. package/dist/common/encrypt/encrypt-types.mjs.map +1 -0
  47. package/dist/common/error/error-constants.d.mts +9 -0
  48. package/dist/common/error/error-constants.d.mts.map +1 -0
  49. package/dist/common/error/error-constants.mjs +9 -0
  50. package/dist/common/error/error-constants.mjs.map +1 -0
  51. package/dist/common/error/error-helper.d.mts +43 -0
  52. package/dist/common/error/error-helper.d.mts.map +1 -0
  53. package/dist/common/error/error-helper.mjs +167 -0
  54. package/dist/common/error/error-helper.mjs.map +1 -0
  55. package/dist/common/error/error-types.d.mts +58 -0
  56. package/dist/common/error/error-types.d.mts.map +1 -0
  57. package/dist/common/error/error-types.mjs +2 -0
  58. package/dist/common/error/error-types.mjs.map +1 -0
  59. package/dist/common/form/form-helper.d.mts +97 -0
  60. package/dist/common/form/form-helper.d.mts.map +1 -0
  61. package/dist/common/form/form-helper.mjs +185 -0
  62. package/dist/common/form/form-helper.mjs.map +1 -0
  63. package/dist/common/form/form-items.d.mts +229 -0
  64. package/dist/common/form/form-items.d.mts.map +1 -0
  65. package/dist/common/form/form-items.mjs +63 -0
  66. package/dist/common/form/form-items.mjs.map +1 -0
  67. package/dist/common/import-export/import-export-types.d.mts +18 -0
  68. package/dist/common/import-export/import-export-types.d.mts.map +1 -0
  69. package/dist/common/import-export/import-export-types.mjs +2 -0
  70. package/dist/common/import-export/import-export-types.mjs.map +1 -0
  71. package/dist/common/legacy/legacy-types.d.mts +2 -0
  72. package/dist/common/legacy/legacy-types.d.mts.map +1 -0
  73. package/dist/common/legacy/legacy-types.mjs +2 -0
  74. package/dist/common/legacy/legacy-types.mjs.map +1 -0
  75. package/dist/common/link/link-constants.d.mts +2 -0
  76. package/dist/common/link/link-constants.d.mts.map +1 -0
  77. package/dist/common/link/link-constants.mjs +2 -0
  78. package/dist/common/link/link-constants.mjs.map +1 -0
  79. package/dist/common/link/link-helper.d.mts +37 -0
  80. package/dist/common/link/link-helper.d.mts.map +1 -0
  81. package/dist/common/link/link-helper.mjs +143 -0
  82. package/dist/common/link/link-helper.mjs.map +1 -0
  83. package/dist/common/link/link-types.d.mts +14 -0
  84. package/dist/common/link/link-types.d.mts.map +1 -0
  85. package/dist/common/link/link-types.mjs +2 -0
  86. package/dist/common/link/link-types.mjs.map +1 -0
  87. package/dist/common/other/graph-helper.d.mts +166 -0
  88. package/dist/common/other/graph-helper.d.mts.map +1 -0
  89. package/dist/common/other/graph-helper.mjs +710 -0
  90. package/dist/common/other/graph-helper.mjs.map +1 -0
  91. package/dist/common/other/ibgib-helper.d.mts +245 -0
  92. package/dist/common/other/ibgib-helper.d.mts.map +1 -0
  93. package/dist/common/other/ibgib-helper.mjs +641 -0
  94. package/dist/common/other/ibgib-helper.mjs.map +1 -0
  95. package/dist/common/other/other-constants.d.mts +53 -0
  96. package/dist/common/other/other-constants.d.mts.map +1 -0
  97. package/dist/common/other/other-constants.mjs +67 -0
  98. package/dist/common/other/other-constants.mjs.map +1 -0
  99. package/dist/common/other/other-types.d.mts +166 -0
  100. package/dist/common/other/other-types.d.mts.map +1 -0
  101. package/dist/common/other/other-types.mjs +30 -0
  102. package/dist/common/other/other-types.mjs.map +1 -0
  103. package/dist/common/other/svg-constants.d.mts +2 -0
  104. package/dist/common/other/svg-constants.d.mts.map +1 -0
  105. package/dist/common/other/svg-constants.mjs +2 -0
  106. package/dist/common/other/svg-constants.mjs.map +1 -0
  107. package/dist/common/other/svg-helper.d.mts +54 -0
  108. package/dist/common/other/svg-helper.d.mts.map +1 -0
  109. package/dist/common/other/svg-helper.mjs +170 -0
  110. package/dist/common/other/svg-helper.mjs.map +1 -0
  111. package/dist/common/pic/pic-constants.d.mts +13 -0
  112. package/dist/common/pic/pic-constants.d.mts.map +1 -0
  113. package/dist/common/pic/pic-constants.mjs +13 -0
  114. package/dist/common/pic/pic-constants.mjs.map +1 -0
  115. package/dist/common/pic/pic-helper.d.mts +70 -0
  116. package/dist/common/pic/pic-helper.d.mts.map +1 -0
  117. package/dist/common/pic/pic-helper.mjs +235 -0
  118. package/dist/common/pic/pic-helper.mjs.map +1 -0
  119. package/dist/common/pic/pic-types.d.mts +23 -0
  120. package/dist/common/pic/pic-types.d.mts.map +1 -0
  121. package/dist/common/pic/pic-types.mjs +2 -0
  122. package/dist/common/pic/pic-types.mjs.map +1 -0
  123. package/dist/common/root/root-constants.d.mts +40 -0
  124. package/dist/common/root/root-constants.d.mts.map +1 -0
  125. package/dist/common/root/root-constants.mjs +40 -0
  126. package/dist/common/root/root-constants.mjs.map +1 -0
  127. package/dist/common/root/root-types.d.mts +9 -0
  128. package/dist/common/root/root-types.d.mts.map +1 -0
  129. package/dist/common/root/root-types.mjs +2 -0
  130. package/dist/common/root/root-types.mjs.map +1 -0
  131. package/dist/common/tag/tag-constants.d.mts +21 -0
  132. package/dist/common/tag/tag-constants.d.mts.map +1 -0
  133. package/dist/common/tag/tag-constants.mjs +28 -0
  134. package/dist/common/tag/tag-constants.mjs.map +1 -0
  135. package/dist/common/tag/tag-types.d.mts +14 -0
  136. package/dist/common/tag/tag-types.d.mts.map +1 -0
  137. package/dist/common/tag/tag-types.mjs +2 -0
  138. package/dist/common/tag/tag-types.mjs.map +1 -0
  139. package/dist/core-constants.d.mts +89 -0
  140. package/dist/core-constants.d.mts.map +1 -0
  141. package/dist/core-constants.mjs +484 -0
  142. package/dist/core-constants.mjs.map +1 -0
  143. package/dist/core-helper.d.mts +6 -0
  144. package/dist/core-helper.d.mts.map +1 -0
  145. package/dist/core-helper.mjs +28 -0
  146. package/dist/core-helper.mjs.map +1 -0
  147. package/dist/core-types.d.mts +520 -0
  148. package/dist/core-types.d.mts.map +1 -0
  149. package/dist/core-types.mjs +2 -0
  150. package/dist/core-types.mjs.map +1 -0
  151. package/dist/index.d.mts +2 -0
  152. package/dist/index.d.mts.map +1 -0
  153. package/dist/index.mjs +3 -0
  154. package/dist/index.mjs.map +1 -0
  155. package/dist/witness/app/app-base-v1.d.mts +130 -0
  156. package/dist/witness/app/app-base-v1.d.mts.map +1 -0
  157. package/dist/witness/app/app-base-v1.mjs +462 -0
  158. package/dist/witness/app/app-base-v1.mjs.map +1 -0
  159. package/dist/witness/app/app-constants.d.mts +10 -0
  160. package/dist/witness/app/app-constants.d.mts.map +1 -0
  161. package/dist/witness/app/app-constants.mjs +13 -0
  162. package/dist/witness/app/app-constants.mjs.map +1 -0
  163. package/dist/witness/app/app-helper.d.mts +85 -0
  164. package/dist/witness/app/app-helper.d.mts.map +1 -0
  165. package/dist/witness/app/app-helper.mjs +258 -0
  166. package/dist/witness/app/app-helper.mjs.map +1 -0
  167. package/dist/witness/app/app-types.d.mts +211 -0
  168. package/dist/witness/app/app-types.d.mts.map +1 -0
  169. package/dist/witness/app/app-types.mjs +49 -0
  170. package/dist/witness/app/app-types.mjs.map +1 -0
  171. package/dist/witness/app/chat-app/chat-app-types.d.mts +18 -0
  172. package/dist/witness/app/chat-app/chat-app-types.d.mts.map +1 -0
  173. package/dist/witness/app/chat-app/chat-app-types.mjs +25 -0
  174. package/dist/witness/app/chat-app/chat-app-types.mjs.map +1 -0
  175. package/dist/witness/app/flash-app/flash-app-types.d.mts +16 -0
  176. package/dist/witness/app/flash-app/flash-app-types.d.mts.map +1 -0
  177. package/dist/witness/app/flash-app/flash-app-types.mjs +23 -0
  178. package/dist/witness/app/flash-app/flash-app-types.mjs.map +1 -0
  179. package/dist/witness/app/raw-app/raw-app-types.d.mts +18 -0
  180. package/dist/witness/app/raw-app/raw-app-types.d.mts.map +1 -0
  181. package/dist/witness/app/raw-app/raw-app-types.mjs +25 -0
  182. package/dist/witness/app/raw-app/raw-app-types.mjs.map +1 -0
  183. package/dist/witness/app/todo-app/todo-app-types.d.ts +33 -0
  184. package/dist/witness/app/todo-app/todo-app-types.d.ts.map +1 -0
  185. package/dist/witness/app/todo-app/todo-app-types.js +31 -0
  186. package/dist/witness/app/todo-app/todo-app-types.js.map +1 -0
  187. package/dist/witness/robbot/robbot-base-v1.d.ts +432 -0
  188. package/dist/witness/robbot/robbot-base-v1.d.ts.map +1 -0
  189. package/dist/witness/robbot/robbot-base-v1.js +1407 -0
  190. package/dist/witness/robbot/robbot-base-v1.js.map +1 -0
  191. package/dist/witness/robbot/robbot-constants.d.mts +24 -0
  192. package/dist/witness/robbot/robbot-constants.d.mts.map +1 -0
  193. package/dist/witness/robbot/robbot-constants.mjs +24 -0
  194. package/dist/witness/robbot/robbot-constants.mjs.map +1 -0
  195. package/dist/witness/robbot/robbot-helper.d.mts +152 -0
  196. package/dist/witness/robbot/robbot-helper.d.mts.map +1 -0
  197. package/dist/witness/robbot/robbot-helper.mjs +609 -0
  198. package/dist/witness/robbot/robbot-helper.mjs.map +1 -0
  199. package/dist/witness/robbot/robbot-types.d.mts +539 -0
  200. package/dist/witness/robbot/robbot-types.d.mts.map +1 -0
  201. package/dist/witness/robbot/robbot-types.mjs +294 -0
  202. package/dist/witness/robbot/robbot-types.mjs.map +1 -0
  203. package/dist/witness/space/bootstrap/bootstrap-constants.d.mts +14 -0
  204. package/dist/witness/space/bootstrap/bootstrap-constants.d.mts.map +1 -0
  205. package/dist/witness/space/bootstrap/bootstrap-constants.mjs +15 -0
  206. package/dist/witness/space/bootstrap/bootstrap-constants.mjs.map +1 -0
  207. package/dist/witness/space/inner-space-v1.d.ts +63 -0
  208. package/dist/witness/space/inner-space-v1.d.ts.map +1 -0
  209. package/dist/witness/space/inner-space-v1.js +356 -0
  210. package/dist/witness/space/inner-space-v1.js.map +1 -0
  211. package/dist/witness/space/outer-space/outer-space-constants.d.mts +2 -0
  212. package/dist/witness/space/outer-space/outer-space-constants.d.mts.map +1 -0
  213. package/dist/witness/space/outer-space/outer-space-constants.mjs +2 -0
  214. package/dist/witness/space/outer-space/outer-space-constants.mjs.map +1 -0
  215. package/dist/witness/space/outer-space/outer-space-helper.d.mts +28 -0
  216. package/dist/witness/space/outer-space/outer-space-helper.d.mts.map +1 -0
  217. package/dist/witness/space/outer-space/outer-space-helper.mjs +87 -0
  218. package/dist/witness/space/outer-space/outer-space-helper.mjs.map +1 -0
  219. package/dist/witness/space/outer-space/outer-space-types.d.mts +548 -0
  220. package/dist/witness/space/outer-space/outer-space-types.d.mts.map +1 -0
  221. package/dist/witness/space/outer-space/outer-space-types.mjs +118 -0
  222. package/dist/witness/space/outer-space/outer-space-types.mjs.map +1 -0
  223. package/dist/witness/space/space-base-v1.d.mts +147 -0
  224. package/dist/witness/space/space-base-v1.d.mts.map +1 -0
  225. package/dist/witness/space/space-base-v1.mjs +350 -0
  226. package/dist/witness/space/space-base-v1.mjs.map +1 -0
  227. package/dist/witness/space/space-constants.d.mts +181 -0
  228. package/dist/witness/space/space-constants.d.mts.map +1 -0
  229. package/dist/witness/space/space-constants.mjs +192 -0
  230. package/dist/witness/space/space-constants.mjs.map +1 -0
  231. package/dist/witness/space/space-helper.d.mts +666 -0
  232. package/dist/witness/space/space-helper.d.mts.map +1 -0
  233. package/dist/witness/space/space-helper.mjs +2830 -0
  234. package/dist/witness/space/space-helper.mjs.map +1 -0
  235. package/dist/witness/space/space-types.d.mts +422 -0
  236. package/dist/witness/space/space-types.d.mts.map +1 -0
  237. package/dist/witness/space/space-types.mjs +52 -0
  238. package/dist/witness/space/space-types.mjs.map +1 -0
  239. package/dist/witness/witness-base-v1.d.ts +144 -0
  240. package/dist/witness/witness-base-v1.d.ts.map +1 -0
  241. package/dist/witness/witness-base-v1.js +300 -0
  242. package/dist/witness/witness-base-v1.js.map +1 -0
  243. package/dist/witness/witness-constants.d.mts +3 -0
  244. package/dist/witness/witness-constants.d.mts.map +1 -0
  245. package/dist/witness/witness-constants.mjs +3 -0
  246. package/dist/witness/witness-constants.mjs.map +1 -0
  247. package/dist/witness/witness-form-builder.d.mts +45 -0
  248. package/dist/witness/witness-form-builder.d.mts.map +1 -0
  249. package/dist/witness/witness-form-builder.mjs +95 -0
  250. package/dist/witness/witness-form-builder.mjs.map +1 -0
  251. package/dist/witness/witness-helper.d.mts +89 -0
  252. package/dist/witness/witness-helper.d.mts.map +1 -0
  253. package/dist/witness/witness-helper.mjs +229 -0
  254. package/dist/witness/witness-helper.mjs.map +1 -0
  255. package/dist/witness/witness-types.d.mts +211 -0
  256. package/dist/witness/witness-types.d.mts.map +1 -0
  257. package/dist/witness/witness-types.mjs +2 -0
  258. package/dist/witness/witness-types.mjs.map +1 -0
  259. package/jasmine-browser.json +18 -0
  260. package/jasmine.json +6 -0
  261. package/package.json +67 -0
  262. package/src/assumptions.spec.mts +45 -0
  263. package/src/common/aws-constants.mts +5 -0
  264. package/src/common/bin/bin-types.mts +17 -0
  265. package/src/common/cache/cache-types.mts +53 -0
  266. package/src/common/comment/comment-constants.mts +10 -0
  267. package/src/common/comment/comment-helper.mts +211 -0
  268. package/src/common/comment/comment-types.mts +19 -0
  269. package/src/common/display/display-helper.mts +88 -0
  270. package/src/common/display/display-types.mts +108 -0
  271. package/src/common/encrypt/encrypt-constants.mts +28 -0
  272. package/src/common/encrypt/encrypt-types.mts +130 -0
  273. package/src/common/error/error-constants.mts +8 -0
  274. package/src/common/error/error-helper.mts +155 -0
  275. package/src/common/error/error-types.mts +62 -0
  276. package/src/common/form/form-helper.mts +253 -0
  277. package/src/common/form/form-items.mts +236 -0
  278. package/src/common/import-export/import-export-types.mts +18 -0
  279. package/src/common/legacy/about-legacy.md +0 -0
  280. package/src/common/legacy/legacy-types.mts +0 -0
  281. package/src/common/link/link-constants.mts +1 -0
  282. package/src/common/link/link-helper.mts +155 -0
  283. package/src/common/link/link-types.mts +16 -0
  284. package/src/common/other/graph-helper.mts +853 -0
  285. package/src/common/other/ibgib-helper.mts +671 -0
  286. package/src/common/other/other-constants.mts +76 -0
  287. package/src/common/other/other-types.mts +186 -0
  288. package/src/common/other/svg-constants.mts +1 -0
  289. package/src/common/other/svg-helper.mts +238 -0
  290. package/src/common/pic/pic-constants.mts +13 -0
  291. package/src/common/pic/pic-helper.mts +295 -0
  292. package/src/common/pic/pic-types.mts +29 -0
  293. package/src/common/root/root-constants.mts +41 -0
  294. package/src/common/root/root-types.mts +8 -0
  295. package/src/common/tag/tag-constants.mts +34 -0
  296. package/src/common/tag/tag-types.mts +19 -0
  297. package/src/core-constants.mts +506 -0
  298. package/src/core-helper.mts +33 -0
  299. package/src/core-types.mts +519 -0
  300. package/src/helper.spec.mts +64 -0
  301. package/src/index.mts +1 -0
  302. package/src/witness/app/app-base-v1.mts +584 -0
  303. package/src/witness/app/app-constants.mts +16 -0
  304. package/src/witness/app/app-helper.mts +322 -0
  305. package/src/witness/app/app-types.mts +252 -0
  306. package/src/witness/app/chat-app/chat-app-types.mts +40 -0
  307. package/src/witness/app/flash-app/flash-app-types.mts +38 -0
  308. package/src/witness/app/raw-app/raw-app-types.mts +40 -0
  309. package/src/witness/app/todo-app/todo-app-types.ts +59 -0
  310. package/src/witness/robbot/robbot-base-v1.ts +1531 -0
  311. package/src/witness/robbot/robbot-constants.mts +25 -0
  312. package/src/witness/robbot/robbot-helper.mts +676 -0
  313. package/src/witness/robbot/robbot-helper.spec.mts +135 -0
  314. package/src/witness/robbot/robbot-types.mts +797 -0
  315. package/src/witness/space/bootstrap/bootstrap-constants.mts +15 -0
  316. package/src/witness/space/inner-space-v1.ts +372 -0
  317. package/src/witness/space/outer-space/outer-space-constants.mts +1 -0
  318. package/src/witness/space/outer-space/outer-space-helper.mts +91 -0
  319. package/src/witness/space/outer-space/outer-space-types.mts +627 -0
  320. package/src/witness/space/space-base-v1.mts +414 -0
  321. package/src/witness/space/space-constants.mts +208 -0
  322. package/src/witness/space/space-helper.mts +3242 -0
  323. package/src/witness/space/space-types.mts +476 -0
  324. package/src/witness/witness-base-v1.ts +325 -0
  325. package/src/witness/witness-constants.mts +2 -0
  326. package/src/witness/witness-form-builder.mts +128 -0
  327. package/src/witness/witness-helper.mts +256 -0
  328. package/src/witness/witness-types.mts +249 -0
  329. package/tsconfig.json +15 -0
  330. package/tsconfig.test.json +10 -0
@@ -0,0 +1,76 @@
1
+ /**
2
+ * @module
3
+ *
4
+ * not quite sure where these go.
5
+ *
6
+ * todo: check after the project is building where these other-constants fit.
7
+ */
8
+
9
+ /**
10
+ * default id settings where...?
11
+ */
12
+ export const DEFAULT_UUID = undefined;
13
+
14
+ import { ROBBOT_REL8N_NAME } from '../../witness/robbot/robbot-constants.mjs';
15
+ import { SYNC_SPACE_REL8N_NAME } from '../../witness/space/space-constants.mjs';
16
+ import { DEFAULT_ROOT_REL8N_NAME, ROOT_REL8N_NAME } from '../root/root-constants.mjs';
17
+ import { TAGGED_REL8N_NAME, TAG_REL8N_NAME } from '../tag/tag-constants.mjs';
18
+
19
+
20
+ export const CONSENSUS_REL8N_NAME = 'consensus';
21
+ export const CONSENSUS_ADDR_SYNC_NAIVE_PUT_MERGE = 'sync naive put merge^gib'
22
+
23
+ export const AUTOSYNC_ALWAYS_REL8N_NAME = 'always';
24
+ export const ARCHIVE_REL8N_NAME = 'archive';
25
+ export const TRASH_REL8N_NAME = 'trash';
26
+
27
+ /**
28
+ * These rel8n names are shown in a list view by default.
29
+ *
30
+ * This should perhaps go into a chat or common ux constants?
31
+ */
32
+ export const DEFAULT_LIST_REL8N_NAMES: string[] = [
33
+ 'pic', 'comment', 'link',
34
+ 'result', 'import',
35
+ 'tagged',
36
+ TAGGED_REL8N_NAME,
37
+ TAG_REL8N_NAME,
38
+ ROOT_REL8N_NAME, // hack for now to get all to show
39
+ DEFAULT_ROOT_REL8N_NAME,
40
+ ROBBOT_REL8N_NAME,
41
+ SYNC_SPACE_REL8N_NAME,
42
+ ];
43
+
44
+ /**
45
+ *
46
+ */
47
+ export const CURRENT_VERSION = '1';
48
+
49
+ /**
50
+ * List of common special chars for english.
51
+ *
52
+ * ## intent
53
+ *
54
+ * When sanitizing input.
55
+ */
56
+ export const ALLISH_SPECIAL_CHARS = `\`~!@#$%^&*()_\\-+=|\\\\\\]}[{"':;?/>.<,`;
57
+ export const FILENAME_SPECIAL_CHARS = ` \`~!@#$%&*()_\\-+=|\\]}[{"';?>.<,`;
58
+
59
+ /**
60
+ * If this matches, then we will encode the data field in our storage (aws
61
+ * anyway atow)
62
+ */
63
+ export const IBGIB_DATA_REGEX_INDICATES_NEED_TO_ENCODE = /[^\w\s\d`~!@#$%\^&*()_\\\-+=|\]\}\[\{"':;?/>.<,]/;
64
+
65
+ /**
66
+ * hacky scroll to bottom after items load per platform
67
+ */
68
+ export const DEFAULT_SCROLL_DELAY_MS_WEB_HACK = 5_000;
69
+ /**
70
+ * hacky scroll to bottom after items load per platform
71
+ */
72
+ export const DEFAULT_SCROLL_DELAY_MS_ANDROID_HACK = 3_000;
73
+ /**
74
+ * hacky scroll to bottom after items load per platform
75
+ */
76
+ export const DEFAULT_SCROLL_DELAY_MS_IOS_HACK = 2_000;
@@ -0,0 +1,186 @@
1
+ // #region from common/types/legacy.ts
2
+
3
+ // todo: clean up legacy get/put functions
4
+ // I started ionic-gib without a clear architectural design, so this is "legacy"
5
+ // with respect to that. I had several functions that used these types, and I
6
+ // left them as-is at the time. after this refactor, this needs to be cleaned
7
+ // up. Perhaps this goes in capacitor-gib even?
8
+
9
+ import { IbGibAddr } from '@ibgib/ts-gib';
10
+ import { IbGib_V1 } from '@ibgib/ts-gib/dist/V1/index.mjs';
11
+ import { IbGibSpaceAny } from '../../witness/space/space-base-v1.mjs';
12
+
13
+ export interface FileResult {
14
+ success?: boolean;
15
+ /**
16
+ * If errored, this will contain the errorMsg.
17
+ */
18
+ errorMsg?: string;
19
+ /**
20
+ * True if failed due to timing out.
21
+ */
22
+ timedOut?: boolean;
23
+ }
24
+
25
+ /**
26
+ * Options for retrieving data from the file system.
27
+ */
28
+ export interface GetIbGibOpts {
29
+ /**
30
+ * If getting ibGib object, this is its address.
31
+ */
32
+ addr?: IbGibAddr;
33
+ /**
34
+ * If getting multiple ibGibs, use this array of addrs.
35
+ */
36
+ addrs?: IbGibAddr[];
37
+ /**
38
+ * If truthy, will look in the meta subpath first, then the regular if not found.
39
+ */
40
+ isMeta?: boolean;
41
+ /**
42
+ * Are we looking for a DNA ibgib?
43
+ */
44
+ isDna?: boolean;
45
+ /**
46
+ * space from which to get the ibgib
47
+ *
48
+ * @default localUserSpace
49
+ */
50
+ space?: IbGibSpaceAny,
51
+ /**
52
+ * If supplied, first acquires the lock with this scope on the
53
+ * given `space` (which defaults to localUserSpace).
54
+ */
55
+ lockScope?: string,
56
+ /**
57
+ * Cancels if can't acquire lock after approximately this time.
58
+ */
59
+ lockTimeoutMs?: number,
60
+ /**
61
+ * If true, will not get from cache and will force retrieval from the real
62
+ * bucket. In Ionic space, this means will look in ionic storage proper.
63
+ */
64
+ force?: boolean;
65
+ }
66
+
67
+ /**
68
+ * Result for retrieving an ibGib from the file system.
69
+ */
70
+ export interface GetIbGibResult extends FileResult {
71
+ /**
72
+ * ibGibs if retrieving a "regular" ibGib.
73
+ *
74
+ * This is used when you're not getting a pic, e.g.
75
+ */
76
+ ibGibs?: IbGib_V1[];
77
+ /**
78
+ * This is used when you're getting a pic's binary content.
79
+ */
80
+ // binData?: any;
81
+ /**
82
+ * access to raw result ibgib that caller must cast to the correct shape.
83
+ */
84
+ rawResultIbGib?: IbGib_V1;
85
+ }
86
+
87
+ export interface PutIbGibOpts {
88
+ /**
89
+ * ibGib to put.
90
+ *
91
+ * If you only want to do just one, use this param. Otherwise, use the
92
+ * `ibGibs` array param.
93
+ */
94
+ ibGib?: IbGib_V1;
95
+ /**
96
+ * ibGibs to put in the space.
97
+ *
98
+ * If you want to put more than one ibGib, use this param. If you only
99
+ * want to put a single ibGib, you could also use the `ibGib` param.
100
+ */
101
+ ibGibs?: IbGib_V1[];
102
+ /**
103
+ * if true, will store this data in the bin folder with its hash.
104
+ */
105
+ // binData?: string;
106
+ /**
107
+ * If true, will store in a different folder.
108
+ */
109
+ isDna?: boolean;
110
+ /**
111
+ * extension to store the bindata with.
112
+ */
113
+ // binExt?: string;
114
+ /**
115
+ * If true, will store with metas.
116
+ */
117
+ isMeta?: boolean;
118
+ /**
119
+ * If true, will replace an existing ibGib file
120
+ */
121
+ force?: boolean;
122
+ /**
123
+ * space into which we shall put the ibgib.
124
+ *
125
+ * @default localCurrentSpace
126
+ */
127
+ space?: IbGibSpaceAny,
128
+ }
129
+
130
+ /**
131
+ * Result for putting ibgib.
132
+ */
133
+ export interface PutIbGibResult extends FileResult {
134
+ binHash?: string;
135
+ }
136
+
137
+ export interface DeleteIbGibOpts extends GetIbGibOpts { }
138
+ export interface DeleteIbGibResult extends FileResult { }
139
+
140
+ // #endregion from common/types/legacy.ts
141
+
142
+ /**
143
+ * Special ibgib types, used for metadata within a space.
144
+ *
145
+ * Unsure where to place this...
146
+ */
147
+ export type SpecialIbGibType =
148
+ "tags" | "roots" | "latest" | "outerspaces" | "secrets" |
149
+ "encryptions" | "autosyncs" | "robbots" | "apps" | "history";
150
+ /**
151
+ * Special ibgib types, used for metadata within a space.
152
+ *
153
+ * Unsure where to place this...
154
+ */
155
+ export const SpecialIbGibType = {
156
+ /** indexes all tag ibgibs within a space */
157
+ tags: "tags" as SpecialIbGibType,
158
+ /** indexes all root ibgibs within a space */
159
+ roots: "roots" as SpecialIbGibType,
160
+ /**
161
+ * Ephemeral index ibgib that maps a tjp address -> latest local address in
162
+ * a space.
163
+ */
164
+ latest: "latest" as SpecialIbGibType,
165
+ /** indexes all outerspace ibgibs, including sync spaces, within a space */
166
+ outerspaces: "outerspaces" as SpecialIbGibType,
167
+ /** indexes all secret ibgibs within a space */
168
+ secrets: "secrets" as SpecialIbGibType,
169
+ /** indexes all encryption setting ibgibs within a space */
170
+ encryptions: "encryptions" as SpecialIbGibType,
171
+ /** indexes all tjp addresses that automatically sync. */
172
+ autosyncs: "autosyncs" as SpecialIbGibType,
173
+ robbots: "robbots" as SpecialIbGibType,
174
+ apps: "apps" as SpecialIbGibType,
175
+ /** timelines history */
176
+ history: "history" as SpecialIbGibType,
177
+ }
178
+
179
+ /**
180
+ * There has been a new ibGib that is the latest for a given tjp timeline.
181
+ */
182
+ export interface IbGibTimelineUpdateInfo {
183
+ tjpAddr?: IbGibAddr;
184
+ latestAddr: IbGibAddr;
185
+ latestIbGib?: IbGib_V1<any>;
186
+ }
@@ -0,0 +1 @@
1
+ export const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
@@ -0,0 +1,238 @@
1
+ import { SVG_NAMESPACE } from "./svg-constants.mjs";
2
+
3
+ export function ibSvg({
4
+ width, height,
5
+ }: {
6
+ width: number, height: number,
7
+ }): SVGElement {
8
+ const lc = `[${ibSvg.name}]`;
9
+ try {
10
+ const svg = document.createElementNS(SVG_NAMESPACE, 'svg');
11
+ svg.setAttribute('width', `${width}`);
12
+ svg.setAttribute('height', `${height}`);
13
+
14
+ const defs: SVGDefsElement = document.createElementNS(SVG_NAMESPACE, 'defs');
15
+ svg.append(defs);
16
+
17
+ return svg;
18
+ } catch (error) {
19
+ console.error(`${lc} ${error.message}`);
20
+ throw error;
21
+ }
22
+ }
23
+
24
+ export function ibGetDefs({
25
+ svg,
26
+ }: {
27
+ svg: SVGElement,
28
+ }): SVGDefsElement | undefined {
29
+ const lc = `[${ibGetDefs.name}]`;
30
+ try {
31
+ let defs: SVGDefsElement | undefined;
32
+ svg.childNodes.forEach(x => {
33
+ if (x.nodeName === 'defs') { defs = (x as SVGDefsElement); }
34
+ });
35
+ return defs ?? undefined;
36
+ } catch (error) {
37
+ debugger;
38
+ console.error(`${lc} ${error.message}`);
39
+ throw error;
40
+ }
41
+ }
42
+
43
+ export function ibGroup({
44
+ parent,
45
+ x, y,
46
+ width, height,
47
+ style,
48
+ fill,
49
+ opacity,
50
+ stroke,
51
+ strokeWidth,
52
+ }: {
53
+ /**
54
+ * If provided, will append to the svg
55
+ */
56
+ parent?: SVGElement,
57
+ x: number, y: number,
58
+ width: number, height: number,
59
+ style?: string,
60
+ fill?: string,
61
+ opacity?: number,
62
+ stroke?: string,
63
+ strokeWidth?: string,
64
+ }): SVGGElement {
65
+ const lc = `[${ibGroup.name}]`;
66
+ try {
67
+ stroke = stroke || 'black';
68
+ strokeWidth = strokeWidth || '1px';
69
+ if (!style) {
70
+ style = `stroke:${stroke};stroke-width:${strokeWidth}`;
71
+ if (fill) { style += `;fill:${fill}`; }
72
+ }
73
+
74
+ const group = document.createElementNS(SVG_NAMESPACE, 'g');
75
+ group.setAttribute('x', `${x}`);
76
+ group.setAttribute('y', `${y}`);
77
+ group.setAttribute('transform', `translate(${x},${y})`);
78
+ group.setAttribute('width', `${width}`);
79
+ group.setAttribute('height', `${height}`);
80
+ if (opacity || opacity == 0) { group.setAttribute('opacity', opacity.toString()); }
81
+ group.setAttribute('style', style);
82
+
83
+ if (parent) { parent.appendChild(group); }
84
+
85
+ return group;
86
+ } catch (error) {
87
+ console.error(`${lc} ${error.message}`);
88
+ throw error;
89
+ }
90
+ }
91
+
92
+ export function ibCircle({
93
+ parent,
94
+ id,
95
+ cx, cy,
96
+ r,
97
+ style,
98
+ fill,
99
+ opacity,
100
+ stroke,
101
+ strokeWidth,
102
+ picSrcFn,
103
+ }: {
104
+ /**
105
+ * If provided, will append created element to this
106
+ */
107
+ parent?: SVGElement,
108
+ id?: string,
109
+ cx: number, cy: number,
110
+ r: number,
111
+ style?: string,
112
+ fill?: string,
113
+ opacity?: number,
114
+ stroke?: string,
115
+ strokeWidth?: string,
116
+ picSrcFn?: () => string,
117
+ commentTextFn?: () => string,
118
+ }): SVGCircleElement {
119
+ const lc = `[${ibCircle.name}]`;
120
+ try {
121
+ stroke = stroke || 'black';
122
+ strokeWidth = strokeWidth || '1px';
123
+ if (!style) {
124
+ style = `stroke:${stroke};stroke-width:${strokeWidth}`;
125
+ }
126
+
127
+ const circle = document.createElementNS(SVG_NAMESPACE, 'circle');
128
+ circle.setAttribute('cx', `${cx}`);
129
+ circle.setAttribute('cy', `${cy}`);
130
+ circle.setAttribute('r', `${r}`);
131
+ if (fill) { circle.setAttribute('fill', fill); }
132
+ if (opacity || opacity == 0) { circle.setAttribute('opacity', opacity.toString()); }
133
+ circle.setAttribute('style', style);
134
+
135
+ if (picSrcFn) {
136
+ const widthHeight = `${2 * r}`;
137
+ let defs: SVGDefsElement | undefined;
138
+ if (!parent) { throw new Error(`(UNEXPECTED) parent falsy but picSrcFn truthy (E: cb15575c925943fec85ac49d7cb70d23)`); }
139
+ parent.childNodes?.forEach((child: any) => {
140
+ if (child.nodeName === 'defs') { defs = child; }
141
+ });
142
+ if (!defs) {
143
+ defs = document.createElementNS(SVG_NAMESPACE, 'defs');
144
+ parent.appendChild(defs);
145
+ }
146
+
147
+ let pattern: SVGPatternElement = document.createElementNS(SVG_NAMESPACE, 'pattern');
148
+ if (!id) { throw new Error(`id required for pics (E: a179adeb6d2998af0ebea19b7a81b722)`); }
149
+ pattern.setAttribute('id', `id_${id}`);
150
+ pattern.setAttribute('patternUnits', 'userSpaceOnUse');
151
+ pattern.setAttribute('width', widthHeight);
152
+ pattern.setAttribute('height', widthHeight);
153
+ pattern.setAttribute('x', `-${r}`);
154
+ pattern.setAttribute('y', `-${r}`);
155
+ // pattern.setAttribute('patternUnits', 'objectBoundingBox');
156
+ // pattern.setAttribute('width', '1');
157
+ // pattern.setAttribute('height', '1');
158
+ defs.appendChild(pattern);
159
+
160
+ let image: SVGImageElement = document.createElementNS(SVG_NAMESPACE, 'image');
161
+ let src = picSrcFn();
162
+ image.setAttribute('href', src);
163
+ image.setAttribute('x', '0');
164
+ image.setAttribute('y', '0');
165
+ image.setAttribute('width', widthHeight);
166
+ image.setAttribute('height', widthHeight);
167
+ pattern.appendChild(image);
168
+
169
+ // fill="url(#image)"
170
+ circle.setAttribute('fill', `url(#id_${id})`);
171
+ // circle.appendChild(image);
172
+ // https://blog.idrsolutions.com/how-to-embed-base64-images-in-svg/
173
+ }
174
+
175
+ if (parent) { parent.appendChild(circle); }
176
+
177
+ return circle;
178
+ } catch (error) {
179
+ debugger;
180
+ console.error(`${lc} ${error.message}`);
181
+ throw error;
182
+ }
183
+ }
184
+
185
+ export function ibLine({
186
+ parent,
187
+ x1y1, x2y2,
188
+ style,
189
+ opacity,
190
+ stroke,
191
+ strokeWidth,
192
+ }: {
193
+ /**
194
+ * If provided, will append created element to this
195
+ */
196
+ parent?: SVGElement,
197
+ x1y1: [number, number],
198
+ x2y2: [number, number],
199
+ style?: string,
200
+ opacity?: number,
201
+ stroke?: string,
202
+ strokeWidth?: string,
203
+ }): SVGLineElement {
204
+ const lc = `[${ibLine.name}]`;
205
+ try {
206
+ stroke = stroke || 'black';
207
+ strokeWidth = strokeWidth || '1px';
208
+ if (!style) {
209
+ style = `stroke:${stroke};stroke-width:${strokeWidth}`;
210
+ }
211
+
212
+ const line = document.createElementNS(SVG_NAMESPACE, 'line');
213
+ line.setAttribute('x1', `${x1y1[0]}`);
214
+ line.setAttribute('y1', `${x1y1[1]}`);
215
+ line.setAttribute('x2', `${x2y2[0]}`);
216
+ line.setAttribute('y2', `${x2y2[1]}`);
217
+ if (opacity || opacity == 0) { line.setAttribute('opacity', opacity.toString()); }
218
+ line.setAttribute('style', style);
219
+
220
+ if (parent) { parent.appendChild(line); }
221
+
222
+ return line;
223
+ } catch (error) {
224
+ console.error(`${lc} ${error.message}`);
225
+ throw error;
226
+ }
227
+ }
228
+
229
+ export function ibAnimate({
230
+
231
+ }): SVGAnimateElement | undefined {
232
+ return undefined;
233
+ }
234
+ export function ibAnimateMotion({
235
+
236
+ }): SVGAnimateMotionElement | undefined {
237
+ return undefined;
238
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * default if for some reason there is no extension in data.ext
3
+ *
4
+ * ## driving itnent
5
+ *
6
+ * implementing download pic
7
+ */
8
+ export const DEFAULT_PIC_FILE_EXTENSION = 'png';
9
+
10
+ /**
11
+ * todo: resolve pic/bin separation. BINARY_REL8N_NAME
12
+ */
13
+ export const BINARY_REL8N_NAME = 'bin';