solid-panes 3.7.2 → 3.7.3-3425a37d

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 (354) hide show
  1. package/dist/dashboard/basicPreferences.js +155 -0
  2. package/dist/dashboard/basicPreferences.js.map +1 -0
  3. package/dist/dashboard/dashboardPane.js +63 -0
  4. package/dist/dashboard/dashboardPane.js.map +1 -0
  5. package/dist/dashboard/homepage.js +63 -0
  6. package/dist/dashboard/homepage.js.map +1 -0
  7. package/dist/home/homePane.js +68 -0
  8. package/dist/home/homePane.js.map +1 -0
  9. package/dist/index.js +48 -0
  10. package/dist/index.js.map +1 -0
  11. package/dist/internal/internalPane.js +195 -0
  12. package/dist/internal/internalPane.js.map +1 -0
  13. package/dist/mainPage/footer.js +16 -0
  14. package/dist/mainPage/footer.js.map +1 -0
  15. package/dist/mainPage/header.js +84 -0
  16. package/dist/mainPage/header.js.map +1 -0
  17. package/{lib → dist}/mainPage/index.d.ts.map +1 -1
  18. package/dist/mainPage/index.js +30 -0
  19. package/dist/mainPage/index.js.map +1 -0
  20. package/dist/outline/context.js +13 -0
  21. package/dist/outline/context.js.map +1 -0
  22. package/dist/outline/propertyViews.js +33 -0
  23. package/dist/outline/propertyViews.js.map +1 -0
  24. package/dist/outline/viewAsImage.js +7 -0
  25. package/dist/outline/viewAsImage.js.map +1 -0
  26. package/{lib → dist}/outline/viewAsMbox.js +4 -14
  27. package/dist/outline/viewAsMbox.js.map +1 -0
  28. package/dist/pad/padPane.js +420 -0
  29. package/dist/pad/padPane.js.map +1 -0
  30. package/dist/sharing/sharingPane.js +45 -0
  31. package/dist/sharing/sharingPane.js.map +1 -0
  32. package/dist/tabbed/tabbedPane.js +55 -0
  33. package/dist/tabbed/tabbedPane.js.map +1 -0
  34. package/dist/trustedApplications/trustedApplications.dom.js +158 -0
  35. package/dist/trustedApplications/trustedApplications.dom.js.map +1 -0
  36. package/dist/trustedApplications/trustedApplications.utils.js +24 -0
  37. package/dist/trustedApplications/trustedApplications.utils.js.map +1 -0
  38. package/dist/trustedApplications/trustedApplications.view.js +62 -0
  39. package/dist/trustedApplications/trustedApplications.view.js.map +1 -0
  40. package/dist/types.js +2 -0
  41. package/dist/types.js.map +1 -0
  42. package/dist/versionInfo.js +31 -0
  43. package/dist/versionInfo.js.map +1 -0
  44. package/package.json +34 -22
  45. package/Documentation/VisualLanguage.html +0 -538
  46. package/Documentation/conventions.md +0 -333
  47. package/coverage/clover.xml +0 -152
  48. package/coverage/coverage-final.json +0 -6
  49. package/coverage/lcov-report/base.css +0 -224
  50. package/coverage/lcov-report/block-navigation.js +0 -87
  51. package/coverage/lcov-report/favicon.png +0 -0
  52. package/coverage/lcov-report/index.html +0 -131
  53. package/coverage/lcov-report/outline/index.html +0 -161
  54. package/coverage/lcov-report/outline/outlineIcons.js.html +0 -565
  55. package/coverage/lcov-report/outline/propertyViews.ts.html +0 -196
  56. package/coverage/lcov-report/outline/viewAsImage.ts.html +0 -121
  57. package/coverage/lcov-report/outline/viewAsMbox.ts.html +0 -127
  58. package/coverage/lcov-report/prettify.css +0 -1
  59. package/coverage/lcov-report/prettify.js +0 -2
  60. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  61. package/coverage/lcov-report/sorter.js +0 -210
  62. package/coverage/lcov-report/trustedApplications/index.html +0 -116
  63. package/coverage/lcov-report/trustedApplications/trustedApplications.utils.ts.html +0 -238
  64. package/coverage/lcov.info +0 -204
  65. package/dev/index.html +0 -28
  66. package/dev/loader.ts +0 -91
  67. package/dev/pane/index.ts +0 -10
  68. package/doc/images/panes-for-classes.epgz +0 -0
  69. package/doc/images/panes-for-classes.svg +0 -609
  70. package/eslint.config.mjs +0 -34
  71. package/jest.config.js +0 -27
  72. package/jest.setup.ts +0 -4
  73. package/lib/RDFXMLPane.js +0 -59
  74. package/lib/RDFXMLPane.js.map +0 -1
  75. package/lib/argument/argumentPane.js +0 -62
  76. package/lib/argument/argumentPane.js.map +0 -1
  77. package/lib/attach/attachPane.js +0 -404
  78. package/lib/attach/attachPane.js.map +0 -1
  79. package/lib/audio/audioPane.js +0 -183
  80. package/lib/audio/audioPane.js.map +0 -1
  81. package/lib/classInstancePane.js +0 -93
  82. package/lib/classInstancePane.js.map +0 -1
  83. package/lib/dashboard/basicPreferences.js +0 -229
  84. package/lib/dashboard/basicPreferences.js.map +0 -1
  85. package/lib/dashboard/dashboardPane.js +0 -73
  86. package/lib/dashboard/dashboardPane.js.map +0 -1
  87. package/lib/dashboard/homepage.js +0 -86
  88. package/lib/dashboard/homepage.js.map +0 -1
  89. package/lib/dataContentPane.js +0 -259
  90. package/lib/dataContentPane.js.map +0 -1
  91. package/lib/defaultPane.js +0 -76
  92. package/lib/defaultPane.js.map +0 -1
  93. package/lib/dokieli/dokieliPane.js +0 -173
  94. package/lib/dokieli/dokieliPane.js.map +0 -1
  95. package/lib/dokieli/new.js +0 -9
  96. package/lib/dokieli/new.js.map +0 -1
  97. package/lib/form/pane.js +0 -186
  98. package/lib/form/pane.js.map +0 -1
  99. package/lib/global.d.js +0 -2
  100. package/lib/global.d.js.map +0 -1
  101. package/lib/home/homePane.js +0 -91
  102. package/lib/home/homePane.js.map +0 -1
  103. package/lib/humanReadablePane.js +0 -138
  104. package/lib/humanReadablePane.js.map +0 -1
  105. package/lib/imagePane.js +0 -71
  106. package/lib/imagePane.js.map +0 -1
  107. package/lib/index.js +0 -112
  108. package/lib/index.js.map +0 -1
  109. package/lib/internal/internalPane.js +0 -184
  110. package/lib/internal/internalPane.js.map +0 -1
  111. package/lib/mainPage/footer.js +0 -22
  112. package/lib/mainPage/footer.js.map +0 -1
  113. package/lib/mainPage/header.js +0 -152
  114. package/lib/mainPage/header.js.map +0 -1
  115. package/lib/mainPage/index.js +0 -42
  116. package/lib/mainPage/index.js.map +0 -1
  117. package/lib/microblogPane/microblogPane.js +0 -1032
  118. package/lib/microblogPane/microblogPane.js.map +0 -1
  119. package/lib/n3Pane.js +0 -57
  120. package/lib/n3Pane.js.map +0 -1
  121. package/lib/outline/context.js +0 -19
  122. package/lib/outline/context.js.map +0 -1
  123. package/lib/outline/manager.js +0 -2264
  124. package/lib/outline/manager.js.map +0 -1
  125. package/lib/outline/manager.test.d.ts +0 -2
  126. package/lib/outline/manager.test.d.ts.map +0 -1
  127. package/lib/outline/manager.test.js +0 -210
  128. package/lib/outline/manager.test.js.map +0 -1
  129. package/lib/outline/outlineIcons.js +0 -128
  130. package/lib/outline/outlineIcons.js.map +0 -1
  131. package/lib/outline/propertyViews.js +0 -44
  132. package/lib/outline/propertyViews.js.map +0 -1
  133. package/lib/outline/propertyViews.test.d.ts +0 -2
  134. package/lib/outline/propertyViews.test.d.ts.map +0 -1
  135. package/lib/outline/propertyViews.test.js +0 -27
  136. package/lib/outline/propertyViews.test.js.map +0 -1
  137. package/lib/outline/queryByExample.js +0 -286
  138. package/lib/outline/queryByExample.js.map +0 -1
  139. package/lib/outline/userInput.js +0 -1817
  140. package/lib/outline/userInput.js.map +0 -1
  141. package/lib/outline/viewAsImage.js +0 -17
  142. package/lib/outline/viewAsImage.js.map +0 -1
  143. package/lib/outline/viewAsMbox.js.map +0 -1
  144. package/lib/pad/padPane.js +0 -417
  145. package/lib/pad/padPane.js.map +0 -1
  146. package/lib/playlist/playlistPane.js +0 -125
  147. package/lib/playlist/playlistPane.js.map +0 -1
  148. package/lib/registerPanes.js +0 -146
  149. package/lib/registerPanes.js.map +0 -1
  150. package/lib/schedule/formsForSchedule.js +0 -8
  151. package/lib/schedule/formsForSchedule.js.map +0 -1
  152. package/lib/schedule/schedulePane.js +0 -895
  153. package/lib/schedule/schedulePane.js.map +0 -1
  154. package/lib/sharing/sharingPane.js +0 -49
  155. package/lib/sharing/sharingPane.js.map +0 -1
  156. package/lib/slideshow/slideshowPane.js +0 -84
  157. package/lib/slideshow/slideshowPane.js.map +0 -1
  158. package/lib/socialPane.js +0 -431
  159. package/lib/socialPane.js.map +0 -1
  160. package/lib/tabbed/tabbedPane.js +0 -72
  161. package/lib/tabbed/tabbedPane.js.map +0 -1
  162. package/lib/tableViewPane.js +0 -58
  163. package/lib/tableViewPane.js.map +0 -1
  164. package/lib/test-import-export/common.js +0 -12
  165. package/lib/test-import-export/common.js.map +0 -1
  166. package/lib/test-import-export/edit-importer.js +0 -25
  167. package/lib/test-import-export/edit-importer.js.map +0 -1
  168. package/lib/test-import-export/testImportExport.js +0 -2
  169. package/lib/test-import-export/testImportExport.js.map +0 -1
  170. package/lib/transaction/pane.js +0 -479
  171. package/lib/transaction/pane.js.map +0 -1
  172. package/lib/transaction/period.js +0 -325
  173. package/lib/transaction/period.js.map +0 -1
  174. package/lib/trip/tripPane.js +0 -176
  175. package/lib/trip/tripPane.js.map +0 -1
  176. package/lib/trustedApplications/trustedApplications.dom.js +0 -177
  177. package/lib/trustedApplications/trustedApplications.dom.js.map +0 -1
  178. package/lib/trustedApplications/trustedApplications.test.d.ts +0 -2
  179. package/lib/trustedApplications/trustedApplications.test.d.ts.map +0 -1
  180. package/lib/trustedApplications/trustedApplications.test.js +0 -64
  181. package/lib/trustedApplications/trustedApplications.test.js.map +0 -1
  182. package/lib/trustedApplications/trustedApplications.utils.js +0 -34
  183. package/lib/trustedApplications/trustedApplications.utils.js.map +0 -1
  184. package/lib/trustedApplications/trustedApplications.view.js +0 -87
  185. package/lib/trustedApplications/trustedApplications.view.js.map +0 -1
  186. package/lib/types.js +0 -6
  187. package/lib/types.js.map +0 -1
  188. package/lib/ui/pane.js +0 -148
  189. package/lib/ui/pane.js.map +0 -1
  190. package/lib/versionInfo.d.ts +0 -34
  191. package/lib/versionInfo.d.ts.map +0 -1
  192. package/lib/versionInfo.js +0 -39
  193. package/lib/versionInfo.js.map +0 -1
  194. package/lib/video/videoPane.js +0 -44
  195. package/lib/video/videoPane.js.map +0 -1
  196. package/src/RDFXMLPane.js +0 -60
  197. package/src/argument/argumentPane.js +0 -65
  198. package/src/argument/argument_icon_v04.jpg +0 -0
  199. package/src/argument/icon_argument.png +0 -0
  200. package/src/argument/transparentyingyang.png +0 -0
  201. package/src/attach/attachPane.js +0 -508
  202. package/src/attach/tbl-paperclip-128.png +0 -0
  203. package/src/attach/tbl-paperclip-22.png +0 -0
  204. package/src/attach/tbl-paperclip-22a.png +0 -0
  205. package/src/audio/audioPane.js +0 -197
  206. package/src/chatPreferencesForm.ttl +0 -12
  207. package/src/classInstancePane.js +0 -110
  208. package/src/dashboard/basicPreferences.ts +0 -201
  209. package/src/dashboard/dashboardPane.ts +0 -83
  210. package/src/dashboard/homepage.ts +0 -72
  211. package/src/dashboard/languages/codes.html +0 -8611
  212. package/src/dashboard/languages/codes.xml +0 -3563
  213. package/src/dashboard/languages/codes2.txt +0 -170
  214. package/src/dashboard/languages/foo +0 -70
  215. package/src/dashboard/languages/foo.ttl +0 -0
  216. package/src/dashboard/languages/get-language-names.sh +0 -12
  217. package/src/dashboard/ontologyData.ttl +0 -35
  218. package/src/dashboard/preferencesFormText.ttl +0 -18
  219. package/src/dataContentPane.js +0 -290
  220. package/src/defaultPane.js +0 -102
  221. package/src/dokieli/Makefile +0 -6
  222. package/src/dokieli/dokieliPane.js +0 -190
  223. package/src/dokieli/new.html +0 -30
  224. package/src/dokieli/new.js +0 -22
  225. package/src/form/form-22.png +0 -0
  226. package/src/form/form-b-22.png +0 -0
  227. package/src/form/form.graffle +0 -0
  228. package/src/form/form.png +0 -0
  229. package/src/form/pane.js +0 -217
  230. package/src/form/psuedocode-notes.txt +0 -57
  231. package/src/global.d.ts +0 -4
  232. package/src/home/homePane.ts +0 -72
  233. package/src/humanReadablePane.js +0 -150
  234. package/src/imagePane.js +0 -75
  235. package/src/index.ts +0 -71
  236. package/src/internal/internalPane.ts +0 -263
  237. package/src/mainPage/footer.ts +0 -19
  238. package/src/mainPage/header.ts +0 -79
  239. package/src/mainPage/index.ts +0 -20
  240. package/src/meeting/Makefile +0 -3
  241. package/src/meeting/test/meeting1/Actions/actions.ttl +0 -14
  242. package/src/meeting/test/meeting1/Actions/config.ttl +0 -16
  243. package/src/meeting/test/meeting1/Actions/state.ttl +0 -30
  244. package/src/meeting/test/meeting1/Schedule/details.ttl +0 -34
  245. package/src/meeting/test/meeting1/Schedule/details.ttl.acl +0 -20
  246. package/src/meeting/test/meeting1/Schedule/forms.ttl +0 -75
  247. package/src/meeting/test/meeting1/Schedule/forms.ttl.acl +0 -20
  248. package/src/meeting/test/meeting1/Schedule/index.html +0 -72
  249. package/src/meeting/test/meeting1/Schedule/index.html.acl +0 -20
  250. package/src/meeting/test/meeting1/Schedule/results.ttl +0 -15
  251. package/src/meeting/test/meeting1/Schedule/results.ttl.acl +0 -20
  252. package/src/meeting/test/meeting1/SharedNotes/pad.ttl +0 -23
  253. package/src/meeting/test/meeting1/chat/chat.ttl +0 -1
  254. package/src/meeting/test/meeting1/details.ttl +0 -35
  255. package/src/meeting/test/meeting1/pad/pad.ttl +0 -16
  256. package/src/microblogPane/mbStyle.css +0 -267
  257. package/src/microblogPane/microblogPane.js +0 -1412
  258. package/src/n3Pane.js +0 -56
  259. package/src/outline/context.ts +0 -21
  260. package/src/outline/manager.js +0 -2384
  261. package/src/outline/manager.test.ts +0 -189
  262. package/src/outline/outlineIcons.js +0 -160
  263. package/src/outline/propertyViews.test.ts +0 -36
  264. package/src/outline/propertyViews.ts +0 -37
  265. package/src/outline/queryByExample.js +0 -296
  266. package/src/outline/userInput.js +0 -2373
  267. package/src/outline/viewAsImage.ts +0 -12
  268. package/src/outline/viewAsMbox.ts +0 -14
  269. package/src/pad/images/ColourOff.ai +2 -872
  270. package/src/pad/images/ColourOff.png +0 -0
  271. package/src/pad/images/ColourOn.ai +1 -935
  272. package/src/pad/images/ColourOn.png +0 -0
  273. package/src/pad/padPane.ts +0 -559
  274. package/src/playlist/playlistPane.js +0 -161
  275. package/src/registerPanes.js +0 -147
  276. package/src/schedule/Makefile +0 -6
  277. package/src/schedule/formsForSchedule.js +0 -117
  278. package/src/schedule/formsForSchedule.ttl +0 -115
  279. package/src/schedule/schedulePane.js +0 -1201
  280. package/src/sharing/sharingPane.ts +0 -49
  281. package/src/slideshow/slideshowPane.js +0 -80
  282. package/src/socialPane.js +0 -523
  283. package/src/style/tabbedtab.css +0 -1347
  284. package/src/tabbed/tabbedPane.ts +0 -60
  285. package/src/tableViewPane.js +0 -51
  286. package/src/test-import-export/common.js +0 -6
  287. package/src/test-import-export/edit-importer.js +0 -20
  288. package/src/test-import-export/testImportExport.js +0 -0
  289. package/src/transaction/068010-3d-transparent-glass-icon-alphanumeric-dollar-sign.png +0 -0
  290. package/src/transaction/075988-3d-transparent-glass-icon-business-currency-british-pound-sc35.png +0 -0
  291. package/src/transaction/22-pixel-068010-3d-transparent-glass-icon-alphanumeric-dollar-sign.png +0 -0
  292. package/src/transaction/pane.js +0 -629
  293. package/src/transaction/period.js +0 -374
  294. package/src/transaction/thumbs_075987-3d-transparent-glass-icon-business-creditcard2.png +0 -0
  295. package/src/transaction/thumbs_075989-3d-transparent-glass-icon-business-currency-cent-sc35.png +0 -0
  296. package/src/trip/tripPane.js +0 -176
  297. package/src/trustedApplications/__snapshots__/trustedApplications.test.ts.snap +0 -176
  298. package/src/trustedApplications/trustedApplications.dom.ts +0 -276
  299. package/src/trustedApplications/trustedApplications.test.ts +0 -82
  300. package/src/trustedApplications/trustedApplications.utils.ts +0 -51
  301. package/src/trustedApplications/trustedApplications.view.ts +0 -80
  302. package/src/types.ts +0 -34
  303. package/src/ui/22-builder.png +0 -0
  304. package/src/ui/builder.graffle +0 -0
  305. package/src/ui/builder.png +0 -0
  306. package/src/ui/builder2.png +0 -0
  307. package/src/ui/pane.js +0 -226
  308. package/src/versionInfo.ts +0 -32
  309. package/src/video/videoPane.js +0 -44
  310. package/timestamp.sh +0 -13
  311. package/travis/bumpversion.js +0 -29
  312. package/tsconfig.json +0 -78
  313. package/typings/raw-loader.d.ts +0 -4
  314. package/typings/solid-namespace/index.d.ts +0 -9
  315. package/webpack.config.js +0 -41
  316. /package/{lib → dist}/dashboard/basicPreferences.d.ts +0 -0
  317. /package/{lib → dist}/dashboard/basicPreferences.d.ts.map +0 -0
  318. /package/{lib → dist}/dashboard/dashboardPane.d.ts +0 -0
  319. /package/{lib → dist}/dashboard/dashboardPane.d.ts.map +0 -0
  320. /package/{lib → dist}/dashboard/homepage.d.ts +0 -0
  321. /package/{lib → dist}/dashboard/homepage.d.ts.map +0 -0
  322. /package/{lib → dist}/home/homePane.d.ts +0 -0
  323. /package/{lib → dist}/home/homePane.d.ts.map +0 -0
  324. /package/{lib → dist}/index.d.ts +0 -0
  325. /package/{lib → dist}/index.d.ts.map +0 -0
  326. /package/{lib → dist}/internal/internalPane.d.ts +0 -0
  327. /package/{lib → dist}/internal/internalPane.d.ts.map +0 -0
  328. /package/{lib → dist}/mainPage/footer.d.ts +0 -0
  329. /package/{lib → dist}/mainPage/footer.d.ts.map +0 -0
  330. /package/{lib → dist}/mainPage/header.d.ts +0 -0
  331. /package/{lib → dist}/mainPage/header.d.ts.map +0 -0
  332. /package/{lib → dist}/mainPage/index.d.ts +0 -0
  333. /package/{lib → dist}/outline/context.d.ts +0 -0
  334. /package/{lib → dist}/outline/context.d.ts.map +0 -0
  335. /package/{lib → dist}/outline/propertyViews.d.ts +0 -0
  336. /package/{lib → dist}/outline/propertyViews.d.ts.map +0 -0
  337. /package/{lib → dist}/outline/viewAsImage.d.ts +0 -0
  338. /package/{lib → dist}/outline/viewAsImage.d.ts.map +0 -0
  339. /package/{lib → dist}/outline/viewAsMbox.d.ts +0 -0
  340. /package/{lib → dist}/outline/viewAsMbox.d.ts.map +0 -0
  341. /package/{lib → dist}/pad/padPane.d.ts +0 -0
  342. /package/{lib → dist}/pad/padPane.d.ts.map +0 -0
  343. /package/{lib → dist}/sharing/sharingPane.d.ts +0 -0
  344. /package/{lib → dist}/sharing/sharingPane.d.ts.map +0 -0
  345. /package/{lib → dist}/tabbed/tabbedPane.d.ts +0 -0
  346. /package/{lib → dist}/tabbed/tabbedPane.d.ts.map +0 -0
  347. /package/{lib → dist}/trustedApplications/trustedApplications.dom.d.ts +0 -0
  348. /package/{lib → dist}/trustedApplications/trustedApplications.dom.d.ts.map +0 -0
  349. /package/{lib → dist}/trustedApplications/trustedApplications.utils.d.ts +0 -0
  350. /package/{lib → dist}/trustedApplications/trustedApplications.utils.d.ts.map +0 -0
  351. /package/{lib → dist}/trustedApplications/trustedApplications.view.d.ts +0 -0
  352. /package/{lib → dist}/trustedApplications/trustedApplications.view.d.ts.map +0 -0
  353. /package/{lib → dist}/types.d.ts +0 -0
  354. /package/{lib → dist}/types.d.ts.map +0 -0
@@ -1,49 +0,0 @@
1
- /* Sharing Pane
2
- **
3
- ** This outline pane allows a user to view and adjust the sharing -- access control lists
4
- ** for anything which has that capability.
5
- **
6
- ** I am using in places single quotes strings like 'this'
7
- ** where internationalization ("i18n") is not a problem, and double quoted
8
- ** like "this" where the string is seen by the user and so I18n is an issue.
9
- */
10
-
11
- import { aclControl, icons, ns } from 'solid-ui'
12
-
13
- const sharingPane = {
14
- icon: icons.iconBase + 'padlock-timbl.svg',
15
-
16
- name: 'sharing',
17
-
18
- label: (subject, context) => {
19
- const store = context.session.store
20
- const t = store.findTypeURIs(subject)
21
- if (t[ns.ldp('Resource').uri]) return 'Sharing' // @@ be more sophisticated?
22
- if (t[ns.ldp('Container').uri]) return 'Sharing' // @@ be more sophisticated?
23
- if (t[ns.ldp('BasicContainer').uri]) return 'Sharing' // @@ be more sophisticated?
24
- // check being allowed to see/change sharing?
25
- return null // No under other circumstances
26
- },
27
-
28
- render: (subject, context) => {
29
- const dom = context.dom
30
- const store = context.session.store
31
- const noun = getNoun()
32
-
33
- const div = dom.createElement('div')
34
- div.classList.add('sharingPane')
35
- aclControl.preventBrowserDropEvents(dom)
36
- div.appendChild(aclControl.ACLControlBox5(subject, context, noun, store))
37
- return div
38
-
39
- function getNoun () {
40
- const t = store.findTypeURIs(subject)
41
- if (t[ns.ldp('BasicContainer').uri] || t[ns.ldp('Container').uri]) {
42
- return 'folder'
43
- }
44
- return 'file'
45
- }
46
- }
47
- }
48
-
49
- export default sharingPane
@@ -1,80 +0,0 @@
1
- /* slideshow Pane
2
- **
3
- */
4
- import * as UI from 'solid-ui'
5
- const ns = UI.ns
6
-
7
- import makeBSS from '@solid/better-simple-slideshow'
8
-
9
- export const slideshowPane = {
10
- icon: UI.icons.iconBase + 'noun_138712.svg',
11
-
12
- name: 'slideshow',
13
-
14
- audience: [ns.solid('PowerUser')],
15
-
16
- // Does the subject deserve an slideshow pane?
17
- label: function (subject, context) {
18
- const store = context.session.store
19
- const ns = UI.ns
20
- const t = store.findTypeURIs(subject)
21
- if (t[ns.ldp('Container').uri] || t[ns.ldp('BasicContainer').uri]) {
22
- const contents = store.each(subject, ns.ldp('contains'))
23
- let count = 0
24
- contents.forEach(function (file) {
25
- if (UI.widgets.isImage(file)) count++
26
- })
27
- return count > 0 ? 'Slideshow' : null
28
- }
29
- return null
30
- },
31
-
32
- // See https://github.com/leemark/better-simple-slideshow
33
- // and follow instructions there
34
- render: function (subject, context) {
35
- const dom = context.dom
36
- const styleSheet =
37
- 'https://leemark.github.io/better-simple-slideshow/css/simple-slideshow-styles.css'
38
- UI.widgets.addStyleSheet(dom, styleSheet)
39
-
40
- const store = context.session.store
41
- const ns = UI.ns
42
- const div = dom.createElement('div')
43
- div.setAttribute('class', 'bss-slides')
44
-
45
- const t = store.findTypeURIs(subject)
46
- let predicate
47
- if (t[ns.ldp('BasicContainer').uri] || t[ns.ldp('Container').uri]) {
48
- predicate = ns.ldp('contains')
49
- }
50
- const images = store.each(subject, predicate) // @@ random order?
51
- // @@ Ideally: sort by embedded time of image
52
- images.sort() // Sort for now by URI
53
- for (let i = 0; i < images.length; i++) {
54
- if (!UI.widgets.isImage(images[i])) continue
55
- const figure = div.appendChild(dom.createElement('figure'))
56
- const img = figure.appendChild(dom.createElement('img'))
57
-
58
- // get image with authenticated fetch
59
- store.fetcher._fetch(images[i].uri)
60
- .then(function(response) {
61
- return response.blob()
62
- })
63
- .then(function(myBlob) {
64
- const objectURL = URL.createObjectURL(myBlob)
65
- img.setAttribute('src', objectURL) // w640 h480 //
66
- })
67
- img.setAttribute('width', '100%')
68
- figure.appendChild(dom.createElement('figcaption'))
69
- }
70
- const options = { dom: dom }
71
-
72
- setTimeout(function () {
73
- makeBSS('.bss-slides', options)
74
- }, 1000) // Must run after the code which called this
75
-
76
- return div
77
- }
78
- }
79
-
80
- // ends
package/src/socialPane.js DELETED
@@ -1,523 +0,0 @@
1
- /* Social Pane
2
- **
3
- ** This outline pane provides social network functions
4
- ** Using for example the FOAF ontology.
5
- ** Goal: A *distributed* version of facebook, advogato, etc etc
6
- ** - Similarly easy user interface, but data storage distributed
7
- ** - Read and write both user-private (address book) and public data clearly
8
- ** -- todo: use common code to get username and load profile and set 'me'
9
- */
10
-
11
- import * as UI from 'solid-ui'
12
- import { authn } from 'solid-logic'
13
-
14
- export const socialPane = {
15
- icon: UI.icons.originalIconBase + 'foaf/foafTiny.gif',
16
-
17
- name: 'social',
18
-
19
- label: function (subject, context) {
20
- const kb = context.session.store
21
- const types = kb.findTypeURIs(subject)
22
- if (
23
- types[UI.ns.foaf('Person').uri] ||
24
- types[UI.ns.vcard('Individual').uri]
25
- ) {
26
- return 'Friends'
27
- }
28
- return null
29
- },
30
-
31
- render: function (s, context) {
32
- const dom = context.dom
33
- const common = function (x, y) {
34
- // Find common members of two lists
35
- const both = []
36
- for (let i = 0; i < x.length; i++) {
37
- for (let j = 0; j < y.length; j++) {
38
- if (y[j].sameTerm(x[i])) {
39
- both.push(y[j])
40
- break
41
- }
42
- }
43
- }
44
- return both
45
- }
46
-
47
- const people = function (n) {
48
- let res = ' '
49
- res += n || 'no'
50
- if (n === 1) return res + ' person'
51
- return res + ' people'
52
- }
53
- const say = function (str) {
54
- console.log(str)
55
- const p = dom.createElement('p')
56
- p.textContent = str
57
- tips.appendChild(p)
58
- }
59
-
60
- const link = function (contents, uri) {
61
- if (!uri) return contents
62
- const a = dom.createElement('a')
63
- a.setAttribute('href', uri)
64
- a.appendChild(contents)
65
- return a
66
- }
67
-
68
- const text = function (str) {
69
- return dom.createTextNode(str)
70
- }
71
-
72
- const buildCheckboxForm = function (lab, statement, state) {
73
- const f = dom.createElement('form')
74
- const input = dom.createElement('input')
75
- f.appendChild(input)
76
- const tx = dom.createTextNode(lab)
77
- tx.className = 'question'
78
- f.appendChild(tx)
79
- input.setAttribute('type', 'checkbox')
80
- const boxHandler = function (_e) {
81
- tx.className = 'pendingedit'
82
- // alert('Should be greyed out')
83
- if (this.checked) {
84
- // Add link
85
- try {
86
- outliner.UserInput.sparqler.insert_statement(statement, function (
87
- uri,
88
- success,
89
- errorBody
90
- ) {
91
- tx.className = 'question'
92
- if (!success) {
93
- UI.log.alert(
94
- null,
95
- 'Message',
96
- 'Error occurs while inserting ' +
97
- statement +
98
- '\n\n' +
99
- errorBody
100
- )
101
- input.checked = false // rollback UI
102
- return
103
- }
104
- kb.add(
105
- statement.subject,
106
- statement.predicate,
107
- statement.object,
108
- statement.why
109
- )
110
- })
111
- } catch (e) {
112
- UI.log.error('Data write fails:' + e)
113
- UI.log.alert('Data write fails:' + e)
114
- input.checked = false // rollback UI
115
- tx.className = 'question'
116
- }
117
- } else {
118
- // Remove link
119
- try {
120
- outliner.UserInput.sparqler.delete_statement(statement, function (
121
- uri,
122
- success,
123
- errorBody
124
- ) {
125
- tx.className = 'question'
126
- if (!success) {
127
- UI.log.alert(
128
- 'Error occurs while deleting ' +
129
- statement +
130
- '\n\n' +
131
- errorBody
132
- )
133
- this.checked = true // Rollback UI
134
- } else {
135
- kb.removeMany(
136
- statement.subject,
137
- statement.predicate,
138
- statement.object,
139
- statement.why
140
- )
141
- }
142
- })
143
- } catch (e) {
144
- UI.log.alert('Delete fails:' + e)
145
- this.checked = true // Rollback UI
146
- // return
147
- }
148
- }
149
- }
150
- input.checked = state
151
- input.addEventListener('click', boxHandler, false)
152
- return f
153
- }
154
-
155
- const oneFriend = function (friend, _confirmed) {
156
- return UI.widgets.personTR(dom, UI.ns.foaf('knows'), friend, {})
157
- }
158
-
159
- // ////////// Body of render():
160
-
161
- const outliner = context.getOutliner(dom)
162
- const kb = context.session.store
163
- const div = dom.createElement('div')
164
- div.setAttribute('class', 'socialPane')
165
- const foaf = UI.ns.foaf
166
- const vcard = UI.ns.vcard
167
-
168
- // extracted from tabbedtab.css 2017-03-21
169
- const navBlockStyle =
170
- 'background-color: #eee; width: 25%; border: 0; padding: 0.5em; margin: 0;'
171
- const mainBlockStyle =
172
- 'background-color: #fff; color: #000; width: 46%; margin: 0; border-left: 1px solid #ccc; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; padding: 0;'
173
- const foafPicStyle = ' width: 100% ; border: none; margin: 0; padding: 0;'
174
-
175
- const structure = div.appendChild(dom.createElement('table'))
176
- const tr = structure.appendChild(dom.createElement('tr'))
177
- const left = tr.appendChild(dom.createElement('td'))
178
- const middle = tr.appendChild(dom.createElement('td'))
179
- const right = tr.appendChild(dom.createElement('td'))
180
-
181
- const tools = left
182
- tools.style.cssText = navBlockStyle
183
- const mainTable = middle.appendChild(dom.createElement('table'))
184
- mainTable.style.cssText = mainBlockStyle
185
- const tips = right
186
- tips.style.cssText = navBlockStyle
187
-
188
- // Image top left
189
- const src = kb.any(s, foaf('img')) || kb.any(s, foaf('depiction'))
190
- if (src) {
191
- const img = dom.createElement('IMG')
192
- img.setAttribute('src', src.uri) // w640 h480
193
- // img.className = 'foafPic'
194
- img.style.cssText = foafPicStyle
195
- tools.appendChild(img)
196
- }
197
- const name = kb.anyValue(s, foaf('name')) || '???'
198
- let h3 = dom.createElement('H3')
199
- h3.appendChild(dom.createTextNode(name))
200
-
201
- let me = authn.currentUser()
202
- const meUri = me ? me.uri : null
203
-
204
- // @@ Add: event handler to redraw the stuff below when me changes.
205
- const loginOutButton = UI.login.loginStatusBox(dom, webIdUri => {
206
- me = kb.sym(webIdUri)
207
- // @@ To be written: redraw as a function the new me
208
- // @@ refresh the sidebars
209
- UI.widgets.refreshTree(div) // this refreshes the middle at least
210
- })
211
-
212
- tips.appendChild(loginOutButton)
213
-
214
- const thisIsYou = me && kb.sameThings(me, s)
215
-
216
- const knows = foaf('knows')
217
- // var givenName = kb.sym('http://www.w3.org/2000/10/swap/pim/contact#givenName')
218
- const familiar =
219
- kb.anyValue(s, foaf('givenname')) ||
220
- kb.anyValue(s, foaf('firstName')) ||
221
- kb.anyValue(s, foaf('nick')) ||
222
- kb.anyValue(s, foaf('name')) ||
223
- kb.anyValue(s, vcard('fn'))
224
- const friends = kb.each(s, knows)
225
-
226
- // Do I have a public profile document?
227
- let profile = null // This could be SPARQL { ?me foaf:primaryTopic [ a foaf:PersonalProfileDocument ] }
228
- let editable = false
229
- let incoming
230
- let outgoing
231
- if (me) {
232
- // The definition of FAF personal profile document is ..
233
- const works = kb.each(undefined, foaf('primaryTopic'), me) // having me as primary topic
234
- let message = ''
235
- for (let i = 0; i < works.length; i++) {
236
- if (
237
- kb.whether(
238
- works[i],
239
- UI.ns.rdf('type'),
240
- foaf('PersonalProfileDocument')
241
- )
242
- ) {
243
- editable = outliner.UserInput.sparqler.editable(works[i].uri, kb)
244
- if (!editable) {
245
- message +=
246
- 'Your profile <' +
247
- UI.utils.escapeForXML(works[i].uri) +
248
- '> is not remotely editable.'
249
- } else {
250
- profile = works[i]
251
- break
252
- }
253
- }
254
- }
255
-
256
- if (!profile) {
257
- say(
258
- message + "\nI couldn't find your editable personal profile document."
259
- )
260
- } else {
261
- say('Editing your profile ' + profile + '.')
262
- // Do I have an EDITABLE profile?
263
- editable = outliner.UserInput.sparqler.editable(profile.uri, kb)
264
- }
265
-
266
- if (thisIsYou) {
267
- // This is about me
268
- // pass... @@
269
- } else {
270
- // This is about someone else
271
- // My relationship with this person
272
-
273
- h3 = dom.createElement('h3')
274
- h3.appendChild(dom.createTextNode('You and ' + familiar))
275
- tools.appendChild(h3)
276
-
277
- const cme = kb.canon(me)
278
- incoming = kb.whether(s, knows, cme)
279
- outgoing = false
280
- const outgoingSt = kb.statementsMatching(cme, knows, s)
281
- if (outgoingSt.length) {
282
- outgoing = true
283
- if (!profile) profile = outgoingSt[0].why
284
- }
285
-
286
- const tr = dom.createElement('tr')
287
- tools.appendChild(tr)
288
-
289
- const youAndThem = function () {
290
- tr.appendChild(link(text('You'), meUri))
291
- tr.appendChild(text(' and '))
292
- tr.appendChild(link(text(familiar), s.uri))
293
- }
294
-
295
- if (!incoming) {
296
- if (!outgoing) {
297
- youAndThem()
298
- tr.appendChild(text(' have not said you know each other.'))
299
- } else {
300
- tr.appendChild(link(text('You'), meUri))
301
- tr.appendChild(text(' know '))
302
- tr.appendChild(link(text(familiar), s.uri))
303
- tr.appendChild(text(' (unconfirmed)'))
304
- }
305
- } else {
306
- if (!outgoing) {
307
- tr.appendChild(link(text(familiar), s.uri))
308
- tr.appendChild(text(' knows '))
309
- tr.appendChild(link(text('you'), meUri))
310
- tr.appendChild(text(' (unconfirmed).')) // @@
311
- tr.appendChild(text(' confirm you know '))
312
- tr.appendChild(link(text(familiar), s.uri))
313
- tr.appendChild(text('.'))
314
- } else {
315
- youAndThem()
316
- tr.appendChild(text(' say you know each other.'))
317
- }
318
- }
319
-
320
- if (editable) {
321
- const f = buildCheckboxForm(
322
- 'You know ' + familiar,
323
- new UI.rdf.Statement(me, knows, s, profile),
324
- outgoing
325
- )
326
- tools.appendChild(f)
327
- } // editable
328
-
329
- // //////////////// Mutual friends
330
- if (friends) {
331
- const myFriends = kb.each(me, foaf('knows'))
332
- if (myFriends.length) {
333
- const mutualFriends = common(friends, myFriends)
334
- const tr = dom.createElement('tr')
335
- tools.appendChild(tr)
336
- tr.appendChild(
337
- dom.createTextNode(
338
- 'You' +
339
- (familiar ? ' and ' + familiar : '') +
340
- ' know' +
341
- people(mutualFriends.length) +
342
- ' found in common'
343
- )
344
- )
345
- if (mutualFriends) {
346
- for (let i = 0; i < mutualFriends.length; i++) {
347
- tr.appendChild(
348
- dom.createTextNode(', ' + UI.utils.label(mutualFriends[i]))
349
- )
350
- }
351
- }
352
- }
353
- const tr = dom.createElement('tr')
354
- tools.appendChild(tr)
355
- } // friends
356
- } // About someone else
357
- } // me is defined
358
- // End of you and s
359
-
360
- // div.appendChild(dom.createTextNode(plural(friends.length, 'acquaintance') +'. '))
361
-
362
- // ///////////////////////////////////////////// Main block
363
- //
364
- // Should: Find the intersection and difference sets
365
-
366
- // List all x such that s knows x.
367
- UI.widgets.attachmentList(dom, s, mainTable, {
368
- doc: profile,
369
- modify: !!editable,
370
- predicate: foaf('knows'),
371
- noun: 'friend'
372
- })
373
-
374
- // Figure out which are reciprocated:
375
- // @@ Does not look up profiles
376
- // Does distinguish reciprocated from unreciprocated friendships
377
- //
378
- function _triageFriends (s) {
379
- outgoing = kb.each(s, foaf('knows'))
380
- incoming = kb.each(undefined, foaf('knows'), s) // @@ have to load the friends
381
- const confirmed = []
382
- const unconfirmed = []
383
- const requests = []
384
-
385
- for (let i = 0; i < outgoing.length; i++) {
386
- const friend = outgoing[i]
387
- let found = false
388
- for (let j = 0; j < incoming.length; j++) {
389
- if (incoming[j].sameTerm(friend)) {
390
- found = true
391
- break
392
- }
393
- }
394
- if (found) confirmed.push(friend)
395
- else unconfirmed.push(friend)
396
- } // outgoing
397
-
398
- for (let i = 0; i < incoming.length; i++) {
399
- const friend = incoming[i]
400
- // var lab = UI.utils.label(friend)
401
- let found = false
402
- for (let j = 0; j < outgoing.length; j++) {
403
- if (outgoing[j].sameTerm(friend)) {
404
- found = true
405
- break
406
- }
407
- }
408
- if (!found) requests.push(friend)
409
- } // incoming
410
-
411
- const cases = [
412
- ['Acquaintances', outgoing],
413
- ['Mentioned as acquaintances by: ', requests]
414
- ]
415
- for (let i = 0; i < cases.length; i++) {
416
- const thisCase = cases[i]
417
- const friends = thisCase[1]
418
- if (friends.length === 0) continue // Skip empty sections (sure?)
419
-
420
- const h3 = dom.createElement('h3')
421
- h3.textContent = thisCase[0]
422
- const htr = dom.createElement('tr')
423
- htr.appendChild(h3)
424
- mainTable.appendChild(htr)
425
-
426
- const items = []
427
- for (let j9 = 0; j9 < friends.length; j9++) {
428
- items.push([UI.utils.label(friends[j9]), friends[j9]])
429
- }
430
- items.sort()
431
- let last = null
432
- let fr
433
- for (let j7 = 0; j7 < items.length; j7++) {
434
- fr = items[j7][1]
435
- if (fr.sameTerm(last)) continue // unique
436
- last = fr
437
- if (UI.utils.label(fr) !== '...') {
438
- // This check is to avoid bnodes with no labels attached
439
- // appearing in the friends list with "..." - Oshani
440
- mainTable.appendChild(oneFriend(fr))
441
- }
442
- }
443
- }
444
- }
445
- /* if ($rdf.keepThisCodeForLaterButDisableFerossConstantConditionPolice) {
446
- triageFriends(s)
447
- } */
448
- // //////////////////////////////////// Basic info on left
449
-
450
- h3 = dom.createElement('h3')
451
- h3.appendChild(dom.createTextNode('Basic Information'))
452
- tools.appendChild(h3)
453
-
454
- // For each home page like thing make a label which will
455
- // make sense and add the domain (like "w3.org blog") if there are more than one of the same type
456
- //
457
- const preds = [
458
- UI.ns.foaf('homepage'),
459
- UI.ns.foaf('weblog'),
460
- UI.ns.foaf('workplaceHomepage'),
461
- UI.ns.foaf('schoolHomepage')
462
- ]
463
- for (let i6 = 0; i6 < preds.length; i6++) {
464
- const pred = preds[i6]
465
- const sts = kb.statementsMatching(s, pred)
466
- if (sts.length === 0) {
467
- // if (editable) say("No home page set. Use the blue + icon at the bottom of the main view to add information.")
468
- } else {
469
- const uris = []
470
- for (let j5 = 0; j5 < sts.length; j5++) {
471
- const st = sts[j5]
472
- if (st.object.uri) uris.push(st.object.uri) // Ignore if not symbol
473
- }
474
- uris.sort()
475
- let last2 = ''
476
- let lab2
477
- for (let k = 0; k < uris.length; k++) {
478
- const uri = uris[k]
479
- if (uri === last2) continue // uniques only
480
- last2 = uri
481
- let hostlabel = ''
482
- lab2 = UI.utils.label(pred)
483
- if (uris.length > 1) {
484
- const l = uri.indexOf('//')
485
- if (l > 0) {
486
- let r = uri.indexOf('/', l + 2)
487
- const r2 = uri.lastIndexOf('.', r)
488
- if (r2 > 0) r = r2
489
- hostlabel = uri.slice(l + 2, r)
490
- }
491
- }
492
- if (hostlabel) lab2 = hostlabel + ' ' + lab2 // disambiguate
493
- const t = dom.createTextNode(lab2)
494
- const a = dom.createElement('a')
495
- a.appendChild(t)
496
- a.setAttribute('href', uri)
497
- const d = dom.createElement('div')
498
- // d.className = 'social_linkButton'
499
- d.style.cssText =
500
- 'width: 80%; background-color: #fff; border: solid 0.05em #ccc; margin-top: 0.1em; margin-bottom: 0.1em; padding: 0.1em; text-align: center;'
501
- d.appendChild(a)
502
- tools.appendChild(d)
503
- }
504
- }
505
- }
506
-
507
- const preds2 = [UI.ns.foaf('openid'), UI.ns.foaf('nick')]
508
- for (let i2 = 0; i2 < preds2.length; i2++) {
509
- const pred = preds2[i2]
510
- const sts2 = kb.statementsMatching(s, pred)
511
- if (sts2.length === 0) {
512
- // if (editable) say("No home page set. Use the blue + icon at the bottom of the main view to add information.")
513
- } else {
514
- outliner.appendPropertyTRs(tools, sts2, false, function (_pred) {
515
- return true
516
- })
517
- }
518
- }
519
-
520
- return div
521
- } // render()
522
- } //
523
- // ends