solid-panes 5.1.0-0 → 5.1.0-2

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 (284) hide show
  1. package/README.md +17 -0
  2. package/dist/RDFXMLPane2.esm.js +1 -2
  3. package/dist/_virtual/~icons/lucide/cake.esm.js +1 -2
  4. package/dist/_virtual/~icons/lucide/camera.esm.js +1 -2
  5. package/dist/_virtual/~icons/lucide/circle-user-round.esm.js +1 -2
  6. package/dist/_virtual/~icons/lucide/folder-open.esm.js +1 -2
  7. package/dist/_virtual/~icons/lucide/help-circle.esm.js +1 -2
  8. package/dist/_virtual/~icons/lucide/layout-dashboard.esm.js +1 -2
  9. package/dist/_virtual/~icons/lucide/mail.esm.js +1 -2
  10. package/dist/_virtual/~icons/lucide/map-pin.esm.js +1 -2
  11. package/dist/_virtual/~icons/lucide/pencil.esm.js +1 -2
  12. package/dist/_virtual/~icons/lucide/phone.esm.js +1 -2
  13. package/dist/_virtual/~icons/lucide/settings-2.esm.js +1 -2
  14. package/dist/_virtual/~icons/lucide/user-round-plus.esm.js +1 -2
  15. package/dist/_virtual/~icons/lucide/user.esm.js +1 -2
  16. package/dist/_virtual/~icons/lucide/users.esm.js +1 -2
  17. package/dist/_virtual/~icons/lucide/x.esm.js +1 -2
  18. package/dist/audio/audioPane.esm.js +1 -2
  19. package/dist/classInstancePane.esm.js +1 -2
  20. package/dist/components/editor-card/EditorCard.cjs.js +1 -1
  21. package/dist/components/editor-card/EditorCard.cjs.js.map +1 -1
  22. package/dist/components/editor-card/EditorCard.esm.js +6 -7
  23. package/dist/components/editor-card/EditorCard.styles.esm.js +1 -2
  24. package/dist/components/header/Header.cjs.js +1 -1
  25. package/dist/components/header/Header.cjs.js.map +1 -1
  26. package/dist/components/header/Header.esm.js +7 -8
  27. package/dist/components/header/Header.styles.esm.js +1 -2
  28. package/dist/components/navbar/Navbar.cjs.js +2 -2
  29. package/dist/components/navbar/Navbar.cjs.js.map +1 -1
  30. package/dist/components/navbar/Navbar.esm.js +8 -9
  31. package/dist/components/navbar/Navbar.styles.esm.js +1 -2
  32. package/dist/components/profile-heading/ProfileHeading.cjs.js +17 -17
  33. package/dist/components/profile-heading/ProfileHeading.cjs.js.map +1 -1
  34. package/dist/components/profile-heading/ProfileHeading.esm.js +28 -29
  35. package/dist/components/profile-heading/ProfileHeading.styles.esm.js +1 -2
  36. package/dist/components/profile-heading/editor/sections/heading/HeadingEditDialog.cjs.js +1 -1
  37. package/dist/components/profile-heading/editor/sections/heading/HeadingEditDialog.esm.js +2 -3
  38. package/dist/components/profile-heading/editor/sections/heading/dateHelpers.esm.js +1 -2
  39. package/dist/components/profile-heading/editor/sections/heading/imageHelpers.esm.js +1 -2
  40. package/dist/components/profile-heading/editor/sections/heading/imagePreview.esm.js +1 -2
  41. package/dist/components/profile-heading/editor/sections/heading/mutations.esm.js +1 -2
  42. package/dist/components/profile-heading/editor/sections/shared/contactTypeUtils.esm.js +1 -2
  43. package/dist/components/profile-heading/editor/sections/shared/idNodeFactory.esm.js +1 -2
  44. package/dist/components/profile-heading/editor/sections/shared/phoneCountries.esm.js +0 -1
  45. package/dist/components/profile-heading/editor/sections/shared/rdfMutationHelpers.esm.js +1 -2
  46. package/dist/components/profile-heading/editor/sections/shared/rowState.esm.js +1 -2
  47. package/dist/components/profile-heading/editor/sections/shared/sanitizeUtils.esm.js +1 -2
  48. package/dist/components/profile-heading/editor/textUtils.esm.js +1 -2
  49. package/dist/components/profile-heading/editor/texts/dialogTexts.esm.js +1 -2
  50. package/dist/components/profile-heading/editor/texts/messageTexts.esm.js +1 -2
  51. package/dist/components/profile-heading/editor/ui/dialog2.cjs.js +3 -3
  52. package/dist/components/profile-heading/editor/ui/dialog2.cjs.js.map +1 -1
  53. package/dist/components/profile-heading/editor/ui/dialog2.esm.js +4 -19
  54. package/dist/components/profile-heading/editor/ui/dialog2.esm.js.map +1 -1
  55. package/dist/components/profile-heading/editor/ui/spinner.esm.js +1 -2
  56. package/dist/components/profile-heading/editor/utils/errorDisplay.esm.js +1 -2
  57. package/dist/components/profile-heading/friendActions.esm.js +1 -2
  58. package/dist/components/profile-heading/profileHeadingData.esm.js +1 -2
  59. package/dist/dashboard/basicPreferences.esm.js +1 -2
  60. package/dist/dashboard/dashboardPane.esm.js +0 -1
  61. package/dist/dashboard/homepage.esm.js +1 -2
  62. package/dist/dashboard/ontologyData.esm.js +1 -2
  63. package/dist/dashboard/preferencesFormText.esm.js +1 -2
  64. package/dist/dataContentPane2.cjs.js +1 -1
  65. package/dist/dataContentPane2.esm.js +2 -3
  66. package/dist/defaultPane2.cjs.js +1 -1
  67. package/dist/defaultPane2.esm.js +2 -3
  68. package/dist/dokieli/dokieliPane.cjs.js +1 -1
  69. package/dist/dokieli/dokieliPane.cjs.js.map +1 -1
  70. package/dist/dokieli/dokieliPane.esm.js +7 -12
  71. package/dist/dokieli/dokieliPane.esm.js.map +1 -1
  72. package/dist/dokieli/new.esm.js +1 -2
  73. package/dist/form/pane.esm.js +1 -2
  74. package/dist/home/homePane.esm.js +1 -2
  75. package/dist/humanReadablePane.d.ts +3 -0
  76. package/dist/humanReadablePane.d.ts.map +1 -1
  77. package/dist/humanReadablePane2.cjs.js +276 -1
  78. package/dist/humanReadablePane2.cjs.js.map +1 -1
  79. package/dist/humanReadablePane2.esm.js +428 -31
  80. package/dist/humanReadablePane2.esm.js.map +1 -1
  81. package/dist/icons/folder.esm.js +1 -2
  82. package/dist/icons/friends.esm.js +1 -2
  83. package/dist/icons/person.esm.js +1 -2
  84. package/dist/imagePane.d.ts.map +1 -1
  85. package/dist/imagePane2.cjs.js +1 -1
  86. package/dist/imagePane2.cjs.js.map +1 -1
  87. package/dist/imagePane2.esm.js +2 -3
  88. package/dist/imagePane2.esm.js.map +1 -1
  89. package/dist/index.esm.js +1 -2
  90. package/dist/internal/internalPane2.cjs.js +1 -1
  91. package/dist/internal/internalPane2.esm.js +2 -3
  92. package/dist/mainPage/header.esm.js +1 -2
  93. package/dist/mainPage/index.cjs.js +1 -1
  94. package/dist/mainPage/index.cjs.js.map +1 -1
  95. package/dist/mainPage/index.d.ts +1 -1
  96. package/dist/mainPage/index.d.ts.map +1 -1
  97. package/dist/mainPage/index.esm.js +6 -2
  98. package/dist/mainPage/index.esm.js.map +1 -1
  99. package/dist/mainPage/navbar.esm.js +1 -2
  100. package/dist/mainPage/navigation.cjs.js +1 -1
  101. package/dist/mainPage/navigation.cjs.js.map +1 -1
  102. package/dist/mainPage/navigation.d.ts.map +1 -1
  103. package/dist/mainPage/navigation.esm.js +14 -11
  104. package/dist/mainPage/navigation.esm.js.map +1 -1
  105. package/dist/mainPage/profileHeading2.esm.js +1 -2
  106. package/dist/n3Pane2.esm.js +1 -2
  107. package/dist/navigation/browserEvents.esm.js +1 -2
  108. package/dist/navigation/chrome.esm.js +1 -2
  109. package/dist/navigation/controller.cjs.js +1 -1
  110. package/dist/navigation/controller.cjs.js.map +1 -1
  111. package/dist/navigation/controller.esm.js +6 -7
  112. package/dist/navigation/controller.esm.js.map +1 -1
  113. package/dist/navigation/events.esm.js +1 -2
  114. package/dist/navigation/navbarVisibility.esm.js +1 -2
  115. package/dist/navigation/options.esm.js +1 -2
  116. package/dist/navigation/podContext.esm.js +1 -2
  117. package/dist/navigation/state.esm.js +1 -2
  118. package/dist/outline/context.esm.js +1 -2
  119. package/dist/outline/fileExplorerHelpers.cjs.js +2 -0
  120. package/dist/outline/fileExplorerHelpers.cjs.js.map +1 -0
  121. package/dist/outline/fileExplorerHelpers.d.ts +13 -0
  122. package/dist/outline/fileExplorerHelpers.d.ts.map +1 -0
  123. package/dist/outline/fileExplorerHelpers.esm.js +24 -0
  124. package/dist/outline/fileExplorerHelpers.esm.js.map +1 -0
  125. package/dist/outline/manager2.cjs.js +1 -1
  126. package/dist/outline/manager2.cjs.js.map +1 -1
  127. package/dist/outline/manager2.esm.js +422 -433
  128. package/dist/outline/manager2.esm.js.map +1 -1
  129. package/dist/outline/outlineDomHelpers.cjs.js +2 -0
  130. package/dist/outline/outlineDomHelpers.cjs.js.map +1 -0
  131. package/dist/outline/outlineDomHelpers.d.ts +30 -0
  132. package/dist/outline/outlineDomHelpers.d.ts.map +1 -0
  133. package/dist/outline/outlineDomHelpers.esm.js +79 -0
  134. package/dist/outline/outlineDomHelpers.esm.js.map +1 -0
  135. package/dist/outline/outlineIcons.esm.js +1 -2
  136. package/dist/outline/propertyViews.esm.js +1 -2
  137. package/dist/outline/queryByExample.cjs.js.map +1 -1
  138. package/dist/outline/queryByExample.esm.js +1 -2
  139. package/dist/outline/queryByExample.esm.js.map +1 -1
  140. package/dist/outline/userInput.cjs.js +9 -9
  141. package/dist/outline/userInput.cjs.js.map +1 -1
  142. package/dist/outline/userInput.esm.js +50 -40
  143. package/dist/outline/userInput.esm.js.map +1 -1
  144. package/dist/outline/viewAsImage.esm.js +1 -2
  145. package/dist/outline/viewAsMbox.esm.js +1 -2
  146. package/dist/pad/padPane2.cjs.js +1 -1
  147. package/dist/pad/padPane2.esm.js +2 -3
  148. package/dist/playlist/playlistPane.esm.js +1 -2
  149. package/dist/registerPanes.esm.js +1 -2
  150. package/dist/schedule/formsForSchedule.esm.js +1 -2
  151. package/dist/schedule/schedulePane.d.ts.map +1 -1
  152. package/dist/schedule/schedulePane2.cjs.js +1 -1
  153. package/dist/schedule/schedulePane2.cjs.js.map +1 -1
  154. package/dist/schedule/schedulePane2.esm.js +60 -59
  155. package/dist/schedule/schedulePane2.esm.js.map +1 -1
  156. package/dist/sharing/sharingPane.esm.js +1 -2
  157. package/dist/slideshow/slideshowPane.esm.js +1 -2
  158. package/dist/social/editProfileDetails.cjs.js +1 -1
  159. package/dist/social/editProfileDetails.esm.js +1 -2
  160. package/dist/social/icons.esm.js +1 -2
  161. package/dist/social/socialPane2.cjs.js +1 -1
  162. package/dist/social/socialPane2.esm.js +2 -3
  163. package/dist/social/socialSections.cjs.js +1 -1
  164. package/dist/social/socialSections.cjs.js.map +1 -1
  165. package/dist/social/socialSections.d.ts +0 -1
  166. package/dist/social/socialSections.d.ts.map +1 -1
  167. package/dist/social/socialSections.esm.js +15 -18
  168. package/dist/social/socialSections.esm.js.map +1 -1
  169. package/dist/social/triage.esm.js +1 -2
  170. package/dist/tabbed/tabbedPane.esm.js +1 -2
  171. package/dist/tableViewPane.esm.js +1 -2
  172. package/dist/transaction/pane.esm.js +1 -2
  173. package/dist/transaction/period.esm.js +1 -2
  174. package/dist/trip/tripPane.esm.js +1 -2
  175. package/dist/trustedApplications/trustedApplications.dom.esm.js +1 -2
  176. package/dist/trustedApplications/trustedApplications.utils.esm.js +1 -2
  177. package/dist/trustedApplications/trustedApplications.view.esm.js +1 -2
  178. package/dist/ui/pane.esm.js +1 -2
  179. package/dist/utils/paneUtils.cjs.js +1 -1
  180. package/dist/utils/paneUtils.cjs.js.map +1 -1
  181. package/dist/utils/paneUtils.d.ts +5 -3
  182. package/dist/utils/paneUtils.d.ts.map +1 -1
  183. package/dist/utils/paneUtils.esm.js +36 -29
  184. package/dist/utils/paneUtils.esm.js.map +1 -1
  185. package/dist/utils/podUtils.cjs.js +1 -1
  186. package/dist/utils/podUtils.cjs.js.map +1 -1
  187. package/dist/utils/podUtils.d.ts +9 -1
  188. package/dist/utils/podUtils.d.ts.map +1 -1
  189. package/dist/utils/podUtils.esm.js +22 -95
  190. package/dist/utils/podUtils.esm.js.map +1 -1
  191. package/dist/utils/viewerUtils.esm.js +1 -2
  192. package/dist/utils/webIdUtils.esm.js +1 -2
  193. package/dist/versionInfo.cjs.js +1 -1
  194. package/dist/versionInfo.cjs.js.map +1 -1
  195. package/dist/versionInfo.esm.js +4 -5
  196. package/dist/versionInfo.esm.js.map +1 -1
  197. package/dist/video/videoPane.esm.js +1 -2
  198. package/package.json +7 -6
  199. package/dist/_virtual/~icons/lucide/arrow-left.cjs.js +0 -2
  200. package/dist/_virtual/~icons/lucide/arrow-left.cjs.js.map +0 -1
  201. package/dist/_virtual/~icons/lucide/arrow-left.esm.js +0 -11
  202. package/dist/_virtual/~icons/lucide/arrow-left.esm.js.map +0 -1
  203. package/dist/_virtual/~icons/lucide/ellipsis-vertical.cjs.js +0 -2
  204. package/dist/_virtual/~icons/lucide/ellipsis-vertical.cjs.js.map +0 -1
  205. package/dist/_virtual/~icons/lucide/ellipsis-vertical.esm.js +0 -11
  206. package/dist/_virtual/~icons/lucide/ellipsis-vertical.esm.js.map +0 -1
  207. package/dist/_virtual/~icons/lucide/folder.cjs.js +0 -2
  208. package/dist/_virtual/~icons/lucide/folder.cjs.js.map +0 -1
  209. package/dist/_virtual/~icons/lucide/folder.esm.js +0 -11
  210. package/dist/_virtual/~icons/lucide/folder.esm.js.map +0 -1
  211. package/dist/_virtual/~icons/lucide/globe.cjs.js +0 -2
  212. package/dist/_virtual/~icons/lucide/globe.cjs.js.map +0 -1
  213. package/dist/_virtual/~icons/lucide/globe.esm.js +0 -11
  214. package/dist/_virtual/~icons/lucide/globe.esm.js.map +0 -1
  215. package/dist/_virtual/~icons/lucide/lock-keyhole.cjs.js +0 -2
  216. package/dist/_virtual/~icons/lucide/lock-keyhole.cjs.js.map +0 -1
  217. package/dist/_virtual/~icons/lucide/lock-keyhole.esm.js +0 -11
  218. package/dist/_virtual/~icons/lucide/lock-keyhole.esm.js.map +0 -1
  219. package/dist/_virtual/~icons/lucide/share-2.cjs.js +0 -2
  220. package/dist/_virtual/~icons/lucide/share-2.cjs.js.map +0 -1
  221. package/dist/_virtual/~icons/lucide/share-2.esm.js +0 -11
  222. package/dist/_virtual/~icons/lucide/share-2.esm.js.map +0 -1
  223. package/dist/_virtual/~icons/lucide/user-round-cog.cjs.js +0 -2
  224. package/dist/_virtual/~icons/lucide/user-round-cog.cjs.js.map +0 -1
  225. package/dist/_virtual/~icons/lucide/user-round-cog.esm.js +0 -11
  226. package/dist/_virtual/~icons/lucide/user-round-cog.esm.js.map +0 -1
  227. package/dist/components/file-explorer-header/FileExplorerHeader.cjs.js +0 -14
  228. package/dist/components/file-explorer-header/FileExplorerHeader.cjs.js.map +0 -1
  229. package/dist/components/file-explorer-header/FileExplorerHeader.d.ts +0 -18
  230. package/dist/components/file-explorer-header/FileExplorerHeader.d.ts.map +0 -1
  231. package/dist/components/file-explorer-header/FileExplorerHeader.esm.js +0 -292
  232. package/dist/components/file-explorer-header/FileExplorerHeader.esm.js.map +0 -1
  233. package/dist/components/file-explorer-header/FileExplorerHeader.styles.cjs.js +0 -2
  234. package/dist/components/file-explorer-header/FileExplorerHeader.styles.cjs.js.map +0 -1
  235. package/dist/components/file-explorer-header/FileExplorerHeader.styles.esm.js +0 -7
  236. package/dist/components/file-explorer-header/FileExplorerHeader.styles.esm.js.map +0 -1
  237. package/dist/components/file-explorer-header/FileExplorerHeaderControls.cjs.js +0 -32
  238. package/dist/components/file-explorer-header/FileExplorerHeaderControls.cjs.js.map +0 -1
  239. package/dist/components/file-explorer-header/FileExplorerHeaderControls.d.ts +0 -21
  240. package/dist/components/file-explorer-header/FileExplorerHeaderControls.d.ts.map +0 -1
  241. package/dist/components/file-explorer-header/FileExplorerHeaderControls.esm.js +0 -294
  242. package/dist/components/file-explorer-header/FileExplorerHeaderControls.esm.js.map +0 -1
  243. package/dist/components/file-explorer-header/FileExplorerHeaderControls.styles.cjs.js +0 -2
  244. package/dist/components/file-explorer-header/FileExplorerHeaderControls.styles.cjs.js.map +0 -1
  245. package/dist/components/file-explorer-header/FileExplorerHeaderControls.styles.esm.js +0 -7
  246. package/dist/components/file-explorer-header/FileExplorerHeaderControls.styles.esm.js.map +0 -1
  247. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.cjs.js +0 -34
  248. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.cjs.js.map +0 -1
  249. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.d.ts +0 -20
  250. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.d.ts.map +0 -1
  251. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.esm.js +0 -346
  252. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.esm.js.map +0 -1
  253. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.styles.cjs.js +0 -2
  254. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.styles.cjs.js.map +0 -1
  255. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.styles.esm.js +0 -7
  256. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.styles.esm.js.map +0 -1
  257. package/dist/components/file-explorer-header/FileExplorerProvider.cjs.js +0 -13
  258. package/dist/components/file-explorer-header/FileExplorerProvider.cjs.js.map +0 -1
  259. package/dist/components/file-explorer-header/FileExplorerProvider.d.ts +0 -36
  260. package/dist/components/file-explorer-header/FileExplorerProvider.d.ts.map +0 -1
  261. package/dist/components/file-explorer-header/FileExplorerProvider.esm.js +0 -470
  262. package/dist/components/file-explorer-header/FileExplorerProvider.esm.js.map +0 -1
  263. package/dist/components/file-explorer-header/FileExplorerProvider.styles.cjs.js +0 -2
  264. package/dist/components/file-explorer-header/FileExplorerProvider.styles.cjs.js.map +0 -1
  265. package/dist/components/file-explorer-header/FileExplorerProvider.styles.esm.js +0 -7
  266. package/dist/components/file-explorer-header/FileExplorerProvider.styles.esm.js.map +0 -1
  267. package/dist/components/file-explorer-header/index.cjs.js +0 -1
  268. package/dist/components/file-explorer-header/index.d.ts +0 -3
  269. package/dist/components/file-explorer-header/index.d.ts.map +0 -1
  270. package/dist/components/file-explorer-header/index.esm.js +0 -2
  271. package/dist/components/file-explorer-header/types.d.ts +0 -10
  272. package/dist/components/file-explorer-header/types.d.ts.map +0 -1
  273. package/dist/components/resource-actions-menu/DeleteResourceDialog.d.ts +0 -8
  274. package/dist/components/resource-actions-menu/DeleteResourceDialog.d.ts.map +0 -1
  275. package/dist/components/resource-actions-menu/ResourceActionsMenu.cjs.js +0 -32
  276. package/dist/components/resource-actions-menu/ResourceActionsMenu.cjs.js.map +0 -1
  277. package/dist/components/resource-actions-menu/ResourceActionsMenu.d.ts +0 -19
  278. package/dist/components/resource-actions-menu/ResourceActionsMenu.d.ts.map +0 -1
  279. package/dist/components/resource-actions-menu/ResourceActionsMenu.esm.js +0 -322
  280. package/dist/components/resource-actions-menu/ResourceActionsMenu.esm.js.map +0 -1
  281. package/dist/components/resource-actions-menu/ResourceActionsMenu.styles.cjs.js +0 -2
  282. package/dist/components/resource-actions-menu/ResourceActionsMenu.styles.cjs.js.map +0 -1
  283. package/dist/components/resource-actions-menu/ResourceActionsMenu.styles.esm.js +0 -7
  284. package/dist/components/resource-actions-menu/ResourceActionsMenu.styles.esm.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outlineDomHelpers.cjs.js","names":["utils","uri","solid_ui","rdflib","createOutlineDomHelpers","appendRemoveIcon","image","outlineIcons","dom","removeNodeIconMouseDownListener","removeNode","subject","node","termWidget","iconContainer","domArg","iconTD","iconHost","img","icon","width","listener","baseURI","x","elt","eltSrc","oldIcon","newIcon","outlineObjectDiv","objectDiv","obj","UI","expandMouseDownListener","kb","view","viewAsBoringDefault","deleteNode","setSelected","selectableTDClickListener","outlinePredicateDiv","predicateTD","predicate","internal","lab","inverse","labelTD","w","newTr"],"sources":["../../src/outline/outlineDomHelpers.ts"],"sourcesContent":["import { uri } from 'rdflib'\nimport { utils } from 'solid-ui'\n\ntype OutlineIcon = {\n src: string\n alt: string\n tooltip?: string\n width: number\n}\n\ntype TermWidget = {\n construct: (domArg?: Document) => HTMLElement\n addIcon: (iconHost: ParentNode, icon: OutlineIcon, listener?: EventListener) => void\n removeIcon: (iconHost: ParentNode, icon: OutlineIcon) => void\n replaceIcon: (iconHost: ParentNode, oldIcon: OutlineIcon, newIcon: OutlineIcon, listener?: EventListener) => void\n}\n\nexport function createOutlineDomHelpers ({\n dom,\n UI,\n kb,\n outlineIcons,\n expandMouseDownListener,\n selectableTDClickListener,\n setSelected,\n viewAsBoringDefault,\n removeNodeIconMouseDownListener\n}) {\n function appendRemoveIcon (node, subject, removeNode) {\n const image = utils.AJARImage(\n outlineIcons.src.icon_remove_node,\n 'remove',\n undefined,\n dom\n )\n image.addEventListener('click', removeNodeIconMouseDownListener)\n image.node = removeNode\n image.setAttribute('about', subject.toNT())\n image.style.marginLeft = '5px'\n image.style.marginRight = '10px'\n node.appendChild(image)\n return image\n }\n\n const termWidget = {} as TermWidget\n globalThis.termWidget = termWidget\n\n termWidget.construct = function (domArg) {\n domArg = domArg || document\n const iconContainer = domArg.createElement('div')\n iconContainer.setAttribute(\n 'style',\n 'margin: 0.2em; border: none; padding: 0; vertical-align: top;'\n )\n iconContainer.setAttribute('class', 'iconTD')\n iconContainer.setAttribute('notSelectable', 'true')\n iconContainer.style.width = '0px'\n return iconContainer\n }\n\n termWidget.addIcon = function (iconHost, icon, listener) {\n const iconTD = iconHost.childNodes[1] as HTMLElement | undefined\n if (!iconTD) return\n const img = utils.AJARImage(icon.src, icon.alt, icon.tooltip, dom)\n const width = Number.parseInt(iconTD.style.width || '0', 10) + icon.width\n iconTD.style.width = width + 'px'\n iconTD.appendChild(img)\n if (listener) {\n img.addEventListener('click', listener)\n }\n }\n\n termWidget.removeIcon = function (iconHost, icon) {\n const iconTD = iconHost.childNodes[1] as HTMLElement | undefined\n let baseURI\n if (!iconTD) return\n const width = Number.parseInt(iconTD.style.width || '0', 10) - icon.width\n iconTD.style.width = width + 'px'\n for (let x = 0; x < iconTD.childNodes.length; x++) {\n const elt = iconTD.childNodes[x] as HTMLImageElement\n const eltSrc = elt.src\n\n try {\n baseURI = dom.location.href.split('?')[0]\n } catch (e) {\n baseURI = ''\n }\n const relativeIconSrc = uri.join(icon.src, baseURI)\n if (eltSrc === relativeIconSrc) {\n iconTD.removeChild(elt)\n }\n }\n }\n\n termWidget.replaceIcon = function (iconHost, oldIcon, newIcon, listener) {\n termWidget.removeIcon(iconHost, oldIcon)\n termWidget.addIcon(iconHost, newIcon, listener)\n }\n\n // old name: outlineObjectTD\n function outlineObjectDiv (\n obj,\n view,\n deleteNode,\n statement\n ) {\n const objectDiv = dom.createElement('div')\n objectDiv.classList.add('obj')\n objectDiv.setAttribute('notSelectable', 'false')\n objectDiv.setAttribute('role', 'gridcell')\n objectDiv.setAttribute('tabindex', '0')\n objectDiv.setAttribute('data-outline-node', 'object')\n if (!obj) {\n objectDiv.textContent = 'No object available.'\n return objectDiv\n }\n const theClass = 'obj'\n\n if (\n obj.termType === 'NamedNode' ||\n obj.termType === 'BlankNode' ||\n (obj.termType === 'Literal' &&\n obj.value.slice &&\n (obj.value.slice(0, 6) === 'ftp://' ||\n obj.value.slice(0, 8) === 'https://' ||\n obj.value.slice(0, 7) === 'http://'))\n ) {\n objectDiv.setAttribute('about', obj.toNT())\n objectDiv.appendChild(\n UI.utils.AJARImage(\n UI.icons.originalIconBase + 'tbl-expand-trans.png',\n 'expand',\n undefined,\n dom\n )\n ).addEventListener('click', expandMouseDownListener)\n }\n objectDiv.setAttribute('class', theClass)\n if (kb.whether(obj, UI.ns.rdf('type'), UI.ns.link('Request'))) {\n objectDiv.className = 'undetermined'\n }\n\n if (!view) {\n view = viewAsBoringDefault\n }\n objectDiv.appendChild(view(obj))\n if (deleteNode) {\n appendRemoveIcon(objectDiv, obj, deleteNode)\n }\n\n objectDiv.tabulatorSelect = function () {\n setSelected(this, true)\n }\n objectDiv.tabulatorDeselect = function () {\n setSelected(this, false)\n }\n\n objectDiv.addEventListener('click', selectableTDClickListener)\n return objectDiv\n }\n\n // old name: outlinePredicateTD\n function outlinePredicateDiv (\n predicate,\n newTr,\n inverse,\n internal\n ) {\n const predicateTD = dom.createElement('div')\n predicateTD.setAttribute('about', predicate.toNT())\n predicateTD.setAttribute('class', internal ? 'pred internal' : 'pred')\n predicateTD.setAttribute('role', 'gridcell')\n predicateTD.setAttribute('data-outline-node', 'predicate')\n\n let lab\n switch (predicate.termType) {\n case 'BlankNode':\n predicateTD.className = 'undetermined'\n break\n case 'NamedNode':\n lab = UI.utils.predicateLabelForXML(predicate, inverse)\n break\n case 'Collection':\n lab = UI.utils.predicateLabelForXML(predicate.elements[0], inverse)\n }\n lab = lab ? lab.slice(0, 1).toUpperCase() + lab.slice(1) : '...'\n\n const labelTD = dom.createElement('div')\n labelTD.classList.add('labelTD')\n labelTD.setAttribute('notSelectable', 'true')\n labelTD.appendChild(dom.createTextNode(lab))\n predicateTD.appendChild(labelTD)\n labelTD.style.width = '100%'\n predicateTD.appendChild(termWidget.construct(dom))\n for (const w in outlineIcons.termWidgets) {\n if (!newTr || !newTr.AJAR_statement) break\n if (\n outlineIcons.termWidgets[w].filter &&\n outlineIcons.termWidgets[w].filter(\n newTr.AJAR_statement,\n 'pred',\n inverse\n )\n ) {\n termWidget.addIcon(predicateTD, outlineIcons.termWidgets[w])\n }\n }\n\n predicateTD.tabulatorSelect = function () {\n setSelected(this, true)\n }\n predicateTD.tabulatorDeselect = function () {\n setSelected(this, false)\n }\n predicateTD.addEventListener('click', selectableTDClickListener)\n return predicateTD\n }\n\n return {\n appendRemoveIcon,\n outlineObjectDiv,\n outlinePredicateDiv,\n termWidget\n }\n}\n"],"mappings":"A,8CAiBA,SAAgBI,EAAyB,CACvC,MACA,KACA,KACA,eACA,0BACA,4BACA,cACA,sBACA,mCACC,CACD,SAASC,EAAkB,EAAM,EAAS,EAAY,CACpD,IAAMC,EAAQN,EAAAA,MAAM,UAClBO,EAAa,IAAI,iBACjB,SACA,IAAA,GACAC,CACF,EAOA,OANAF,EAAM,iBAAiB,QAASG,CAA+B,EAC/D,EAAM,KAAOC,EACbJ,EAAM,aAAa,QAASK,EAAQ,KAAK,CAAC,EAC1C,EAAM,MAAM,WAAa,MACzB,EAAM,MAAM,YAAc,OAC1BC,EAAK,YAAYN,CAAK,EACfA,CACT,CAEA,IAAMO,EAAa,CAAC,EACpB,WAAW,WAAaA,EAExB,EAAW,UAAY,SAAU,EAAQ,CACvC,IAAmB,SACnB,IAAMC,EAAgBC,EAAO,cAAc,KAAK,EAQhD,OAPAD,EAAc,aACZ,QACA,+DACF,EACAA,EAAc,aAAa,QAAS,QAAQ,EAC5CA,EAAc,aAAa,gBAAiB,MAAM,EAClD,EAAc,MAAM,MAAQ,MACrBA,CACT,EAEA,EAAW,QAAU,SAAU,EAAU,EAAM,EAAU,CACvD,IAAME,EAASC,EAAS,WAAW,GACnC,GAAI,CAACD,EAAQ,OACb,IAAME,EAAMlB,EAAAA,MAAM,UAAUmB,EAAK,IAAKA,EAAK,IAAKA,EAAK,QAASX,CAAG,EAC3DY,EAAQ,OAAO,SAASJ,EAAO,MAAM,OAAS,IAAK,EAAE,EAAIG,EAAK,MACpE,EAAO,MAAM,MAAQC,EAAQ,KAC7BJ,EAAO,YAAYE,CAAG,EAClBG,GACFH,EAAI,iBAAiB,QAASG,CAAQ,CAE1C,EAEA,EAAW,WAAa,SAAU,EAAU,EAAM,CAChD,IAAML,EAASC,EAAS,WAAW,GAC/BK,EACJ,GAAI,CAACN,EAAQ,OACb,IAAMI,EAAQ,OAAO,SAASJ,EAAO,MAAM,OAAS,IAAK,EAAE,EAAIG,EAAK,MACpE,EAAO,MAAM,MAAQC,EAAQ,KAC7B,IAAK,IAAIG,EAAI,EAAGA,EAAIP,EAAO,WAAW,OAAQ,IAAK,CACjD,IAAMQ,EAAMR,EAAO,WAAWO,GACxBE,EAASD,EAAI,IAEnB,GAAI,CACF,EAAUhB,EAAI,SAAS,KAAK,MAAM,GAAG,CAAC,CAAC,EACzC,MAAY,CACV,EAAU,EACZ,CAEIiB,IADoBxB,EAAAA,IAAI,KAAKkB,EAAK,IAAKG,CAC5B,GACbN,EAAO,YAAYQ,CAAG,CAE1B,CACF,EAEA,EAAW,YAAc,SAAU,EAAU,EAAS,EAAS,EAAU,CACvEX,EAAW,WAAWI,EAAUS,CAAO,EACvCb,EAAW,QAAQI,EAAUU,EAASN,CAAQ,CAChD,EAGA,SAASO,EACP,EACA,EACA,EACA,EACA,CACA,IAAMC,EAAYrB,EAAI,cAAc,KAAK,EAoDzC,OAnDAqB,EAAU,UAAU,IAAI,KAAK,EAC7BA,EAAU,aAAa,gBAAiB,OAAO,EAC/CA,EAAU,aAAa,OAAQ,UAAU,EACzCA,EAAU,aAAa,WAAY,GAAG,EACtCA,EAAU,aAAa,oBAAqB,QAAQ,EAC/CC,IAOHA,EAAI,WAAa,aACjBA,EAAI,WAAa,aAChBA,EAAI,WAAa,WAChBA,EAAI,MAAM,QACTA,EAAI,MAAM,MAAM,EAAG,CAAC,IAAM,UACzBA,EAAI,MAAM,MAAM,EAAG,CAAC,IAAM,YAC1BA,EAAI,MAAM,MAAM,EAAG,CAAC,IAAM,cAE9BD,EAAU,aAAa,QAASC,EAAI,KAAK,CAAC,EAC1CD,EAAU,YACRE,EAAG,MAAM,UACPA,EAAG,MAAM,iBAAmB,uBAC5B,SACA,IAAA,GACAvB,CACF,CACF,CAAC,CAAC,iBAAiB,QAASwB,CAAuB,GAErDH,EAAU,aAAa,QAAS,KAAQ,EACpCI,EAAG,QAAQH,EAAKC,EAAG,GAAG,IAAI,MAAM,EAAGA,EAAG,GAAG,KAAK,SAAS,CAAC,IAC1D,EAAU,UAAY,gBAGxB,AACEG,IAAOC,EAETN,EAAU,YAAYK,EAAKJ,CAAG,CAAC,EAC3BM,GACF/B,EAAiBwB,EAAWC,EAAKM,CAAU,EAG7C,EAAU,gBAAkB,UAAY,CACtCC,EAAY,KAAM,EAAI,CACxB,EACA,EAAU,kBAAoB,UAAY,CACxCA,EAAY,KAAM,EAAK,CACzB,EAEAR,EAAU,iBAAiB,QAASS,CAAyB,EACtDT,IA7CL,EAAU,YAAc,uBACjBA,EA6CX,CAGA,SAASU,EACP,EACA,EACA,EACA,EACA,CACA,IAAMC,EAAchC,EAAI,cAAc,KAAK,EAC3CgC,EAAY,aAAa,QAASC,EAAU,KAAK,CAAC,EAClDD,EAAY,aAAa,QAASE,EAAW,gBAAkB,MAAM,EACrEF,EAAY,aAAa,OAAQ,UAAU,EAC3CA,EAAY,aAAa,oBAAqB,WAAW,EAEzD,IAAIG,EACJ,OAAQF,EAAU,SAAlB,CACE,IAAK,YACH,EAAY,UAAY,eACxB,MACF,IAAK,YACH,EAAMV,EAAG,MAAM,qBAAqBU,EAAWG,CAAO,EACtD,MACF,IAAK,aACH,EAAMb,EAAG,MAAM,qBAAqBU,EAAU,SAAS,GAAIG,CAAO,CACtE,CACA,EAAMD,EAAMA,EAAI,MAAM,EAAG,CAAC,CAAC,CAAC,YAAY,EAAIA,EAAI,MAAM,CAAC,EAAI,MAE3D,IAAME,EAAUrC,EAAI,cAAc,KAAK,EACvCqC,EAAQ,UAAU,IAAI,SAAS,EAC/BA,EAAQ,aAAa,gBAAiB,MAAM,EAC5CA,EAAQ,YAAYrC,EAAI,eAAemC,CAAG,CAAC,EAC3CH,EAAY,YAAYK,CAAO,EAC/B,EAAQ,MAAM,MAAQ,OACtBL,EAAY,YAAY3B,EAAW,UAAUL,CAAG,CAAC,EACjD,IAAK,IAAMsC,KAAKvC,EAAa,YAAa,CACxC,GAAI,CAACwC,GAAS,CAACA,EAAM,eAAgB,MAEnCxC,EAAa,YAAYuC,EAAE,CAAC,QAC5BvC,EAAa,YAAYuC,EAAE,CAAC,OAC1BC,EAAM,eACN,OACAH,CACF,GAEA/B,EAAW,QAAQ2B,EAAajC,EAAa,YAAYuC,EAAE,CAE/D,CASA,MAPA,GAAY,gBAAkB,UAAY,CACxCT,EAAY,KAAM,EAAI,CACxB,EACA,EAAY,kBAAoB,UAAY,CAC1CA,EAAY,KAAM,EAAK,CACzB,EACAG,EAAY,iBAAiB,QAASF,CAAyB,EACxDE,CACT,CAEA,MAAO,CACL,mBACA,mBACA,sBACA,YACF,CACF,C"}
@@ -0,0 +1,30 @@
1
+ type OutlineIcon = {
2
+ src: string;
3
+ alt: string;
4
+ tooltip?: string;
5
+ width: number;
6
+ };
7
+ type TermWidget = {
8
+ construct: (domArg?: Document) => HTMLElement;
9
+ addIcon: (iconHost: ParentNode, icon: OutlineIcon, listener?: EventListener) => void;
10
+ removeIcon: (iconHost: ParentNode, icon: OutlineIcon) => void;
11
+ replaceIcon: (iconHost: ParentNode, oldIcon: OutlineIcon, newIcon: OutlineIcon, listener?: EventListener) => void;
12
+ };
13
+ export declare function createOutlineDomHelpers({ dom, UI, kb, outlineIcons, expandMouseDownListener, selectableTDClickListener, setSelected, viewAsBoringDefault, removeNodeIconMouseDownListener }: {
14
+ dom: any;
15
+ UI: any;
16
+ kb: any;
17
+ outlineIcons: any;
18
+ expandMouseDownListener: any;
19
+ selectableTDClickListener: any;
20
+ setSelected: any;
21
+ viewAsBoringDefault: any;
22
+ removeNodeIconMouseDownListener: any;
23
+ }): {
24
+ appendRemoveIcon: (node: any, subject: any, removeNode: any) => any;
25
+ outlineObjectDiv: (obj: any, view: any, deleteNode: any, statement: any) => any;
26
+ outlinePredicateDiv: (predicate: any, newTr: any, inverse: any, internal: any) => any;
27
+ termWidget: TermWidget;
28
+ };
29
+ export {};
30
+ //# sourceMappingURL=outlineDomHelpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outlineDomHelpers.d.ts","sourceRoot":"","sources":["../../src/outline/outlineDomHelpers.ts"],"names":[],"mappings":"AAGA,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,KAAK,UAAU,GAAG;IAChB,SAAS,EAAE,CAAC,MAAM,CAAC,EAAE,QAAQ,KAAK,WAAW,CAAA;IAC7C,OAAO,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,aAAa,KAAK,IAAI,CAAA;IACpF,UAAU,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,KAAK,IAAI,CAAA;IAC7D,WAAW,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,CAAC,EAAE,aAAa,KAAK,IAAI,CAAA;CAClH,CAAA;AAED,wBAAgB,uBAAuB,CAAE,EACvC,GAAG,EACH,EAAE,EACF,EAAE,EACF,YAAY,EACZ,uBAAuB,EACvB,yBAAyB,EACzB,WAAW,EACX,mBAAmB,EACnB,+BAA+B,EAChC;;;;;;;;;;CAAA;;;;;EAqMA"}
@@ -0,0 +1,79 @@
1
+ import { utils as e } from "solid-ui";
2
+ import { uri as t } from "rdflib";
3
+ // src/outline/outlineDomHelpers.ts
4
+ function n({ dom: n, UI: r, kb: i, outlineIcons: a, expandMouseDownListener: o, selectableTDClickListener: s, setSelected: c, viewAsBoringDefault: l, removeNodeIconMouseDownListener: u }) {
5
+ function d(t, r, i) {
6
+ let o = e.AJARImage(a.src.icon_remove_node, "remove", void 0, n);
7
+ return o.addEventListener("click", u), o.node = i, o.setAttribute("about", r.toNT()), o.style.marginLeft = "5px", o.style.marginRight = "10px", t.appendChild(o), o;
8
+ }
9
+ let f = {};
10
+ globalThis.termWidget = f, f.construct = function(e) {
11
+ e ||= document;
12
+ let t = e.createElement("div");
13
+ return t.setAttribute("style", "margin: 0.2em; border: none; padding: 0; vertical-align: top;"), t.setAttribute("class", "iconTD"), t.setAttribute("notSelectable", "true"), t.style.width = "0px", t;
14
+ }, f.addIcon = function(t, r, i) {
15
+ let a = t.childNodes[1];
16
+ if (!a) return;
17
+ let o = e.AJARImage(r.src, r.alt, r.tooltip, n), s = Number.parseInt(a.style.width || "0", 10) + r.width;
18
+ a.style.width = s + "px", a.appendChild(o), i && o.addEventListener("click", i);
19
+ }, f.removeIcon = function(e, r) {
20
+ let i = e.childNodes[1], a;
21
+ if (!i) return;
22
+ let o = Number.parseInt(i.style.width || "0", 10) - r.width;
23
+ i.style.width = o + "px";
24
+ for (let e = 0; e < i.childNodes.length; e++) {
25
+ let o = i.childNodes[e], s = o.src;
26
+ try {
27
+ a = n.location.href.split("?")[0];
28
+ } catch {
29
+ a = "";
30
+ }
31
+ s === t.join(r.src, a) && i.removeChild(o);
32
+ }
33
+ }, f.replaceIcon = function(e, t, n, r) {
34
+ f.removeIcon(e, t), f.addIcon(e, n, r);
35
+ };
36
+ function p(e, t, a, u) {
37
+ let f = n.createElement("div");
38
+ return f.classList.add("obj"), f.setAttribute("notSelectable", "false"), f.setAttribute("role", "gridcell"), f.setAttribute("tabindex", "0"), f.setAttribute("data-outline-node", "object"), e ? ((e.termType === "NamedNode" || e.termType === "BlankNode" || e.termType === "Literal" && e.value.slice && (e.value.slice(0, 6) === "ftp://" || e.value.slice(0, 8) === "https://" || e.value.slice(0, 7) === "http://")) && (f.setAttribute("about", e.toNT()), f.appendChild(r.utils.AJARImage(r.icons.originalIconBase + "tbl-expand-trans.png", "expand", void 0, n)).addEventListener("click", o)), f.setAttribute("class", "obj"), i.whether(e, r.ns.rdf("type"), r.ns.link("Request")) && (f.className = "undetermined"), t ||= l, f.appendChild(t(e)), a && d(f, e, a), f.tabulatorSelect = function() {
39
+ c(this, !0);
40
+ }, f.tabulatorDeselect = function() {
41
+ c(this, !1);
42
+ }, f.addEventListener("click", s), f) : (f.textContent = "No object available.", f);
43
+ }
44
+ function m(e, t, i, o) {
45
+ let l = n.createElement("div");
46
+ l.setAttribute("about", e.toNT()), l.setAttribute("class", o ? "pred internal" : "pred"), l.setAttribute("role", "gridcell"), l.setAttribute("data-outline-node", "predicate");
47
+ let u;
48
+ switch (e.termType) {
49
+ case "BlankNode":
50
+ l.className = "undetermined";
51
+ break;
52
+ case "NamedNode":
53
+ u = r.utils.predicateLabelForXML(e, i);
54
+ break;
55
+ case "Collection": u = r.utils.predicateLabelForXML(e.elements[0], i);
56
+ }
57
+ u = u ? u.slice(0, 1).toUpperCase() + u.slice(1) : "...";
58
+ let d = n.createElement("div");
59
+ d.classList.add("labelTD"), d.setAttribute("notSelectable", "true"), d.appendChild(n.createTextNode(u)), l.appendChild(d), d.style.width = "100%", l.appendChild(f.construct(n));
60
+ for (let e in a.termWidgets) {
61
+ if (!t || !t.AJAR_statement) break;
62
+ a.termWidgets[e].filter && a.termWidgets[e].filter(t.AJAR_statement, "pred", i) && f.addIcon(l, a.termWidgets[e]);
63
+ }
64
+ return l.tabulatorSelect = function() {
65
+ c(this, !0);
66
+ }, l.tabulatorDeselect = function() {
67
+ c(this, !1);
68
+ }, l.addEventListener("click", s), l;
69
+ }
70
+ return {
71
+ appendRemoveIcon: d,
72
+ outlineObjectDiv: p,
73
+ outlinePredicateDiv: m,
74
+ termWidget: f
75
+ };
76
+ }
77
+ export { n as createOutlineDomHelpers };
78
+
79
+ //# sourceMappingURL=outlineDomHelpers.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"outlineDomHelpers.esm.js","names":["createOutlineDomHelpers","appendRemoveIcon","image","utils","outlineIcons","dom","removeNodeIconMouseDownListener","removeNode","subject","node","termWidget","iconContainer","domArg","iconTD","iconHost","img","icon","width","listener","baseURI","x","elt","eltSrc","uri","oldIcon","newIcon","outlineObjectDiv","objectDiv","obj","UI","expandMouseDownListener","kb","view","viewAsBoringDefault","deleteNode","selectableTDClickListener","outlinePredicateDiv","predicateTD","predicate","internal","lab","inverse","labelTD","w","newTr"],"sources":["../../src/outline/outlineDomHelpers.ts"],"sourcesContent":["import { uri } from 'rdflib'\nimport { utils } from 'solid-ui'\n\ntype OutlineIcon = {\n src: string\n alt: string\n tooltip?: string\n width: number\n}\n\ntype TermWidget = {\n construct: (domArg?: Document) => HTMLElement\n addIcon: (iconHost: ParentNode, icon: OutlineIcon, listener?: EventListener) => void\n removeIcon: (iconHost: ParentNode, icon: OutlineIcon) => void\n replaceIcon: (iconHost: ParentNode, oldIcon: OutlineIcon, newIcon: OutlineIcon, listener?: EventListener) => void\n}\n\nexport function createOutlineDomHelpers ({\n dom,\n UI,\n kb,\n outlineIcons,\n expandMouseDownListener,\n selectableTDClickListener,\n setSelected,\n viewAsBoringDefault,\n removeNodeIconMouseDownListener\n}) {\n function appendRemoveIcon (node, subject, removeNode) {\n const image = utils.AJARImage(\n outlineIcons.src.icon_remove_node,\n 'remove',\n undefined,\n dom\n )\n image.addEventListener('click', removeNodeIconMouseDownListener)\n image.node = removeNode\n image.setAttribute('about', subject.toNT())\n image.style.marginLeft = '5px'\n image.style.marginRight = '10px'\n node.appendChild(image)\n return image\n }\n\n const termWidget = {} as TermWidget\n globalThis.termWidget = termWidget\n\n termWidget.construct = function (domArg) {\n domArg = domArg || document\n const iconContainer = domArg.createElement('div')\n iconContainer.setAttribute(\n 'style',\n 'margin: 0.2em; border: none; padding: 0; vertical-align: top;'\n )\n iconContainer.setAttribute('class', 'iconTD')\n iconContainer.setAttribute('notSelectable', 'true')\n iconContainer.style.width = '0px'\n return iconContainer\n }\n\n termWidget.addIcon = function (iconHost, icon, listener) {\n const iconTD = iconHost.childNodes[1] as HTMLElement | undefined\n if (!iconTD) return\n const img = utils.AJARImage(icon.src, icon.alt, icon.tooltip, dom)\n const width = Number.parseInt(iconTD.style.width || '0', 10) + icon.width\n iconTD.style.width = width + 'px'\n iconTD.appendChild(img)\n if (listener) {\n img.addEventListener('click', listener)\n }\n }\n\n termWidget.removeIcon = function (iconHost, icon) {\n const iconTD = iconHost.childNodes[1] as HTMLElement | undefined\n let baseURI\n if (!iconTD) return\n const width = Number.parseInt(iconTD.style.width || '0', 10) - icon.width\n iconTD.style.width = width + 'px'\n for (let x = 0; x < iconTD.childNodes.length; x++) {\n const elt = iconTD.childNodes[x] as HTMLImageElement\n const eltSrc = elt.src\n\n try {\n baseURI = dom.location.href.split('?')[0]\n } catch (e) {\n baseURI = ''\n }\n const relativeIconSrc = uri.join(icon.src, baseURI)\n if (eltSrc === relativeIconSrc) {\n iconTD.removeChild(elt)\n }\n }\n }\n\n termWidget.replaceIcon = function (iconHost, oldIcon, newIcon, listener) {\n termWidget.removeIcon(iconHost, oldIcon)\n termWidget.addIcon(iconHost, newIcon, listener)\n }\n\n // old name: outlineObjectTD\n function outlineObjectDiv (\n obj,\n view,\n deleteNode,\n statement\n ) {\n const objectDiv = dom.createElement('div')\n objectDiv.classList.add('obj')\n objectDiv.setAttribute('notSelectable', 'false')\n objectDiv.setAttribute('role', 'gridcell')\n objectDiv.setAttribute('tabindex', '0')\n objectDiv.setAttribute('data-outline-node', 'object')\n if (!obj) {\n objectDiv.textContent = 'No object available.'\n return objectDiv\n }\n const theClass = 'obj'\n\n if (\n obj.termType === 'NamedNode' ||\n obj.termType === 'BlankNode' ||\n (obj.termType === 'Literal' &&\n obj.value.slice &&\n (obj.value.slice(0, 6) === 'ftp://' ||\n obj.value.slice(0, 8) === 'https://' ||\n obj.value.slice(0, 7) === 'http://'))\n ) {\n objectDiv.setAttribute('about', obj.toNT())\n objectDiv.appendChild(\n UI.utils.AJARImage(\n UI.icons.originalIconBase + 'tbl-expand-trans.png',\n 'expand',\n undefined,\n dom\n )\n ).addEventListener('click', expandMouseDownListener)\n }\n objectDiv.setAttribute('class', theClass)\n if (kb.whether(obj, UI.ns.rdf('type'), UI.ns.link('Request'))) {\n objectDiv.className = 'undetermined'\n }\n\n if (!view) {\n view = viewAsBoringDefault\n }\n objectDiv.appendChild(view(obj))\n if (deleteNode) {\n appendRemoveIcon(objectDiv, obj, deleteNode)\n }\n\n objectDiv.tabulatorSelect = function () {\n setSelected(this, true)\n }\n objectDiv.tabulatorDeselect = function () {\n setSelected(this, false)\n }\n\n objectDiv.addEventListener('click', selectableTDClickListener)\n return objectDiv\n }\n\n // old name: outlinePredicateTD\n function outlinePredicateDiv (\n predicate,\n newTr,\n inverse,\n internal\n ) {\n const predicateTD = dom.createElement('div')\n predicateTD.setAttribute('about', predicate.toNT())\n predicateTD.setAttribute('class', internal ? 'pred internal' : 'pred')\n predicateTD.setAttribute('role', 'gridcell')\n predicateTD.setAttribute('data-outline-node', 'predicate')\n\n let lab\n switch (predicate.termType) {\n case 'BlankNode':\n predicateTD.className = 'undetermined'\n break\n case 'NamedNode':\n lab = UI.utils.predicateLabelForXML(predicate, inverse)\n break\n case 'Collection':\n lab = UI.utils.predicateLabelForXML(predicate.elements[0], inverse)\n }\n lab = lab ? lab.slice(0, 1).toUpperCase() + lab.slice(1) : '...'\n\n const labelTD = dom.createElement('div')\n labelTD.classList.add('labelTD')\n labelTD.setAttribute('notSelectable', 'true')\n labelTD.appendChild(dom.createTextNode(lab))\n predicateTD.appendChild(labelTD)\n labelTD.style.width = '100%'\n predicateTD.appendChild(termWidget.construct(dom))\n for (const w in outlineIcons.termWidgets) {\n if (!newTr || !newTr.AJAR_statement) break\n if (\n outlineIcons.termWidgets[w].filter &&\n outlineIcons.termWidgets[w].filter(\n newTr.AJAR_statement,\n 'pred',\n inverse\n )\n ) {\n termWidget.addIcon(predicateTD, outlineIcons.termWidgets[w])\n }\n }\n\n predicateTD.tabulatorSelect = function () {\n setSelected(this, true)\n }\n predicateTD.tabulatorDeselect = function () {\n setSelected(this, false)\n }\n predicateTD.addEventListener('click', selectableTDClickListener)\n return predicateTD\n }\n\n return {\n appendRemoveIcon,\n outlineObjectDiv,\n outlinePredicateDiv,\n termWidget\n }\n}\n"],"mappings":"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"}
@@ -1,10 +1,9 @@
1
1
  import * as e from "solid-ui";
2
- //#region src/outline/outlineIcons.js
2
+ // src/outline/outlineIcons.js
3
3
  var t = {};
4
4
  t.src = [], t.tooltips = [], t.src.icon_expand = e.icons.originalIconBase + "tbl-expand-trans.png", t.src.icon_more = e.icons.originalIconBase + "tbl-more-trans.png", t.src.icon_collapse = e.icons.originalIconBase + "tbl-collapse.png", t.src.icon_internals = e.icons.originalIconBase + "tango/22-emblem-system.png", t.src.icon_instances = e.icons.originalIconBase + "tango/22-folder-open.png", t.src.icon_foaf = e.icons.originalIconBase + "foaf/foafTiny.gif", t.src.icon_social = e.icons.originalIconBase + "social/social.gif", t.src.icon_mb = e.icons.originalIconBase + "microblog/microblog.png", t.src.icon_shrink = e.icons.originalIconBase + "tbl-shrink.png", t.src.icon_rows = e.icons.originalIconBase + "tbl-rows.png", t.src.icon_unrequested = e.icons.originalIconBase + "16dot-blue.gif", t.src.icon_fetched = e.icons.originalIconBase + "16dot-green.gif", t.src.icon_failed = e.icons.originalIconBase + "16dot-red.gif", t.src.icon_requested = e.icons.originalIconBase + "16dot-yellow.gif", t.src.icon_CVPane = e.icons.originalIconBase + "CV.png", t.src.icon_defaultPane = e.icons.originalIconBase + "about.png", t.src.icon_visit = e.icons.originalIconBase + "tango/22-text-x-generic.png", t.src.icon_dataContents = e.icons.originalIconBase + "rdf_flyer.24.gif", t.src.icon_n3Pane = e.icons.originalIconBase + "w3c/n3_smaller.png", t.src.icon_RDFXMLPane = e.icons.originalIconBase + "22-text-xml4.png", t.src.icon_imageContents = e.icons.originalIconBase + "tango/22-image-x-generic.png", t.src.icon_airPane = e.icons.originalIconBase + "1pt5a.gif", t.src.icon_LawPane = e.icons.originalIconBase + "law.jpg", t.src.icon_pushbackPane = e.icons.originalIconBase + "pb-logo.png", t.src.icon_photoPane = e.icons.originalIconBase + "photo_small.png", t.src.icon_tagPane = e.icons.originalIconBase + "tag_small.png", t.src.icon_TinyTag = e.icons.originalIconBase + "tag_tiny.png", t.src.icon_photoBegin = e.icons.originalIconBase + "photo_begin.png", t.src.icon_photoNext = e.icons.originalIconBase + "photo_next.png", t.src.icon_photoBack = e.icons.originalIconBase + "photo_back.png", t.src.icon_photoEnd = e.icons.originalIconBase + "photo_end.png", t.src.icon_photoImportPane = e.icons.originalIconBase + "flickr_small.png", t.src.icon_retract = e.icons.originalIconBase + "retract.gif", t.src.icon_refresh = e.icons.originalIconBase + "refresh.gif", t.src.icon_optoff = e.icons.originalIconBase + "optional_off.PNG", t.src.icon_opton = e.icons.originalIconBase + "optional_on.PNG", t.src.icon_map = e.icons.originalIconBase + "compassrose.png", t.src.icon_retracted = t.src.icon_unrequested, t.src.icon_retracted = t.src.icon_unrequested, t.src.icon_time = e.icons.originalIconBase + "icons/Wclocksmall.png", t.src.icon_telephone = e.icons.originalIconBase + "silk/telephone.png", t.src.icon_time = e.icons.originalIconBase + "Wclocksmall.png", t.src.icon_remove_node = e.icons.originalIconBase + "tbl-x-small.png", t.src.icon_add_triple = e.icons.originalIconBase + "tango/22-list-add.png", t.src.icon_add_new_triple = e.icons.originalIconBase + "tango/22-list-add-new.png", t.src.icon_show_choices = e.icons.originalIconBase + "userinput_show_choices_temp.png", t.src.icon_display_reasons = e.icons.originalIconBase + "tango/22-help-browser.png", t.tooltips[t.src.icon_display_reasons] = "Display explanations", t.tooltips[t.src.icon_add_triple] = "Add more", t.tooltips[t.src.icon_add_new_triple] = "Add one", t.tooltips[t.src.icon_remove_node] = "Remove", t.tooltips[t.src.icon_expand] = "View details.", t.tooltips[t.src.icon_collapse] = "Hide details.", t.tooltips[t.src.icon_shrink] = "Shrink list.", t.tooltips[t.src.icon_internals] = "Under the hood", t.tooltips[t.src.icon_instances] = "List", t.tooltips[t.src.icon_foaf] = "Friends", t.tooltips[t.src.icon_rows] = "Make a table of data like this", t.tooltips[t.src.icon_unrequested] = "Fetch this.", t.tooltips[t.src.icon_fetched] = "Fetched successfully.", t.tooltips[t.src.icon_failed] = "Failed to load. Click to retry.", t.tooltips[t.src.icon_requested] = "This is being fetched. Please wait...", t.tooltips[t.src.icon_visit] = "View document", t.tooltips[t.src.icon_retract] = "Remove this source and all its data from tabulator.", t.tooltips[t.src.icon_refresh] = "Refresh this source and reload its triples.", t.OutlinerIcon = function(e, t, n, r, i) {
5
5
  return this.src = e, this.alt = n, this.width = t, this.tooltip = r, this.filter = i, this;
6
6
  }, t.termWidgets = {}, t.termWidgets.optOn = new t.OutlinerIcon(t.src.icon_opton, 20, "opt on", "Make this branch of your query mandatory."), t.termWidgets.optOff = new t.OutlinerIcon(t.src.icon_optoff, 20, "opt off", "Make this branch of your query optional."), t.termWidgets.addTri = new t.OutlinerIcon(t.src.icon_add_triple, 18, "add tri", "Add one");
7
- //#endregion
8
7
  export { t as outlineIcons };
9
8
 
10
9
  //# sourceMappingURL=outlineIcons.esm.js.map
@@ -1,7 +1,7 @@
1
1
  import e from "./viewAsImage.esm.js";
2
2
  import t from "./viewAsMbox.esm.js";
3
3
  import { ns as n } from "solid-ui";
4
- //#region src/outline/propertyViews.ts
4
+ // src/outline/propertyViews.ts
5
5
  function r(r) {
6
6
  let a = {
7
7
  properties: [],
@@ -13,7 +13,6 @@ function r(r) {
13
13
  function i(e, t, n, r) {
14
14
  e.properties[t] || (e.properties[t] = []), e.properties[t].push(n), r && (e.defaults[t] = n);
15
15
  }
16
- //#endregion
17
16
  export { r as propertyViews, i as viewsAddPropertyView };
18
17
 
19
18
  //# sourceMappingURL=propertyViews.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"queryByExample.cjs.js","names":["require_runtime","solid_ui","rdflib","QuerySource","i","q","listener"],"sources":["../../src/outline/queryByExample.js"],"sourcesContent":["/* istanbul ignore file */\n// The query-by-example functionality in the tabulator\n// was the ability to expore a bit of the web in outline mode,\n// select a ceratain set of fields in the tree,\n// then pres \"find all\" which would then generte a SPARQL query\n// to find all other places which had the same pattern.\n// Fields could be optional by pressing th ewhite optoional button\n\nimport { store } from 'solid-logic'\nimport * as UI from 'solid-ui'\nimport * as $rdf from 'rdflib'\n\nconst optionalSubqueriesIndex = []\n\nfunction predParentOf (node) {\n let n = node\n while (true) {\n if (n.getAttribute('predTR')) {\n return n\n } else if (n.previousSibling && n.previousSibling.nodeName === 'TR') {\n n = n.previousSibling\n } else {\n console.log('Could not find predParent')\n return node\n }\n }\n}\n\nexport function makeQueryRow (q, tr, constraint) {\n // predtr = predParentOf(tr)\n // var nodes = tr.childNodes\n // var n = tr.childNodes.length\n const inverse = tr.AJAR_inverse\n // var hasVar = 0\n let parentVar, level, pat\n\n function makeRDFStatement (freeVar, parent) {\n if (inverse) {\n return new $rdf.Statement(freeVar, st.predicate, parent)\n } else {\n return new $rdf.Statement(parent, st.predicate, freeVar)\n }\n }\n\n let optionalSubqueryIndex = null\n\n for (level = tr.parentNode; level; level = level.parentNode) {\n if (typeof level.AJAR_statement !== 'undefined') {\n // level.AJAR_statement\n level.setAttribute('bla', level.AJAR_statement) // @@? -timbl\n // UI.log.debug(\"Parent TR statement=\"+level.AJAR_statement + \", var=\" + level.AJAR_variable)\n /* for(let c=0;c<level.parentNode.childNodes.length;c++) //This makes sure the same variable is used for a subject\n if(level.parentNode.childNodes[c].AJAR_variable)\n level.AJAR_variable = level.parentNode.childNodes[c].AJAR_variable; */\n if (!level.AJAR_variable) {\n makeQueryRow(q, level)\n }\n parentVar = level.AJAR_variable\n const predLevel = predParentOf(level)\n if (predLevel.getAttribute('optionalSubqueriesIndex')) {\n optionalSubqueryIndex = predLevel.getAttribute(\n 'optionalSubqueriesIndex'\n )\n pat = optionalSubqueriesIndex[optionalSubqueryIndex]\n }\n break\n }\n }\n\n if (!pat) {\n pat = q.pat\n }\n\n const predtr = predParentOf(tr)\n // /////OPTIONAL KLUDGE///////////\n const opt = predtr.getAttribute('optional')\n if (!opt) {\n if (optionalSubqueryIndex) {\n predtr.setAttribute('optionalSubqueriesIndex', optionalSubqueryIndex)\n } else {\n predtr.removeAttribute('optionalSubqueriesIndex')\n }\n }\n if (opt) {\n const optForm = store.formula()\n optionalSubqueriesIndex.push(optForm)\n predtr.setAttribute(\n 'optionalSubqueriesIndex',\n optionalSubqueriesIndex.length - 1\n )\n pat.optional.push(optForm)\n pat = optForm\n }\n\n // //////////////////////////////\n\n const st = tr.AJAR_statement\n\n const constraintVar = tr.AJAR_inverse ? st.subject : st.object // this is only used for constraints\n let hasParent = true\n if (constraintVar.isBlank && constraint) {\n window.alert(\n 'You cannot constrain a query with a blank node. No constraint will be added.'\n )\n }\n if (!parentVar) {\n hasParent = false\n parentVar = inverse ? st.object : st.subject // if there is no parents, uses the sub/obj\n }\n // UI.log.debug('Initial variable: '+tr.AJAR_variable)\n const v = tr.AJAR_variable\n ? tr.AJAR_variable\n : store.variable(UI.utils.newVariableName())\n q.vars.push(v)\n v.label = hasParent ? parentVar.label : UI.utils.label(parentVar)\n v.label += ' ' + UI.utils.predicateLabelForXML(st.predicate, inverse)\n const pattern = makeRDFStatement(v, parentVar)\n // alert(pattern)\n v.label = v.label.slice(0, 1).toUpperCase() + v.label.slice(1) // init cap\n\n // See ../rdf/sparql.js\n // This should only work on literals but doesn't.\n function ConstraintEqualTo (value) {\n this.describe = function (varstr) {\n return varstr + ' = ' + value.toNT()\n }\n this.test = function (term) {\n return value.sameTerm(term)\n }\n return this\n }\n\n if (constraint) {\n // binds the constrained variable to its selected value\n pat.constraints[v] = new ConstraintEqualTo(constraintVar)\n }\n UI.log.info('Pattern: ' + pattern)\n pattern.tr = tr\n tr.AJAR_pattern = pattern // Cross-link UI and query line\n tr.AJAR_variable = v\n // UI.log.debug('Final variable: '+tr.AJAR_variable)\n UI.log.debug('Query pattern: ' + pattern)\n pat.statements.push(pattern)\n return v\n} // makeQueryRow\n\nfunction saveQuery (selection, qs) {\n // var qs = outline.qs // @@\n const q = new $rdf.Query()\n const n = selection.length\n let i, sel, st, tr\n for (i = 0; i < n; i++) {\n sel = selection[i]\n tr = sel.parentNode\n st = tr.AJAR_statement\n UI.log.debug('Statement ' + st)\n if (sel.getAttribute('class').indexOf('pred') >= 0) {\n UI.log.info(' We have a predicate')\n makeQueryRow(q, tr)\n }\n if (sel.getAttribute('class').indexOf('obj') >= 0) {\n UI.log.info(' We have an object')\n makeQueryRow(q, tr, true)\n }\n }\n qs.addQuery(q)\n\n function resetOutliner (pat) {\n const n = pat.statements.length\n let pattern, tr\n for (let i = 0; i < n; i++) {\n pattern = pat.statements[i]\n tr = pattern.tr\n // UI.log.debug('tr: ' + tr.AJAR_statement);\n if (typeof tr !== 'undefined') {\n tr.AJAR_pattern = null // TODO: is this == to whats in current version?\n tr.AJAR_variable = null\n }\n }\n for (const x in pat.optional) {\n resetOutliner(pat.optional[x])\n }\n }\n resetOutliner(q.pat)\n // NextVariable=0;\n return q\n} // saveQuery\n\n// When the user asks for all list of all matching parts of the data\n//\nexport function viewAndSaveQuery (outline, selection) {\n const qs = outline.qs\n UI.log.info('outline.doucment is now ' + outline.document.location)\n const q = saveQuery(selection, qs)\n /*\n if (tabulator.isExtension) {\n // tabulator.drawInBestView(q)\n } else\n */\n\n for (let i = 0; i < qs.listeners.length; i++) {\n qs.listeners[i].getActiveView().view.drawQuery(q)\n qs.listeners[i].updateQueryControls(qs.listeners[i].getActiveView())\n }\n}\n\n/**\n * The QuerySource object stores a set of listeners and a set of queries.\n * It keeps the listeners aware of those queries that the source currently\n * contains, and it is then up to the listeners to decide what to do with\n * those queries in terms of displays.\n * Not used 2010-08 -- TimBL\n * @class QuerySource\n * @author jambo\n */\n\nexport function QuerySource () {\n /**\n * stores all of the queries currently held by this source,\n * indexed by ID number.\n */\n this.queries = []\n /**\n * stores the listeners for a query object.\n * @see TabbedContainer\n */\n this.listeners = []\n\n /**\n * add a Query object to the query source--It will be given an ID number\n * and a name, if it doesn't already have one. This subsequently adds the\n * query to all of the listeners the QuerySource knows about.\n */\n this.addQuery = function (q) {\n let i\n if (q.name === null || q.name === '') {\n q.name = 'Query #' + (this.queries.length + 1)\n }\n q.id = this.queries.length\n this.queries.push(q)\n for (i = 0; i < this.listeners.length; i++) {\n if (this.listeners[i] !== null) {\n this.listeners[i].addQuery(q)\n }\n }\n }\n\n /**\n * Remove a Query object from the source. Tells all listeners to also\n * remove the query.\n */\n this.removeQuery = function (q) {\n let i\n for (i = 0; i < this.listeners.length; i++) {\n if (this.listeners[i] !== null) {\n this.listeners[i].removeQuery(q)\n }\n }\n if (this.queries[q.id] !== null) {\n delete this.queries[q.id]\n }\n }\n\n /**\n * adds a \"Listener\" to this QuerySource - that is, an object\n * which is capable of both adding and removing queries.\n * Currently, only the TabbedContainer class is added.\n * also puts all current queries into the listener to be used.\n */\n this.addListener = function (listener) {\n let i\n this.listeners.push(listener)\n for (i = 0; i < this.queries.length; i++) {\n if (this.queries[i] !== null) {\n listener.addQuery(this.queries[i])\n }\n }\n }\n /**\n * removes listener from the array of listeners, if it exists! Also takes\n * all of the queries from this source out of the listener.\n */\n this.removeListener = function (listener) {\n let i\n for (i = 0; i < this.queries.length; i++) {\n if (this.queries[i] !== null) {\n listener.removeQuery(this.queries[i])\n }\n }\n\n for (i = 0; i < this.listeners.length; i++) {\n if (this.listeners[i] === listener) {\n delete this.listeners[i]\n }\n }\n }\n}\n"],"mappings":"A,+JAwNA,SAAgBG,GAAe,CAK7B,KAAK,QAAU,CAAC,EAKhB,KAAK,UAAY,CAAC,EAOlB,KAAK,SAAW,SAAU,EAAG,CAC3B,IAAIC,EAMJ,KALIC,EAAE,OAAS,MAAQA,EAAE,OAAS,MAChC,EAAE,KAAO,WAAa,KAAK,QAAQ,OAAS,IAE9C,EAAE,GAAK,KAAK,QAAQ,OACpB,KAAK,QAAQ,KAAKA,CAAC,EACd,EAAI,EAAGD,EAAI,KAAK,UAAU,OAAQ,IACjC,KAAK,UAAUA,KAAO,MACxB,KAAK,UAAUA,EAAE,CAAC,SAASC,CAAC,CAGlC,EAMA,KAAK,YAAc,SAAU,EAAG,CAC9B,IAAID,EACK,EAAT,KAAYA,EAAI,KAAK,UAAU,OAAQ,IACjC,KAAK,UAAUA,KAAO,MACxB,KAAK,UAAUA,EAAE,CAAC,YAAYC,CAAC,EAG/B,KAAK,QAAQA,EAAE,MAAQ,MACzB,OAAO,KAAK,QAAQA,EAAE,GAE1B,EAQA,KAAK,YAAc,SAAU,EAAU,CACrC,IAAID,EAEJ,IADA,KAAK,UAAU,KAAKE,CAAQ,EACvB,EAAI,EAAGF,EAAI,KAAK,QAAQ,OAAQ,IAC/B,KAAK,QAAQA,KAAO,MACtBE,EAAS,SAAS,KAAK,QAAQF,EAAE,CAGvC,EAKA,KAAK,eAAiB,SAAU,EAAU,CACxC,IAAIA,EACK,EAAT,KAAYA,EAAI,KAAK,QAAQ,OAAQ,IAC/B,KAAK,QAAQA,KAAO,MACtBE,EAAS,YAAY,KAAK,QAAQF,EAAE,EAIxC,IAAK,EAAI,EAAGA,EAAI,KAAK,UAAU,OAAQ,IACjC,KAAK,UAAUA,KAAOE,GACxB,OAAO,KAAK,UAAUF,EAG5B,CACF,C"}
1
+ {"version":3,"file":"queryByExample.cjs.js","names":["require_runtime","solid_ui","rdflib","QuerySource","i","q","listener"],"sources":["../../src/outline/queryByExample.js"],"sourcesContent":["/* istanbul ignore file */\n// The query-by-example functionality in the tabulator\n// was the ability to expore a bit of the web in outline mode,\n// select a ceratain set of fields in the tree,\n// then pres \"find all\" which would then generte a SPARQL query\n// to find all other places which had the same pattern.\n// Fields could be optional by pressing th ewhite optoional button\n\nimport { store } from 'solid-logic'\nimport * as UI from 'solid-ui'\nimport * as $rdf from 'rdflib'\n\nconst optionalSubqueriesIndex = []\n\nfunction predParentOf (node) {\n let n = node\n const isPredicateRow = (element) => {\n return Boolean(\n element &&\n typeof element.getAttribute === 'function' &&\n (element.getAttribute('predTR') === 'true' || element.getAttribute('data-outline-node') === 'predicate')\n )\n }\n while (true) {\n if (isPredicateRow(n)) {\n return n\n } else if (n.previousElementSibling) {\n n = n.previousElementSibling\n } else {\n console.log('Could not find predParent')\n return node\n }\n }\n}\n\nexport function makeQueryRow (q, tr, constraint) {\n // predtr = predParentOf(tr)\n // var nodes = tr.childNodes\n // var n = tr.childNodes.length\n const inverse = tr.AJAR_inverse\n // var hasVar = 0\n let parentVar, level, pat\n\n function makeRDFStatement (freeVar, parent) {\n if (inverse) {\n return new $rdf.Statement(freeVar, st.predicate, parent)\n } else {\n return new $rdf.Statement(parent, st.predicate, freeVar)\n }\n }\n\n let optionalSubqueryIndex = null\n\n for (level = tr.parentNode; level; level = level.parentNode) {\n if (typeof level.AJAR_statement !== 'undefined') {\n // level.AJAR_statement\n level.setAttribute('bla', level.AJAR_statement) // @@? -timbl\n // UI.log.debug(\"Parent TR statement=\"+level.AJAR_statement + \", var=\" + level.AJAR_variable)\n /* for(let c=0;c<level.parentNode.childNodes.length;c++) //This makes sure the same variable is used for a subject\n if(level.parentNode.childNodes[c].AJAR_variable)\n level.AJAR_variable = level.parentNode.childNodes[c].AJAR_variable; */\n if (!level.AJAR_variable) {\n makeQueryRow(q, level)\n }\n parentVar = level.AJAR_variable\n const predLevel = predParentOf(level)\n if (predLevel.getAttribute('optionalSubqueriesIndex')) {\n optionalSubqueryIndex = predLevel.getAttribute(\n 'optionalSubqueriesIndex'\n )\n pat = optionalSubqueriesIndex[optionalSubqueryIndex]\n }\n break\n }\n }\n\n if (!pat) {\n pat = q.pat\n }\n\n const predtr = predParentOf(tr)\n // /////OPTIONAL KLUDGE///////////\n const opt = predtr.getAttribute('optional')\n if (!opt) {\n if (optionalSubqueryIndex) {\n predtr.setAttribute('optionalSubqueriesIndex', optionalSubqueryIndex)\n } else {\n predtr.removeAttribute('optionalSubqueriesIndex')\n }\n }\n if (opt) {\n const optForm = store.formula()\n optionalSubqueriesIndex.push(optForm)\n predtr.setAttribute(\n 'optionalSubqueriesIndex',\n optionalSubqueriesIndex.length - 1\n )\n pat.optional.push(optForm)\n pat = optForm\n }\n\n // //////////////////////////////\n\n const st = tr.AJAR_statement\n\n const constraintVar = tr.AJAR_inverse ? st.subject : st.object // this is only used for constraints\n let hasParent = true\n if (constraintVar.isBlank && constraint) {\n window.alert(\n 'You cannot constrain a query with a blank node. No constraint will be added.'\n )\n }\n if (!parentVar) {\n hasParent = false\n parentVar = inverse ? st.object : st.subject // if there is no parents, uses the sub/obj\n }\n // UI.log.debug('Initial variable: '+tr.AJAR_variable)\n const v = tr.AJAR_variable\n ? tr.AJAR_variable\n : store.variable(UI.utils.newVariableName())\n q.vars.push(v)\n v.label = hasParent ? parentVar.label : UI.utils.label(parentVar)\n v.label += ' ' + UI.utils.predicateLabelForXML(st.predicate, inverse)\n const pattern = makeRDFStatement(v, parentVar)\n // alert(pattern)\n v.label = v.label.slice(0, 1).toUpperCase() + v.label.slice(1) // init cap\n\n // See ../rdf/sparql.js\n // This should only work on literals but doesn't.\n function ConstraintEqualTo (value) {\n this.describe = function (varstr) {\n return varstr + ' = ' + value.toNT()\n }\n this.test = function (term) {\n return value.sameTerm(term)\n }\n return this\n }\n\n if (constraint) {\n // binds the constrained variable to its selected value\n pat.constraints[v] = new ConstraintEqualTo(constraintVar)\n }\n UI.log.info('Pattern: ' + pattern)\n pattern.tr = tr\n tr.AJAR_pattern = pattern // Cross-link UI and query line\n tr.AJAR_variable = v\n // UI.log.debug('Final variable: '+tr.AJAR_variable)\n UI.log.debug('Query pattern: ' + pattern)\n pat.statements.push(pattern)\n return v\n} // makeQueryRow\n\nfunction saveQuery (selection, qs) {\n // var qs = outline.qs // @@\n const q = new $rdf.Query()\n const n = selection.length\n let i, sel, st, tr\n for (i = 0; i < n; i++) {\n sel = selection[i]\n tr = sel.parentNode\n st = tr.AJAR_statement\n UI.log.debug('Statement ' + st)\n if (sel.getAttribute('class').indexOf('pred') >= 0) {\n UI.log.info(' We have a predicate')\n makeQueryRow(q, tr)\n }\n if (sel.getAttribute('class').indexOf('obj') >= 0) {\n UI.log.info(' We have an object')\n makeQueryRow(q, tr, true)\n }\n }\n qs.addQuery(q)\n\n function resetOutliner (pat) {\n const n = pat.statements.length\n let pattern, tr\n for (let i = 0; i < n; i++) {\n pattern = pat.statements[i]\n tr = pattern.tr\n // UI.log.debug('tr: ' + tr.AJAR_statement);\n if (typeof tr !== 'undefined') {\n tr.AJAR_pattern = null // TODO: is this == to whats in current version?\n tr.AJAR_variable = null\n }\n }\n for (const x in pat.optional) {\n resetOutliner(pat.optional[x])\n }\n }\n resetOutliner(q.pat)\n // NextVariable=0;\n return q\n} // saveQuery\n\n// When the user asks for all list of all matching parts of the data\n//\nexport function viewAndSaveQuery (outline, selection) {\n const qs = outline.qs\n UI.log.info('outline.doucment is now ' + outline.document.location)\n const q = saveQuery(selection, qs)\n /*\n if (tabulator.isExtension) {\n // tabulator.drawInBestView(q)\n } else\n */\n\n for (let i = 0; i < qs.listeners.length; i++) {\n qs.listeners[i].getActiveView().view.drawQuery(q)\n qs.listeners[i].updateQueryControls(qs.listeners[i].getActiveView())\n }\n}\n\n/**\n * The QuerySource object stores a set of listeners and a set of queries.\n * It keeps the listeners aware of those queries that the source currently\n * contains, and it is then up to the listeners to decide what to do with\n * those queries in terms of displays.\n * Not used 2010-08 -- TimBL\n * @class QuerySource\n * @author jambo\n */\n\nexport function QuerySource () {\n /**\n * stores all of the queries currently held by this source,\n * indexed by ID number.\n */\n this.queries = []\n /**\n * stores the listeners for a query object.\n * @see TabbedContainer\n */\n this.listeners = []\n\n /**\n * add a Query object to the query source--It will be given an ID number\n * and a name, if it doesn't already have one. This subsequently adds the\n * query to all of the listeners the QuerySource knows about.\n */\n this.addQuery = function (q) {\n let i\n if (q.name === null || q.name === '') {\n q.name = 'Query #' + (this.queries.length + 1)\n }\n q.id = this.queries.length\n this.queries.push(q)\n for (i = 0; i < this.listeners.length; i++) {\n if (this.listeners[i] !== null) {\n this.listeners[i].addQuery(q)\n }\n }\n }\n\n /**\n * Remove a Query object from the source. Tells all listeners to also\n * remove the query.\n */\n this.removeQuery = function (q) {\n let i\n for (i = 0; i < this.listeners.length; i++) {\n if (this.listeners[i] !== null) {\n this.listeners[i].removeQuery(q)\n }\n }\n if (this.queries[q.id] !== null) {\n delete this.queries[q.id]\n }\n }\n\n /**\n * adds a \"Listener\" to this QuerySource - that is, an object\n * which is capable of both adding and removing queries.\n * Currently, only the TabbedContainer class is added.\n * also puts all current queries into the listener to be used.\n */\n this.addListener = function (listener) {\n let i\n this.listeners.push(listener)\n for (i = 0; i < this.queries.length; i++) {\n if (this.queries[i] !== null) {\n listener.addQuery(this.queries[i])\n }\n }\n }\n /**\n * removes listener from the array of listeners, if it exists! Also takes\n * all of the queries from this source out of the listener.\n */\n this.removeListener = function (listener) {\n let i\n for (i = 0; i < this.queries.length; i++) {\n if (this.queries[i] !== null) {\n listener.removeQuery(this.queries[i])\n }\n }\n\n for (i = 0; i < this.listeners.length; i++) {\n if (this.listeners[i] === listener) {\n delete this.listeners[i]\n }\n }\n }\n}\n"],"mappings":"A,+JA+NA,SAAgBG,GAAe,CAK7B,KAAK,QAAU,CAAC,EAKhB,KAAK,UAAY,CAAC,EAOlB,KAAK,SAAW,SAAU,EAAG,CAC3B,IAAIC,EAMJ,KALIC,EAAE,OAAS,MAAQA,EAAE,OAAS,MAChC,EAAE,KAAO,WAAa,KAAK,QAAQ,OAAS,IAE9C,EAAE,GAAK,KAAK,QAAQ,OACpB,KAAK,QAAQ,KAAKA,CAAC,EACd,EAAI,EAAGD,EAAI,KAAK,UAAU,OAAQ,IACjC,KAAK,UAAUA,KAAO,MACxB,KAAK,UAAUA,EAAE,CAAC,SAASC,CAAC,CAGlC,EAMA,KAAK,YAAc,SAAU,EAAG,CAC9B,IAAID,EACK,EAAT,KAAYA,EAAI,KAAK,UAAU,OAAQ,IACjC,KAAK,UAAUA,KAAO,MACxB,KAAK,UAAUA,EAAE,CAAC,YAAYC,CAAC,EAG/B,KAAK,QAAQA,EAAE,MAAQ,MACzB,OAAO,KAAK,QAAQA,EAAE,GAE1B,EAQA,KAAK,YAAc,SAAU,EAAU,CACrC,IAAID,EAEJ,IADA,KAAK,UAAU,KAAKE,CAAQ,EACvB,EAAI,EAAGF,EAAI,KAAK,QAAQ,OAAQ,IAC/B,KAAK,QAAQA,KAAO,MACtBE,EAAS,SAAS,KAAK,QAAQF,EAAE,CAGvC,EAKA,KAAK,eAAiB,SAAU,EAAU,CACxC,IAAIA,EACK,EAAT,KAAYA,EAAI,KAAK,QAAQ,OAAQ,IAC/B,KAAK,QAAQA,KAAO,MACtBE,EAAS,YAAY,KAAK,QAAQF,EAAE,EAIxC,IAAK,EAAI,EAAGA,EAAI,KAAK,UAAU,OAAQ,IACjC,KAAK,UAAUA,KAAOE,GACxB,OAAO,KAAK,UAAUF,EAG5B,CACF,C"}
@@ -1,7 +1,7 @@
1
1
  import "solid-ui";
2
2
  import "solid-logic";
3
3
  import "rdflib";
4
- //#region src/outline/queryByExample.js
4
+ // src/outline/queryByExample.js
5
5
  /* istanbul ignore file */
6
6
  function e() {
7
7
  this.queries = [], this.listeners = [], this.addQuery = function(e) {
@@ -20,7 +20,6 @@ function e() {
20
20
  for (t = 0; t < this.listeners.length; t++) this.listeners[t] === e && delete this.listeners[t];
21
21
  };
22
22
  }
23
- //#endregion
24
23
  export { e as QuerySource };
25
24
 
26
25
  //# sourceMappingURL=queryByExample.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"queryByExample.esm.js","names":["QuerySource","i","q","listener"],"sources":["../../src/outline/queryByExample.js"],"sourcesContent":["/* istanbul ignore file */\n// The query-by-example functionality in the tabulator\n// was the ability to expore a bit of the web in outline mode,\n// select a ceratain set of fields in the tree,\n// then pres \"find all\" which would then generte a SPARQL query\n// to find all other places which had the same pattern.\n// Fields could be optional by pressing th ewhite optoional button\n\nimport { store } from 'solid-logic'\nimport * as UI from 'solid-ui'\nimport * as $rdf from 'rdflib'\n\nconst optionalSubqueriesIndex = []\n\nfunction predParentOf (node) {\n let n = node\n while (true) {\n if (n.getAttribute('predTR')) {\n return n\n } else if (n.previousSibling && n.previousSibling.nodeName === 'TR') {\n n = n.previousSibling\n } else {\n console.log('Could not find predParent')\n return node\n }\n }\n}\n\nexport function makeQueryRow (q, tr, constraint) {\n // predtr = predParentOf(tr)\n // var nodes = tr.childNodes\n // var n = tr.childNodes.length\n const inverse = tr.AJAR_inverse\n // var hasVar = 0\n let parentVar, level, pat\n\n function makeRDFStatement (freeVar, parent) {\n if (inverse) {\n return new $rdf.Statement(freeVar, st.predicate, parent)\n } else {\n return new $rdf.Statement(parent, st.predicate, freeVar)\n }\n }\n\n let optionalSubqueryIndex = null\n\n for (level = tr.parentNode; level; level = level.parentNode) {\n if (typeof level.AJAR_statement !== 'undefined') {\n // level.AJAR_statement\n level.setAttribute('bla', level.AJAR_statement) // @@? -timbl\n // UI.log.debug(\"Parent TR statement=\"+level.AJAR_statement + \", var=\" + level.AJAR_variable)\n /* for(let c=0;c<level.parentNode.childNodes.length;c++) //This makes sure the same variable is used for a subject\n if(level.parentNode.childNodes[c].AJAR_variable)\n level.AJAR_variable = level.parentNode.childNodes[c].AJAR_variable; */\n if (!level.AJAR_variable) {\n makeQueryRow(q, level)\n }\n parentVar = level.AJAR_variable\n const predLevel = predParentOf(level)\n if (predLevel.getAttribute('optionalSubqueriesIndex')) {\n optionalSubqueryIndex = predLevel.getAttribute(\n 'optionalSubqueriesIndex'\n )\n pat = optionalSubqueriesIndex[optionalSubqueryIndex]\n }\n break\n }\n }\n\n if (!pat) {\n pat = q.pat\n }\n\n const predtr = predParentOf(tr)\n // /////OPTIONAL KLUDGE///////////\n const opt = predtr.getAttribute('optional')\n if (!opt) {\n if (optionalSubqueryIndex) {\n predtr.setAttribute('optionalSubqueriesIndex', optionalSubqueryIndex)\n } else {\n predtr.removeAttribute('optionalSubqueriesIndex')\n }\n }\n if (opt) {\n const optForm = store.formula()\n optionalSubqueriesIndex.push(optForm)\n predtr.setAttribute(\n 'optionalSubqueriesIndex',\n optionalSubqueriesIndex.length - 1\n )\n pat.optional.push(optForm)\n pat = optForm\n }\n\n // //////////////////////////////\n\n const st = tr.AJAR_statement\n\n const constraintVar = tr.AJAR_inverse ? st.subject : st.object // this is only used for constraints\n let hasParent = true\n if (constraintVar.isBlank && constraint) {\n window.alert(\n 'You cannot constrain a query with a blank node. No constraint will be added.'\n )\n }\n if (!parentVar) {\n hasParent = false\n parentVar = inverse ? st.object : st.subject // if there is no parents, uses the sub/obj\n }\n // UI.log.debug('Initial variable: '+tr.AJAR_variable)\n const v = tr.AJAR_variable\n ? tr.AJAR_variable\n : store.variable(UI.utils.newVariableName())\n q.vars.push(v)\n v.label = hasParent ? parentVar.label : UI.utils.label(parentVar)\n v.label += ' ' + UI.utils.predicateLabelForXML(st.predicate, inverse)\n const pattern = makeRDFStatement(v, parentVar)\n // alert(pattern)\n v.label = v.label.slice(0, 1).toUpperCase() + v.label.slice(1) // init cap\n\n // See ../rdf/sparql.js\n // This should only work on literals but doesn't.\n function ConstraintEqualTo (value) {\n this.describe = function (varstr) {\n return varstr + ' = ' + value.toNT()\n }\n this.test = function (term) {\n return value.sameTerm(term)\n }\n return this\n }\n\n if (constraint) {\n // binds the constrained variable to its selected value\n pat.constraints[v] = new ConstraintEqualTo(constraintVar)\n }\n UI.log.info('Pattern: ' + pattern)\n pattern.tr = tr\n tr.AJAR_pattern = pattern // Cross-link UI and query line\n tr.AJAR_variable = v\n // UI.log.debug('Final variable: '+tr.AJAR_variable)\n UI.log.debug('Query pattern: ' + pattern)\n pat.statements.push(pattern)\n return v\n} // makeQueryRow\n\nfunction saveQuery (selection, qs) {\n // var qs = outline.qs // @@\n const q = new $rdf.Query()\n const n = selection.length\n let i, sel, st, tr\n for (i = 0; i < n; i++) {\n sel = selection[i]\n tr = sel.parentNode\n st = tr.AJAR_statement\n UI.log.debug('Statement ' + st)\n if (sel.getAttribute('class').indexOf('pred') >= 0) {\n UI.log.info(' We have a predicate')\n makeQueryRow(q, tr)\n }\n if (sel.getAttribute('class').indexOf('obj') >= 0) {\n UI.log.info(' We have an object')\n makeQueryRow(q, tr, true)\n }\n }\n qs.addQuery(q)\n\n function resetOutliner (pat) {\n const n = pat.statements.length\n let pattern, tr\n for (let i = 0; i < n; i++) {\n pattern = pat.statements[i]\n tr = pattern.tr\n // UI.log.debug('tr: ' + tr.AJAR_statement);\n if (typeof tr !== 'undefined') {\n tr.AJAR_pattern = null // TODO: is this == to whats in current version?\n tr.AJAR_variable = null\n }\n }\n for (const x in pat.optional) {\n resetOutliner(pat.optional[x])\n }\n }\n resetOutliner(q.pat)\n // NextVariable=0;\n return q\n} // saveQuery\n\n// When the user asks for all list of all matching parts of the data\n//\nexport function viewAndSaveQuery (outline, selection) {\n const qs = outline.qs\n UI.log.info('outline.doucment is now ' + outline.document.location)\n const q = saveQuery(selection, qs)\n /*\n if (tabulator.isExtension) {\n // tabulator.drawInBestView(q)\n } else\n */\n\n for (let i = 0; i < qs.listeners.length; i++) {\n qs.listeners[i].getActiveView().view.drawQuery(q)\n qs.listeners[i].updateQueryControls(qs.listeners[i].getActiveView())\n }\n}\n\n/**\n * The QuerySource object stores a set of listeners and a set of queries.\n * It keeps the listeners aware of those queries that the source currently\n * contains, and it is then up to the listeners to decide what to do with\n * those queries in terms of displays.\n * Not used 2010-08 -- TimBL\n * @class QuerySource\n * @author jambo\n */\n\nexport function QuerySource () {\n /**\n * stores all of the queries currently held by this source,\n * indexed by ID number.\n */\n this.queries = []\n /**\n * stores the listeners for a query object.\n * @see TabbedContainer\n */\n this.listeners = []\n\n /**\n * add a Query object to the query source--It will be given an ID number\n * and a name, if it doesn't already have one. This subsequently adds the\n * query to all of the listeners the QuerySource knows about.\n */\n this.addQuery = function (q) {\n let i\n if (q.name === null || q.name === '') {\n q.name = 'Query #' + (this.queries.length + 1)\n }\n q.id = this.queries.length\n this.queries.push(q)\n for (i = 0; i < this.listeners.length; i++) {\n if (this.listeners[i] !== null) {\n this.listeners[i].addQuery(q)\n }\n }\n }\n\n /**\n * Remove a Query object from the source. Tells all listeners to also\n * remove the query.\n */\n this.removeQuery = function (q) {\n let i\n for (i = 0; i < this.listeners.length; i++) {\n if (this.listeners[i] !== null) {\n this.listeners[i].removeQuery(q)\n }\n }\n if (this.queries[q.id] !== null) {\n delete this.queries[q.id]\n }\n }\n\n /**\n * adds a \"Listener\" to this QuerySource - that is, an object\n * which is capable of both adding and removing queries.\n * Currently, only the TabbedContainer class is added.\n * also puts all current queries into the listener to be used.\n */\n this.addListener = function (listener) {\n let i\n this.listeners.push(listener)\n for (i = 0; i < this.queries.length; i++) {\n if (this.queries[i] !== null) {\n listener.addQuery(this.queries[i])\n }\n }\n }\n /**\n * removes listener from the array of listeners, if it exists! Also takes\n * all of the queries from this source out of the listener.\n */\n this.removeListener = function (listener) {\n let i\n for (i = 0; i < this.queries.length; i++) {\n if (this.queries[i] !== null) {\n listener.removeQuery(this.queries[i])\n }\n }\n\n for (i = 0; i < this.listeners.length; i++) {\n if (this.listeners[i] === listener) {\n delete this.listeners[i]\n }\n }\n }\n}\n"],"mappings":";;;;;AAwNA,SAAgBA,IAAe;CAkE7B,AA7DA,KAAK,UAAU,CAAC,GAKhB,KAAK,YAAY,CAAC,GAOlB,KAAK,WAAW,SAAU,GAAG;EAC3B,IAAIC;EAMJ,MALIC,EAAE,SAAS,QAAQA,EAAE,SAAS,QAChC,EAAE,OAAO,aAAa,KAAK,QAAQ,SAAS,KAE9C,EAAE,KAAK,KAAK,QAAQ,QACpB,KAAK,QAAQ,KAAKA,CAAC,GACd,IAAI,GAAGD,IAAI,KAAK,UAAU,QAAQ,KACrC,AAAI,KAAK,UAAUA,OAAO,QACxB,KAAK,UAAUA,EAAE,CAAC,SAASC,CAAC;CAGlC,GAMA,KAAK,cAAc,SAAU,GAAG;EAC9B,IAAID,IACK;EAAT,OAAYA,IAAI,KAAK,UAAU,QAAQ,KACrC,AAAI,KAAK,UAAUA,OAAO,QACxB,KAAK,UAAUA,EAAE,CAAC,YAAYC,CAAC;EAGnC,AAAI,KAAK,QAAQA,EAAE,QAAQ,QACzB,OAAO,KAAK,QAAQA,EAAE;CAE1B,GAQA,KAAK,cAAc,SAAU,GAAU;EACrC,IAAID;EAEJ,KADA,KAAK,UAAU,KAAKE,CAAQ,GACvB,IAAI,GAAGF,IAAI,KAAK,QAAQ,QAAQ,KACnC,AAAI,KAAK,QAAQA,OAAO,QACtBE,EAAS,SAAS,KAAK,QAAQF,EAAE;CAGvC,GAKA,KAAK,iBAAiB,SAAU,GAAU;EACxC,IAAIA,IACK;EAAT,OAAYA,IAAI,KAAK,QAAQ,QAAQ,KACnC,AAAI,KAAK,QAAQA,OAAO,QACtBE,EAAS,YAAY,KAAK,QAAQF,EAAE;EAIxC,KAAK,IAAI,GAAGA,IAAI,KAAK,UAAU,QAAQ,KACrC,AAAI,KAAK,UAAUA,OAAOE,KACxB,OAAO,KAAK,UAAUF;CAG5B;AACF"}
1
+ {"version":3,"file":"queryByExample.esm.js","names":["QuerySource","i","q","listener"],"sources":["../../src/outline/queryByExample.js"],"sourcesContent":["/* istanbul ignore file */\n// The query-by-example functionality in the tabulator\n// was the ability to expore a bit of the web in outline mode,\n// select a ceratain set of fields in the tree,\n// then pres \"find all\" which would then generte a SPARQL query\n// to find all other places which had the same pattern.\n// Fields could be optional by pressing th ewhite optoional button\n\nimport { store } from 'solid-logic'\nimport * as UI from 'solid-ui'\nimport * as $rdf from 'rdflib'\n\nconst optionalSubqueriesIndex = []\n\nfunction predParentOf (node) {\n let n = node\n const isPredicateRow = (element) => {\n return Boolean(\n element &&\n typeof element.getAttribute === 'function' &&\n (element.getAttribute('predTR') === 'true' || element.getAttribute('data-outline-node') === 'predicate')\n )\n }\n while (true) {\n if (isPredicateRow(n)) {\n return n\n } else if (n.previousElementSibling) {\n n = n.previousElementSibling\n } else {\n console.log('Could not find predParent')\n return node\n }\n }\n}\n\nexport function makeQueryRow (q, tr, constraint) {\n // predtr = predParentOf(tr)\n // var nodes = tr.childNodes\n // var n = tr.childNodes.length\n const inverse = tr.AJAR_inverse\n // var hasVar = 0\n let parentVar, level, pat\n\n function makeRDFStatement (freeVar, parent) {\n if (inverse) {\n return new $rdf.Statement(freeVar, st.predicate, parent)\n } else {\n return new $rdf.Statement(parent, st.predicate, freeVar)\n }\n }\n\n let optionalSubqueryIndex = null\n\n for (level = tr.parentNode; level; level = level.parentNode) {\n if (typeof level.AJAR_statement !== 'undefined') {\n // level.AJAR_statement\n level.setAttribute('bla', level.AJAR_statement) // @@? -timbl\n // UI.log.debug(\"Parent TR statement=\"+level.AJAR_statement + \", var=\" + level.AJAR_variable)\n /* for(let c=0;c<level.parentNode.childNodes.length;c++) //This makes sure the same variable is used for a subject\n if(level.parentNode.childNodes[c].AJAR_variable)\n level.AJAR_variable = level.parentNode.childNodes[c].AJAR_variable; */\n if (!level.AJAR_variable) {\n makeQueryRow(q, level)\n }\n parentVar = level.AJAR_variable\n const predLevel = predParentOf(level)\n if (predLevel.getAttribute('optionalSubqueriesIndex')) {\n optionalSubqueryIndex = predLevel.getAttribute(\n 'optionalSubqueriesIndex'\n )\n pat = optionalSubqueriesIndex[optionalSubqueryIndex]\n }\n break\n }\n }\n\n if (!pat) {\n pat = q.pat\n }\n\n const predtr = predParentOf(tr)\n // /////OPTIONAL KLUDGE///////////\n const opt = predtr.getAttribute('optional')\n if (!opt) {\n if (optionalSubqueryIndex) {\n predtr.setAttribute('optionalSubqueriesIndex', optionalSubqueryIndex)\n } else {\n predtr.removeAttribute('optionalSubqueriesIndex')\n }\n }\n if (opt) {\n const optForm = store.formula()\n optionalSubqueriesIndex.push(optForm)\n predtr.setAttribute(\n 'optionalSubqueriesIndex',\n optionalSubqueriesIndex.length - 1\n )\n pat.optional.push(optForm)\n pat = optForm\n }\n\n // //////////////////////////////\n\n const st = tr.AJAR_statement\n\n const constraintVar = tr.AJAR_inverse ? st.subject : st.object // this is only used for constraints\n let hasParent = true\n if (constraintVar.isBlank && constraint) {\n window.alert(\n 'You cannot constrain a query with a blank node. No constraint will be added.'\n )\n }\n if (!parentVar) {\n hasParent = false\n parentVar = inverse ? st.object : st.subject // if there is no parents, uses the sub/obj\n }\n // UI.log.debug('Initial variable: '+tr.AJAR_variable)\n const v = tr.AJAR_variable\n ? tr.AJAR_variable\n : store.variable(UI.utils.newVariableName())\n q.vars.push(v)\n v.label = hasParent ? parentVar.label : UI.utils.label(parentVar)\n v.label += ' ' + UI.utils.predicateLabelForXML(st.predicate, inverse)\n const pattern = makeRDFStatement(v, parentVar)\n // alert(pattern)\n v.label = v.label.slice(0, 1).toUpperCase() + v.label.slice(1) // init cap\n\n // See ../rdf/sparql.js\n // This should only work on literals but doesn't.\n function ConstraintEqualTo (value) {\n this.describe = function (varstr) {\n return varstr + ' = ' + value.toNT()\n }\n this.test = function (term) {\n return value.sameTerm(term)\n }\n return this\n }\n\n if (constraint) {\n // binds the constrained variable to its selected value\n pat.constraints[v] = new ConstraintEqualTo(constraintVar)\n }\n UI.log.info('Pattern: ' + pattern)\n pattern.tr = tr\n tr.AJAR_pattern = pattern // Cross-link UI and query line\n tr.AJAR_variable = v\n // UI.log.debug('Final variable: '+tr.AJAR_variable)\n UI.log.debug('Query pattern: ' + pattern)\n pat.statements.push(pattern)\n return v\n} // makeQueryRow\n\nfunction saveQuery (selection, qs) {\n // var qs = outline.qs // @@\n const q = new $rdf.Query()\n const n = selection.length\n let i, sel, st, tr\n for (i = 0; i < n; i++) {\n sel = selection[i]\n tr = sel.parentNode\n st = tr.AJAR_statement\n UI.log.debug('Statement ' + st)\n if (sel.getAttribute('class').indexOf('pred') >= 0) {\n UI.log.info(' We have a predicate')\n makeQueryRow(q, tr)\n }\n if (sel.getAttribute('class').indexOf('obj') >= 0) {\n UI.log.info(' We have an object')\n makeQueryRow(q, tr, true)\n }\n }\n qs.addQuery(q)\n\n function resetOutliner (pat) {\n const n = pat.statements.length\n let pattern, tr\n for (let i = 0; i < n; i++) {\n pattern = pat.statements[i]\n tr = pattern.tr\n // UI.log.debug('tr: ' + tr.AJAR_statement);\n if (typeof tr !== 'undefined') {\n tr.AJAR_pattern = null // TODO: is this == to whats in current version?\n tr.AJAR_variable = null\n }\n }\n for (const x in pat.optional) {\n resetOutliner(pat.optional[x])\n }\n }\n resetOutliner(q.pat)\n // NextVariable=0;\n return q\n} // saveQuery\n\n// When the user asks for all list of all matching parts of the data\n//\nexport function viewAndSaveQuery (outline, selection) {\n const qs = outline.qs\n UI.log.info('outline.doucment is now ' + outline.document.location)\n const q = saveQuery(selection, qs)\n /*\n if (tabulator.isExtension) {\n // tabulator.drawInBestView(q)\n } else\n */\n\n for (let i = 0; i < qs.listeners.length; i++) {\n qs.listeners[i].getActiveView().view.drawQuery(q)\n qs.listeners[i].updateQueryControls(qs.listeners[i].getActiveView())\n }\n}\n\n/**\n * The QuerySource object stores a set of listeners and a set of queries.\n * It keeps the listeners aware of those queries that the source currently\n * contains, and it is then up to the listeners to decide what to do with\n * those queries in terms of displays.\n * Not used 2010-08 -- TimBL\n * @class QuerySource\n * @author jambo\n */\n\nexport function QuerySource () {\n /**\n * stores all of the queries currently held by this source,\n * indexed by ID number.\n */\n this.queries = []\n /**\n * stores the listeners for a query object.\n * @see TabbedContainer\n */\n this.listeners = []\n\n /**\n * add a Query object to the query source--It will be given an ID number\n * and a name, if it doesn't already have one. This subsequently adds the\n * query to all of the listeners the QuerySource knows about.\n */\n this.addQuery = function (q) {\n let i\n if (q.name === null || q.name === '') {\n q.name = 'Query #' + (this.queries.length + 1)\n }\n q.id = this.queries.length\n this.queries.push(q)\n for (i = 0; i < this.listeners.length; i++) {\n if (this.listeners[i] !== null) {\n this.listeners[i].addQuery(q)\n }\n }\n }\n\n /**\n * Remove a Query object from the source. Tells all listeners to also\n * remove the query.\n */\n this.removeQuery = function (q) {\n let i\n for (i = 0; i < this.listeners.length; i++) {\n if (this.listeners[i] !== null) {\n this.listeners[i].removeQuery(q)\n }\n }\n if (this.queries[q.id] !== null) {\n delete this.queries[q.id]\n }\n }\n\n /**\n * adds a \"Listener\" to this QuerySource - that is, an object\n * which is capable of both adding and removing queries.\n * Currently, only the TabbedContainer class is added.\n * also puts all current queries into the listener to be used.\n */\n this.addListener = function (listener) {\n let i\n this.listeners.push(listener)\n for (i = 0; i < this.queries.length; i++) {\n if (this.queries[i] !== null) {\n listener.addQuery(this.queries[i])\n }\n }\n }\n /**\n * removes listener from the array of listeners, if it exists! Also takes\n * all of the queries from this source out of the listener.\n */\n this.removeListener = function (listener) {\n let i\n for (i = 0; i < this.queries.length; i++) {\n if (this.queries[i] !== null) {\n listener.removeQuery(this.queries[i])\n }\n }\n\n for (i = 0; i < this.listeners.length; i++) {\n if (this.listeners[i] === listener) {\n delete this.listeners[i]\n }\n }\n }\n}\n"],"mappings":";;;;;AA+NA,SAAgBA,IAAe;CAkE7B,AA7DA,KAAK,UAAU,CAAC,GAKhB,KAAK,YAAY,CAAC,GAOlB,KAAK,WAAW,SAAU,GAAG;EAC3B,IAAIC;EAMJ,MALIC,EAAE,SAAS,QAAQA,EAAE,SAAS,QAChC,EAAE,OAAO,aAAa,KAAK,QAAQ,SAAS,KAE9C,EAAE,KAAK,KAAK,QAAQ,QACpB,KAAK,QAAQ,KAAKA,CAAC,GACd,IAAI,GAAGD,IAAI,KAAK,UAAU,QAAQ,KACrC,AAAI,KAAK,UAAUA,OAAO,QACxB,KAAK,UAAUA,EAAE,CAAC,SAASC,CAAC;CAGlC,GAMA,KAAK,cAAc,SAAU,GAAG;EAC9B,IAAID,IACK;EAAT,OAAYA,IAAI,KAAK,UAAU,QAAQ,KACrC,AAAI,KAAK,UAAUA,OAAO,QACxB,KAAK,UAAUA,EAAE,CAAC,YAAYC,CAAC;EAGnC,AAAI,KAAK,QAAQA,EAAE,QAAQ,QACzB,OAAO,KAAK,QAAQA,EAAE;CAE1B,GAQA,KAAK,cAAc,SAAU,GAAU;EACrC,IAAID;EAEJ,KADA,KAAK,UAAU,KAAKE,CAAQ,GACvB,IAAI,GAAGF,IAAI,KAAK,QAAQ,QAAQ,KACnC,AAAI,KAAK,QAAQA,OAAO,QACtBE,EAAS,SAAS,KAAK,QAAQF,EAAE;CAGvC,GAKA,KAAK,iBAAiB,SAAU,GAAU;EACxC,IAAIA,IACK;EAAT,OAAYA,IAAI,KAAK,QAAQ,QAAQ,KACnC,AAAI,KAAK,QAAQA,OAAO,QACtBE,EAAS,YAAY,KAAK,QAAQF,EAAE;EAIxC,KAAK,IAAI,GAAGA,IAAI,KAAK,UAAU,QAAQ,KACrC,AAAI,KAAK,UAAUA,OAAOE,KACxB,OAAO,KAAK,UAAUF;CAG5B;AACF"}
@@ -1,24 +1,24 @@
1
1
  const e=require("../_virtual/_rolldown/runtime.cjs.js");let t=require("solid-ui");t=e.__toESM(t);let n=require("solid-logic"),r=require("pane-registry");r=e.__toESM(r);let i=require("rdflib");i=e.__toESM(i);var a,o;function s(e){let c=e.document;this.menuId=`predicateMenu1`;let l=function(e){console.log(e+`
2
- `)},u=t.ns.rdf,d=i.Namespace(`http://purl.org/ontology/bibo/`),f=i.Namespace(`http://purl.org/dc/elements/1.1/`),p=!1;return a||(a=new i.Formula,a.superFormula=n.store),o||=new i.IndexedFormula,o.name=`TempFormula`,n.store.updater||(n.store.updater=new i.UpdateManager(n.store)),{sparqler:n.store.updater,lastModified:null,lastModifiedStat:null,statIsInverse:!1,addNewPredicateObject:function(r){if(t.utils.getTarget(r).className!==`bottom-border-active`)return;let a=e.UserInput,o=t.utils.getTarget(r),s=c.createElement(`tr`);t.utils.ancestor(o,`DIV`).insertBefore(s,t.utils.ancestor(o,`TR`));let l=c.createElement(`tr`),u=a.generateRequest(`(TBD)`,l,!0);s.appendChild(l.firstChild);let d=a.generateRequest(`(Enter text or drag an object onto this field)`,l,!1);if(s.appendChild(l.firstChild),t.utils.ancestor(o,`TR`).previousSibling&&t.utils.ancestor(o,`TR`).previousSibling.AJAR_statement){let e=t.utils.ancestor(o,`TR`).previousSibling.AJAR_statement;a.formUndetStat(s,e.subject,u,d,e.why,!1)}else{let e=t.utils.getAbout(n.store,t.utils.ancestor(o.parentNode.parentNode,`TD`)),r=n.store.sym(i.Util.uri.docpart(e.uri));a.formUndetStat(s,e,u,d,r,!1)}e.walk(`moveTo`,s.firstChild),t.log.info(`addNewPredicateObject: selection = `+e.getSelection().map(function(e){return e.textContent}).join(`, `)),this.startFillInText(e.getSelection()[0])},addNewObject:function(n){let r=t.utils.getTarget(n).parentNode.parentNode,i=r.parentNode.AJAR_inverse;this.lastModifiedStat=r.parentNode.AJAR_statement;let a=this.appendToPredicate(r),o=this.generateRequest(` (Error) `,a,!1),s=a.previousSibling.AJAR_statement;i?this.formUndetStat(a,o,s.predicate,s.object,s.why,!0):this.formUndetStat(a,s.subject,s.predicate,o,s.why,!1),e.walk(`moveTo`,a.lastChild),this.startFillInText(a.lastChild)},Delete:function(e){this.deleteTriple(e,!1)},Enter:function(e){this.literalModification(e)},Click:function(e){let n=t.utils.getTarget(e);t.utils.getTerm(n).termType===`Literal`&&(this.literalModification(n),e.preventDefault(),e.stopPropagation())},pasteFromClipboard:function(n,r){function i(n){let r=e.clipboard[n].shift();if(r===null)t.log.warn(`no more element in clipboard!`);else{switch(n){case`predicates`:case`objects`:{let t=e.clipboard.all;for(let e=0;;e++)if(r.sameTerm(t[e])){t.splice(e,1);break}break}case`all`:throw Error(`hostorical code not understood - what is theCollection?`)}return r}}let a;switch(r.className){case`undetermined selected`:if(a=r.nextSibling?i(`predicates`):i(`objects`),!a)return;break;case`pred selected`:if(a=i(`objects`),!a)return;break;case`selected`:{let e=i(`all`);if(!e)return;a=e[0],this.insertTermTo(r,a,e[1]);return}}this.insertTermTo(r,a)},startFillInText:function(e){switch(this.whatSortOfEditCell(e)){case`DatatypeProperty-like`:t.utils.emptyNode(e),this.lastModified=this.createInputBoxIn(e,` (Please Input) `),this.lastModified.isNew=!1,this.lastModified.select();break;case`predicate`:this.performAutoCompleteEdit(e,`PredicateAutoComplete`);break;case`ObjectProperty-like`:case`no-idea`:this.performAutoCompleteEdit(e,`GeneralAutoComplete`)}},literalModification:function(e){if(t.log.debug(`entering literal Modification with `+e+e.textContent),e.className.indexOf(` pendingedit`)!==-1)return t.log.warn(`The node you attempted to edit has a request still pending.
2
+ `)},u=t.ns.rdf,d=i.Namespace(`http://purl.org/ontology/bibo/`),f=i.Namespace(`http://purl.org/dc/elements/1.1/`),p=!1;function m(e){let n=e;for(;n&&n!==c;){if(n.AJAR_statement)return n;n=n.parentNode}return t.utils.ancestor(e,`DIV`)||t.utils.ancestor(e,`TR`)}function h(e){return m(e)?.parentNode||t.utils.ancestor(e,`TABLE`)}return a||(a=new i.Formula,a.superFormula=n.store),o||=new i.IndexedFormula,o.name=`TempFormula`,n.store.updater||(n.store.updater=new i.UpdateManager(n.store)),{sparqler:n.store.updater,lastModified:null,lastModifiedStat:null,statIsInverse:!1,addNewPredicateObject:function(r){if(t.utils.getTarget(r).className!==`bottom-border-active`)return;let a=e.UserInput,o=t.utils.getTarget(r),s=c.createElement(`div`),l=m(o),u=h(o);u.insertBefore(s,l);let d=c.createElement(`div`),f=a.generateRequest(`(TBD)`,d,!0);s.appendChild(d.firstChild);let p=a.generateRequest(`(Enter text or drag an object onto this field)`,d,!1);if(s.appendChild(d.firstChild),l.previousSibling&&l.previousSibling.AJAR_statement){let e=l.previousSibling.AJAR_statement;a.formUndetStat(s,e.subject,f,p,e.why,!1)}else{let e=t.utils.getAbout(n.store,u.parentNode),r=n.store.sym(i.Util.uri.docpart(e.uri));a.formUndetStat(s,e,f,p,r,!1)}e.walk(`moveTo`,s.firstChild),t.log.info(`addNewPredicateObject: selection = `+e.getSelection().map(function(e){return e.textContent}).join(`, `)),this.startFillInText(e.getSelection()[0])},addNewObject:function(n){let r=t.utils.getTarget(n).parentNode.parentNode,i=r.parentNode.AJAR_inverse;this.lastModifiedStat=r.parentNode.AJAR_statement;let a=this.appendToPredicate(r),o=this.generateRequest(` (Error) `,a,!1),s=a.previousSibling.AJAR_statement;i?this.formUndetStat(a,o,s.predicate,s.object,s.why,!0):this.formUndetStat(a,s.subject,s.predicate,o,s.why,!1),e.walk(`moveTo`,a.lastChild),this.startFillInText(a.lastChild)},Delete:function(e){this.deleteTriple(e,!1)},Enter:function(e){this.literalModification(e)},Click:function(e){let n=t.utils.getTarget(e);t.utils.getTerm(n).termType===`Literal`&&(this.literalModification(n),e.preventDefault(),e.stopPropagation())},pasteFromClipboard:function(n,r){function i(n){let r=e.clipboard[n].shift();if(r===null)t.log.warn(`no more element in clipboard!`);else{switch(n){case`predicates`:case`objects`:{let t=e.clipboard.all;for(let e=0;;e++)if(r.sameTerm(t[e])){t.splice(e,1);break}break}case`all`:throw Error(`hostorical code not understood - what is theCollection?`)}return r}}let a;switch(r.className){case`undetermined selected`:if(a=r.nextSibling?i(`predicates`):i(`objects`),!a)return;break;case`pred selected`:if(a=i(`objects`),!a)return;break;case`selected`:{let e=i(`all`);if(!e)return;a=e[0],this.insertTermTo(r,a,e[1]);return}}this.insertTermTo(r,a)},startFillInText:function(e){switch(this.whatSortOfEditCell(e)){case`DatatypeProperty-like`:t.utils.emptyNode(e),this.lastModified=this.createInputBoxIn(e,` (Please Input) `),this.lastModified.isNew=!1,this.lastModified.select();break;case`predicate`:this.performAutoCompleteEdit(e,`PredicateAutoComplete`);break;case`ObjectProperty-like`:case`no-idea`:this.performAutoCompleteEdit(e,`GeneralAutoComplete`)}},literalModification:function(e){if(t.log.debug(`entering literal Modification with `+e+e.textContent),e.className.indexOf(` pendingedit`)!==-1)return t.log.warn(`The node you attempted to edit has a request still pending.
3
3
  Please wait for the request to finish (the text will turn black)
4
- before editing this node again.`),!0;let r=e;if(!this.getStatementAbout(r))return;let i,a;try{i=t.utils.getTerm(r),a=t.utils.ancestor(r,`TR`)}catch(i){t.log.warn(`userinput.js: `+i+t.utils.getAbout(n.store,e)),t.log.error(r+` getStatement Error:`+i)}let o;try{o=a.lastChild}catch(e){t.log.error(e+`@`+r)}if(i.termType===`Literal`){if(o.removeChild(o.firstChild),i.value.match(`
5
- `)){let e=c.createElement(`textarea`);e.appendChild(c.createTextNode(i.value)),e.setAttribute(`rows`,(i.value.match(/\n/g).length+1).toString()),e.setAttribute(`cols`,`100`),e.setAttribute(`class`,`textinput`),o.appendChild(e),this.lastModified=e}else this.lastModified=this.createInputBoxIn(o,i.value);this.lastModified.isNew=!1,this.lastModified.select()}return!0},performAutoCompleteEdit:function(e,n){t.utils.emptyNode(e),l(`perform AutoCompleteEdit. THIS IS=`+this),this.lastModified=this.createInputBoxIn(e,``),this.lastModified.select(),this.lastModified.addEventListener(`keypress`,this.getAutoCompleteHandler(n),!1),this.getAutoCompleteHandler(n)(1)},backOut:function(){this.deleteTriple(this.lastModified.parentNode,!0),this.lastModified=null},clearMenu:function(){let e=c.getElementById(this.menuID);e&&e.parentNode.removeChild(e)},clearInputAndSave:function(a){let o;if(!this.lastModified)return;if(!this.lastModified.isNew)try{o=this.getStatementAbout(this.lastModified).object}catch{return}let s=this.lastModifiedStat,c,l,d,f;if(this.lastModified.value!==this.lastModified.defaultValue){let l;if(this.lastModified.value===``){this.lastModified.value=this.lastModified.defaultValue,this.clearInputAndSave();return}if(this.lastModified.isNew){s=new i.Statement(s.subject,s.predicate,n.store.literal(this.lastModified.value),s.why),c=this.views.defaults[s.predicate.uri],l=t.utils.ancestor(this.lastModified,`TR`);try{n.store.updater.update([],[s],function(n,r,i){r||(t.log.error(`Error occurs while inserting `+s+`
4
+ before editing this node again.`),!0;let r=e;if(!this.getStatementAbout(r))return;let i,a;try{i=t.utils.getTerm(r),a=m(r)}catch(i){t.log.warn(`userinput.js: `+i+t.utils.getAbout(n.store,e)),t.log.error(r+` getStatement Error:`+i)}let o;try{o=a.lastChild}catch(e){t.log.error(e+`@`+r)}if(i.termType===`Literal`){if(o.removeChild(o.firstChild),i.value.match(`
5
+ `)){let e=c.createElement(`textarea`);e.appendChild(c.createTextNode(i.value)),e.setAttribute(`rows`,(i.value.match(/\n/g).length+1).toString()),e.setAttribute(`cols`,`100`),e.setAttribute(`class`,`textinput`),o.appendChild(e),this.lastModified=e}else this.lastModified=this.createInputBoxIn(o,i.value);this.lastModified.isNew=!1,this.lastModified.select()}return!0},performAutoCompleteEdit:function(e,n){t.utils.emptyNode(e),l(`perform AutoCompleteEdit. THIS IS=`+this),this.lastModified=this.createInputBoxIn(e,``),this.lastModified.select(),this.lastModified.addEventListener(`keypress`,this.getAutoCompleteHandler(n),!1),this.getAutoCompleteHandler(n)(1)},backOut:function(){this.deleteTriple(this.lastModified.parentNode,!0),this.lastModified=null},clearMenu:function(){let e=c.getElementById(this.menuID);e&&e.parentNode.removeChild(e)},clearInputAndSave:function(a){let o;if(!this.lastModified)return;if(!this.lastModified.isNew)try{o=this.getStatementAbout(this.lastModified).object}catch{return}let s=this.lastModifiedStat,c,l,d,f;if(this.lastModified.value!==this.lastModified.defaultValue){let l;if(this.lastModified.value===``){this.lastModified.value=this.lastModified.defaultValue,this.clearInputAndSave();return}if(this.lastModified.isNew){s=new i.Statement(s.subject,s.predicate,n.store.literal(this.lastModified.value),s.why),c=this.views.defaults[s.predicate.uri],l=m(this.lastModified);try{n.store.updater.update([],[s],function(n,r,i){r||(t.log.error(`Error occurs while inserting `+s+`
6
6
 
7
7
  `+i+`
8
8
  `),e.UserInput.deleteTriple(l.lastChild,!0))})}catch(e){t.log.error(`Error inserting fact `+s+`:
9
9
  `+e+`
10
- `);return}s=n.store.add(s.subject,s.predicate,n.store.literal(this.lastModified.value),s.why)}else{if(this.statIsInverse){t.log.error(`Invalid Input: a literal can't be a subject in RDF/XML`),this.backOut();return}let c,d,f;switch(o.termType){case`Literal`:{let e=this.lastModified.value;l=t.utils.ancestor(this.lastModified,`TR`);let r=this.lastModified.defaultValue;d=i.st(s.subject,s.predicate,n.store.literal(this.lastModified.value),s.why);try{n.store.updater.update([s],[d],function(n,i,a){i?o.value=e:(t.log.warn(`Error occurs while editing `+s+`
10
+ `);return}s=n.store.add(s.subject,s.predicate,n.store.literal(this.lastModified.value),s.why)}else{if(this.statIsInverse){t.log.error(`Invalid Input: a literal can't be a subject in RDF/XML`),this.backOut();return}let c,d,f;switch(o.termType){case`Literal`:{let e=this.lastModified.value;l=m(this.lastModified);let r=this.lastModified.defaultValue;d=i.st(s.subject,s.predicate,n.store.literal(this.lastModified.value),s.why);try{n.store.updater.update([s],[d],function(n,i,a){i?o.value=e:(t.log.warn(`Error occurs while editing `+s+`
11
11
 
12
12
  `+a),l.lastChild.textContent=r),l.lastChild.className=l.lastChild.className.replace(/ pendingedit/g,``)})}catch(e){t.log.warn(`Error occurs while editing `+s+`:
13
- `+e);return}break}case`BlankNode`:{let o=n.store.literal(this.lastModified.value,``);if(s.predicate.termType===`Collection`){let p=s.predicate.elements[0];if(n.store.any(void 0,p,o)){if(!a){let e=this.lastModified.parentNode;a={},a.pageX=t.utils.findPos(e)[0],a.pageY=t.utils.findPos(e)[1]+e.clientHeight}this.showMenu(a,`DidYouMeanDialog`,void 0,{dialogTerm:n.store.any(void 0,p,o),bnodeTerm:s.subject})}else{c=t.utils.ancestor(t.utils.ancestor(this.lastModified,`TR`).parentNode,`TR`).AJAR_statement,d=i.st(s.subject,p,o,s.why);let r=n.store.the(s.subject,u(`type`));f=n.store.anyStatementMatching(s.subject,u(`type`),r,s.why),l=t.utils.ancestor(t.utils.ancestor(this.lastModified,`TR`),`TD`).parentNode;try{n.store.updater.update([],[c,d,f],function(t,n,r){n||(console.log(`Error occurs while editing `+c+`
13
+ `+e);return}break}case`BlankNode`:{let o=n.store.literal(this.lastModified.value,``);if(s.predicate.termType===`Collection`){let p=s.predicate.elements[0];if(n.store.any(void 0,p,o)){if(!a){let e=this.lastModified.parentNode;a={},a.pageX=t.utils.findPos(e)[0],a.pageY=t.utils.findPos(e)[1]+e.clientHeight}this.showMenu(a,`DidYouMeanDialog`,void 0,{dialogTerm:n.store.any(void 0,p,o),bnodeTerm:s.subject})}else{c=m(this.lastModified).AJAR_statement,d=i.st(s.subject,p,o,s.why);let t=n.store.the(s.subject,u(`type`));f=n.store.anyStatementMatching(s.subject,u(`type`),t,s.why),l=m(this.lastModified).parentNode;try{n.store.updater.update([],[c,d,f],function(t,n,r){n||(console.log(`Error occurs while editing `+c+`
14
14
 
15
15
  `+r),e.UserInput.deleteTriple(l.lastChild,!0))})}catch(e){console.log(`Error occurs while editing `+c+`:
16
- `+e);return}n.store.remove(s),n.store.add(s.subject,p,o,s.why)}let m=t.utils.ancestor(this.lastModified.parentNode.parentNode,`TD`),h=r.byName(`default`);e.outlineExpand(m,s.subject,{pane:h,already:!0}),e.walk(`right`,e.focusTd)}else{this.fillInRequest(`object`,this.lastModified.parentNode,n.store.literal(this.lastModified.value));return}break}}}}else if(this.lastModified.isNew){l=t.utils.ancestor(this.lastModified,`TR`),d=this.generateRequest(`(To be determined. Re-type of drag an object onto this field)`),f=l.previousSibling.AJAR_statement,this.formUndetStat(l,f.subject,f.predicate,d,f.why,!1),this.lastModified=null;return}else if(s.predicate.termType===`Collection`){n.store.removeMany(s.subject);let r=t.utils.ancestor(t.utils.ancestor(this.lastModified,`TR`).parentNode,`TR`);f=r.AJAR_statement,d=this.generateRequest(`(To be determined. Re-type of drag an object onto this field)`),this.formUndetStat(r,f.subject,f.predicate,d,f.why,!1),e.replaceTD(e.outlineObjectTD(d,c),r.lastChild),this.lastModified=null;return}else if(this.statIsInverse){if(s.subject.termType===`BlankNode`){this.backOut();return}}else if(s.object.termType===`BlankNode`){this.backOut();return}l=t.utils.ancestor(this.lastModified,`TR`),this.statIsInverse?e.replaceTD(e.outlineObjectTD(s.subject,c),l.lastChild):e.replaceTD(e.outlineObjectTD(n.store.literal(this.lastModified.value),c),l.lastChild),this.lastModified.value!==this.lastModified.defaultValue&&(l.lastChild.className+=` pendingedit`),this.lastModified=null},deleteTriple:function(r,i){if(t.log.debug(`deleteTriple entered`),!i&&r.className.indexOf(` pendingedit`)!==-1){console.log(`The node you attempted to edit has a request still pending.
16
+ `+e);return}n.store.remove(s),n.store.add(s.subject,p,o,s.why)}let g=h(this.lastModified).parentNode,_=r.byName(`default`);e.outlineExpand(g,s.subject,{pane:_,already:!0}),e.walk(`right`,e.focusTd)}else{this.fillInRequest(`object`,this.lastModified.parentNode,n.store.literal(this.lastModified.value));return}break}}}}else if(this.lastModified.isNew){l=m(this.lastModified),d=this.generateRequest(`(To be determined. Re-type of drag an object onto this field)`),f=l.previousSibling.AJAR_statement,this.formUndetStat(l,f.subject,f.predicate,d,f.why,!1),this.lastModified=null;return}else if(s.predicate.termType===`Collection`){n.store.removeMany(s.subject);let t=m(this.lastModified);f=t.AJAR_statement,d=this.generateRequest(`(To be determined. Re-type of drag an object onto this field)`),this.formUndetStat(t,f.subject,f.predicate,d,f.why,!1),e.replaceTD(e.outlineObjectTD(d,c),t.lastChild),this.lastModified=null;return}else if(this.statIsInverse){if(s.subject.termType===`BlankNode`){this.backOut();return}}else if(s.object.termType===`BlankNode`){this.backOut();return}l=m(this.lastModified),this.statIsInverse?e.replaceTD(e.outlineObjectTD(s.subject,c),l.lastChild):e.replaceTD(e.outlineObjectTD(n.store.literal(this.lastModified.value),c),l.lastChild),this.lastModified.value!==this.lastModified.defaultValue&&(l.lastChild.className+=` pendingedit`),this.lastModified=null},deleteTriple:function(r,i){if(t.log.debug(`deleteTriple entered`),!i&&r.className.indexOf(` pendingedit`)!==-1){console.log(`The node you attempted to edit has a request still pending.
17
17
  Please wait for the request to finish (the text will turn black)
18
18
  before editing this node again.`),e.walk(`up`);return}let a=this.getStatementAbout(r);if(!i&&!n.store.whether(a.object,u(`type`),t.ns.link(`Request`))&&!n.store.whether(a.predicate,u(`type`),t.ns.link(`Request`))&&!n.store.whether(a.subject,u(`type`),t.ns.link(`Request`))){t.log.debug(`about to send SPARQLUpdate`);try{n.store.updater.update([a],[],function(e,t,n){t?s():(console.log(`Error occurs while deleting `+a+`
19
19
 
20
20
  `+n),r.className=r.className.replace(/ pendingedit/g,``))}),r.className+=` pendingedit`}catch(e){t.log.error(e),t.log.warn(`Error deleting statement `+a+`:
21
- `+e);return}t.log.debug(`SPARQLUpdate sent`)}t.log.debug(`about to remove `+a),t.log.debug(`removed`),e.walk(`up`);let o=r.parentNode;function s(){let e;for(e=o;e.childNodes.length===1;e=e.previousSibling);let t;if(e===o){let n=e.nextSibling;n.nextSibling&&n.childNodes.length===1&&(t=e.firstChild,t.setAttribute(`rowspan`,parseInt(t.getAttribute(`rowspan`))-1),n.insertBefore(e.firstChild,n.firstChild)),o.parentNode.removeChild(o)}else t=e.firstChild,t.setAttribute(`rowspan`,parseInt(t.getAttribute(`rowspan`))-1),o.parentNode.removeChild(o)}i&&s()},clipboardInit:function(){e.clipboard={},e.clipboard.objects=[],e.clipboard.predicates=[],e.clipboard.all=[]},copyToClipboard:function(n,r){let i=t.utils.getTerm(r);switch(r.className){case`selected`:case`obj selected`:e.clipboard.objects.unshift(i);break;case`pred selected`:case`pred internal selected`:e.clipboard.predicates.unshift(i)}e.clipboard.all.unshift(i)},insertTermTo:function(r,i,o){let s,l;switch(r.className){case`undetermined selected`:s=this.views.defaults[r.parentNode.AJAR_statement.predicate.uri],this.fillInRequest(r.nextSibling?`predicate`:`object`,r,i);break;case`pred selected`:{let o=this.appendToPredicate(r);l=r.parentNode.AJAR_statement,s=this.views.defaults[l.predicate.uri],o.appendChild(e.outlineObjectTD(i,s));let c=r.parentNode.AJAR_inverse;c?o.AJAR_statemnet=n.store.add(i,l.predicate,l.object,l.why):o.AJAR_statement=n.store.add(l.subject,l.predicate,i,l.why);try{n.store.updater.update([],[o.AJAR_statement],function(e,n,r){n||t.log.error(`userinput.js (pred selected): Fail trying to insert statement `+o.AJAR_statement+`: `+r)})}catch(e){t.log.error(`Exception trying to insert statement `+o.AJAR_statement+`: `+t.utils.stackString(e));return}o.AJAR_inverse=c,a.statements.push(o.AJAR_statement);break}case`selected`:{let n=t.utils.ancestor(r,`TABLE`).lastChild,a=n.insertBefore(c.createElement(`tr`),n.lastChild);if(l=a.previousSibling.AJAR_statement,o===void 0&&(o=!0),o)this.formUndetStat(a,l.subject,this.generateRequest(`(TBD)`,a,!0),i,l.why,!1),a.appendChild(e.outlineObjectTD(i)),e.walk(`moveTo`,a.firstChild),this.startFillInText(a.firstChild);else{let t=this.generateRequest(`(To be determined. Re-type of drag an object onto this field)`,a);this.formUndetStat(a,l.subject,i,t,l.why,!1),a.insertBefore(e.outlinePredicateTD(i,a,!1,!1),a.firstChild),e.walk(`moveTo`,a.lastChild),this.startFillInText(a.lastChild)}break}}},Refill:function(e,r){t.log.info(`Refill`+r.textContent);let a=r.nextSibling,o;if(a){let s,c,l;if(r.nextSibling.className===`undetermined`)s=t.utils.getAbout(n.store,t.utils.ancestor(r,`TABLE`).parentNode),c=n.store.any(s,u(`type`)),l=[],l[0]=`SELECT ?pred WHERE{
21
+ `+e);return}t.log.debug(`SPARQLUpdate sent`)}t.log.debug(`about to remove `+a),t.log.debug(`removed`),e.walk(`up`);let o=r.parentNode;function s(){let e;for(e=o;e.childNodes.length===1;e=e.previousSibling);let t;if(e===o){let n=e.nextSibling;n.nextSibling&&n.childNodes.length===1&&(t=e.firstChild,t.setAttribute(`rowspan`,parseInt(t.getAttribute(`rowspan`))-1),n.insertBefore(e.firstChild,n.firstChild)),o.parentNode.removeChild(o)}else t=e.firstChild,t.setAttribute(`rowspan`,parseInt(t.getAttribute(`rowspan`))-1),o.parentNode.removeChild(o)}i&&s()},clipboardInit:function(){e.clipboard={},e.clipboard.objects=[],e.clipboard.predicates=[],e.clipboard.all=[]},copyToClipboard:function(n,r){let i=t.utils.getTerm(r);switch(r.className){case`selected`:case`obj selected`:e.clipboard.objects.unshift(i);break;case`pred selected`:case`pred internal selected`:e.clipboard.predicates.unshift(i)}e.clipboard.all.unshift(i)},insertTermTo:function(r,i,o){let s,l;switch(r.className){case`undetermined selected`:s=this.views.defaults[r.parentNode.AJAR_statement.predicate.uri],this.fillInRequest(r.nextSibling?`predicate`:`object`,r,i);break;case`pred selected`:{let o=this.appendToPredicate(r);l=r.parentNode.AJAR_statement,s=this.views.defaults[l.predicate.uri],o.appendChild(e.outlineObjectTD(i,s));let c=r.parentNode.AJAR_inverse;c?o.AJAR_statemnet=n.store.add(i,l.predicate,l.object,l.why):o.AJAR_statement=n.store.add(l.subject,l.predicate,i,l.why);try{n.store.updater.update([],[o.AJAR_statement],function(e,n,r){n||t.log.error(`userinput.js (pred selected): Fail trying to insert statement `+o.AJAR_statement+`: `+r)})}catch(e){t.log.error(`Exception trying to insert statement `+o.AJAR_statement+`: `+t.utils.stackString(e));return}o.AJAR_inverse=c,a.statements.push(o.AJAR_statement);break}case`selected`:{let t=h(r),n=t.insertBefore(c.createElement(`div`),t.lastChild);if(l=n.previousSibling.AJAR_statement,o===void 0&&(o=!0),o)this.formUndetStat(n,l.subject,this.generateRequest(`(TBD)`,n,!0),i,l.why,!1),n.appendChild(e.outlineObjectTD(i)),e.walk(`moveTo`,n.firstChild),this.startFillInText(n.firstChild);else{let t=this.generateRequest(`(To be determined. Re-type of drag an object onto this field)`,n);this.formUndetStat(n,l.subject,i,t,l.why,!1),n.insertBefore(e.outlinePredicateTD(i,n,!1,!1),n.firstChild),e.walk(`moveTo`,n.lastChild),this.startFillInText(n.lastChild)}break}}},Refill:function(e,r){t.log.info(`Refill`+r.textContent);let a=r.nextSibling,o;if(a){let s,c,l;if(r.nextSibling.className===`undetermined`)s=t.utils.getAbout(n.store,h(r).parentNode),c=n.store.any(s,u(`type`)),l=[],l[0]=`SELECT ?pred WHERE{
22
22
  ?pred `+u(`type`)+u(`Property`)+`.
23
23
  ?pred `+t.ns.rdfs(`domain`)+c+`.}`,l[1]=`SELECT ?pred ?class
24
24
  WHERE{
@@ -28,7 +28,7 @@ WHERE{
28
28
  }`,l[2]=`SELECT ?pred WHERE{
29
29
  `+s+u(`type`)+n.store.variable(`subjectClass`)+`.
30
30
  `+n.store.variable(`pred`)+t.ns.rdfs(`domain`)+n.store.variable(`subjectClass`)+`.
31
- }`,o=l.map(i.SPARQLToQuery);else{s=t.utils.getAbout(n.store,t.utils.ancestor(r,`TABLE`).parentNode),c=n.store.any(s,u(`type`));let e=r.parentNode.AJAR_statement.object;l=`SELECT ?pred WHERE{`+s+u(`type`)+`?subjectClass.
31
+ }`,o=l.map(i.SPARQLToQuery);else{s=t.utils.getAbout(n.store,h(r).parentNode),c=n.store.any(s,u(`type`));let e=r.parentNode.AJAR_statement.object;l=`SELECT ?pred WHERE{`+s+u(`type`)+`?subjectClass.
32
32
  `+e+u(`type`)+`?objectClass.
33
33
  ?pred `+t.ns.rdfs(`domain`)+`?subjectClass.
34
34
  ?pred `+t.ns.rdfs(`range`)+`?objectClass.
@@ -38,7 +38,7 @@ WHERE{
38
38
  `)}if(r===`all`?(l(`generalAC after switch, newText=`+f+`mode is all`),e.UserInput.clearMenu(),e.UserInput.showMenu(o,`GeneralAutoComplete`,void 0,{inputText:f,selectedTd:s}),f.length===0&&e.UserInput.WildCardButtons()):r===`predicate`?(l(`predicateAC after switch, newText=`+f+`mode is predicate`),e.UserInput.clearMenu(),e.UserInput.showMenu(o,`PredicateAutoComplete`,void 0,{inputText:f,isPredicate:!0,selectedTd:s})):r===`JournalTAC`&&(l(`JouralTAC after switch, newText=`+f),e.UserInput.clearMenu(),e.UserInput.showMenu(o,`JournalTitleAutoComplete`,void 0,{inputText:f},`orderisuseless`)),u=c.getElementById(e.UserInput.menuID),!u){l(`No menu element. Do not show menu.`);return}return l(`at end of handler
39
39
  ^^^^^^^^^^^^^^^^^
40
40
 
41
- `),d(u.firstChild.firstChild),e.showURI(t.utils.getAbout(n.store,u.lastHighlight)),`nothing to return`}}},WildCardButtons:function(){let n=c.getElementById(e.UserInput.menuID),r=n.insertBefore(c.createElement(`div`),n.firstChild),i=r.appendChild(c.createElement(`input`)),a=r.appendChild(c.createElement(`input`));i.type=`button`,i.value=`New...`,a.type=`button`,a.value=`Know its URI`;function o(n){let r=c.getElementById(e.UserInput.menuID);r.lastHighlight&&(r.lastHighlight.className=``),r.lastHighlight=t.utils.ancestor(t.utils.getTarget(n),`INPUT`),r.lastHighlight&&(r.lastHighlight.className=`activeItem`)}r.addEventListener(`mouseover`,o,!1),i.addEventListener(`click`,this.createNew,!1),a.addEventListener(`click`,this.inputURI,!1)},Keypress:function(t){if(t.keyCode===13){if(e.targetOf(t).tagName!==`TEXTAREA`)this.clearInputAndSave();else{let e=parseInt(this.lastModified.getAttribute(`rows`));this.lastModified.setAttribute(`rows`,(e+1).toString()),t.stopPropagation()}}},Mousedown:function(e){l(`MOUSING DOWN`),window.addEventListener(`keypress`,function(e){e.ctrlKey&&(e.charCode===115||e.charCode===113)&&s.switchMode()},!1),window.addEventListener(`mousedown`,s.Mousedown,!1);let t=document.getElementById(`OutlineView`);t&&(t.oncontextmenu=function(){return!1}),e.button===2&&(s.switchMode(),e&&(e.preventDefault(),e.stopPropagation()))},Mouseover:function(e){if(this.className=`bottom-border-active`,this._tabulatorMode===1)switch(t.utils.getTarget(e).tagName){case`TD`:{let n=t.utils.getTarget(e);n.className===`pred`&&(n.style.cursor=`copy`);break}case`DIV`:{let n=t.utils.getTarget(e);t.utils.getTarget(e).className===`bottom-border`&&(n.style.borderColor=`rgb(100%,65%,0%)`,n.style.cursor=`copy`);break}}},Mouseout:function(e){if(this.className=`bottom-border`,this._tabulatorMode===1){let n=t.utils.getTarget(e);t.utils.getTarget(e).className===`bottom-border`&&(n.style.borderColor=`transparent`,n.style.cursor=`auto`)}},whatSortOfEditCell:function(e){if(e.nextSibling)return`predicate`;let r=this.getStatementAbout(e).predicate;return n.store.whether(r,t.ns.rdf(`type`),t.ns.owl(`DatatypeProperty`))||n.store.whether(r,t.ns.rdfs(`range`),t.ns.rdfs(`Literal`))||r.termType===`Collection`?`DatatypeProperty-like`:n.store.whether(r,u(`type`),t.ns.owl(`ObjectProperty`))?`ObjectProperty-like`:`no-idea`},getStatementAbout:function(e){let n=t.utils.ancestor(e,`TR`);if(!n)throw Error(`No ancestor TR for the TD we clicked on:`+e);let r;try{r=n.AJAR_statement}catch{throw Error(`No AJAR_statement!`+e+e.textContent+` has ancestor `+n)}return this.lastModifiedStat=n.AJAR_statement,this.statIsInverse=n.AJAR_inverse,r},createInputBoxIn:function(n,r){function i(t){(t.keyCode===38||t.keyCode===40)&&(e.OutlinerKeypressPanel(t),e.UserInput.clearInputAndSave())}t.log.info(`myDocument in createInputBoxIn is now `+c.location),t.log.info(`outline.document is now `+e.document.location);let a=c.createElement(`input`);return a.setAttribute(`value`,r),a.setAttribute(`class`,`textinput`),n.className!==`undetermined selected`&&(a.setAttribute(`size`,`100`),a.addEventListener(`keypress`,i,!1)),n.appendChild(a),a},createNew:function(t){e.UserInput.clearMenu();let r=e.getSelection()[0],i=r.parentNode.AJAR_statement.why,a=n.store.nextSymbol(i);e.UserInput.fillInRequest(`object`,r,a),e.outlineExpand(e.getSelection()[0],a)},inputURI:function(r){let i=e.UserInput;i.clearMenu();let a=e.getSelection()[0];t.utils.emptyNode(a);let o=` (Type a URI) `;i.lastModified=i.createInputBoxIn(a,o),i.lastModified.select();function s(e){switch(e.stopPropagation(),e.keyCode){case 13:case 9:if(this.value!==o){let e=this.value;i.fillInRequest(`object`,a,n.store.sym(e))}}}i.lastModified.addEventListener(`keypress`,s,!1)},appendToPredicate:function(e){let t=!1,n;try{for(n=e.parentNode.nextSibling;n.childNodes.length===1&&n.AJAR_statement;n=n.nextSibling);}catch{t=!0}let r=c.createElement(`tr`);if(r.style.colspan=`1`,r.style.display=`block`,r.style.display=``,e.hasAttribute(`rowspan`)&&e.setAttribute(`rowspan`,parseInt(e.getAttribute(`rowspan`))+1),e.hasAttribute(`rowspan`)||e.setAttribute(`rowspan`,`2`),!t)n.parentNode.insertBefore(r,n);else{let t=e.parentNode.parentNode;t.className===`defaultPane`?t.insertBefore(r,t.lastChild):t.appendChild(r)}return r},bnode2symbol:function(e,t){n.store.copyTo(e,t,[`two-direction`,`delete`])},generateRequest:function(n,r,i,a){let s;a||(s=r||t.utils.ancestor(this.lastModified,`TR`),t.utils.emptyNode(s));let c=o,l=c.bnode();if(c.add(l,t.ns.rdf(`type`),t.ns.link(`Request`)),n.length,c.add(l,t.ns.link(`message`),c.literal(n)),c.add(l,t.ns.link(`to`),c.literal(`The User`)),c.add(l,t.ns.link(`from`),c.literal(`The User`)),!a){let t;t=i?s.appendChild(e.outlinePredicateTD(l,s,!1,!1)):s.appendChild(e.outlineObjectTD(l)),t.className=`undetermined`,t.textContent=n}return l},showMenu:function(r,a,o,s,p){t.log.info(`myDocument is now `+c.location),t.log.info(`outline.doucment is now `+e.document.location);let m=this,h=c.createElement(`div`);if(l(`
41
+ `),d(u.firstChild.firstChild),e.showURI(t.utils.getAbout(n.store,u.lastHighlight)),`nothing to return`}}},WildCardButtons:function(){let n=c.getElementById(e.UserInput.menuID),r=n.insertBefore(c.createElement(`div`),n.firstChild),i=r.appendChild(c.createElement(`input`)),a=r.appendChild(c.createElement(`input`));i.type=`button`,i.value=`New...`,a.type=`button`,a.value=`Know its URI`;function o(n){let r=c.getElementById(e.UserInput.menuID);r.lastHighlight&&(r.lastHighlight.className=``),r.lastHighlight=t.utils.ancestor(t.utils.getTarget(n),`INPUT`),r.lastHighlight&&(r.lastHighlight.className=`activeItem`)}r.addEventListener(`mouseover`,o,!1),i.addEventListener(`click`,this.createNew,!1),a.addEventListener(`click`,this.inputURI,!1)},Keypress:function(t){if(t.keyCode===13){if(e.targetOf(t).tagName!==`TEXTAREA`)this.clearInputAndSave();else{let e=parseInt(this.lastModified.getAttribute(`rows`));this.lastModified.setAttribute(`rows`,(e+1).toString()),t.stopPropagation()}}},Mousedown:function(e){l(`MOUSING DOWN`),window.addEventListener(`keypress`,function(e){e.ctrlKey&&(e.charCode===115||e.charCode===113)&&s.switchMode()},!1),window.addEventListener(`mousedown`,s.Mousedown,!1);let t=document.getElementById(`OutlineView`);t&&(t.oncontextmenu=function(){return!1}),e.button===2&&(s.switchMode(),e&&(e.preventDefault(),e.stopPropagation()))},Mouseover:function(e){if(this.className=`bottom-border-active`,this._tabulatorMode===1)switch(t.utils.getTarget(e).tagName){case`TD`:{let n=t.utils.getTarget(e);n.className===`pred`&&(n.style.cursor=`copy`);break}case`DIV`:{let n=t.utils.getTarget(e);t.utils.getTarget(e).className===`bottom-border`&&(n.style.borderColor=`rgb(100%,65%,0%)`,n.style.cursor=`copy`);break}}},Mouseout:function(e){if(this.className=`bottom-border`,this._tabulatorMode===1){let n=t.utils.getTarget(e);t.utils.getTarget(e).className===`bottom-border`&&(n.style.borderColor=`transparent`,n.style.cursor=`auto`)}},whatSortOfEditCell:function(e){if(e.nextSibling)return`predicate`;let r=this.getStatementAbout(e).predicate;return n.store.whether(r,t.ns.rdf(`type`),t.ns.owl(`DatatypeProperty`))||n.store.whether(r,t.ns.rdfs(`range`),t.ns.rdfs(`Literal`))||r.termType===`Collection`?`DatatypeProperty-like`:n.store.whether(r,u(`type`),t.ns.owl(`ObjectProperty`))?`ObjectProperty-like`:`no-idea`},getStatementAbout:function(e){let t=m(e);if(!t)throw Error(`No ancestor TR for the TD we clicked on:`+e);let n;try{n=t.AJAR_statement}catch{throw Error(`No AJAR_statement!`+e+e.textContent+` has ancestor `+t)}return this.lastModifiedStat=t.AJAR_statement,this.statIsInverse=t.AJAR_inverse,n},createInputBoxIn:function(n,r){function i(t){(t.keyCode===38||t.keyCode===40)&&(e.OutlinerKeypressPanel(t),e.UserInput.clearInputAndSave())}t.log.info(`myDocument in createInputBoxIn is now `+c.location),t.log.info(`outline.document is now `+e.document.location);let a=c.createElement(`input`);return a.setAttribute(`value`,r),a.setAttribute(`class`,`textinput`),n.className!==`undetermined selected`&&(a.setAttribute(`size`,`100`),a.addEventListener(`keypress`,i,!1)),n.appendChild(a),a},createNew:function(t){e.UserInput.clearMenu();let r=e.getSelection()[0],i=r.parentNode.AJAR_statement.why,a=n.store.nextSymbol(i);e.UserInput.fillInRequest(`object`,r,a),e.outlineExpand(e.getSelection()[0],a)},inputURI:function(r){let i=e.UserInput;i.clearMenu();let a=e.getSelection()[0];t.utils.emptyNode(a);let o=` (Type a URI) `;i.lastModified=i.createInputBoxIn(a,o),i.lastModified.select();function s(e){switch(e.stopPropagation(),e.keyCode){case 13:case 9:if(this.value!==o){let e=this.value;i.fillInRequest(`object`,a,n.store.sym(e))}}}i.lastModified.addEventListener(`keypress`,s,!1)},appendToPredicate:function(e){let t=!1,n;try{for(n=e.parentNode.nextSibling;n.childNodes.length===1&&n.AJAR_statement;n=n.nextSibling);}catch{t=!0}let r=c.createElement(`div`);if(r.style.colspan=`1`,r.style.display=`block`,r.style.display=``,e.hasAttribute(`rowspan`)&&e.setAttribute(`rowspan`,parseInt(e.getAttribute(`rowspan`))+1),e.hasAttribute(`rowspan`)||e.setAttribute(`rowspan`,`2`),!t)n.parentNode.insertBefore(r,n);else{let t=e.parentNode.parentNode;t.className===`defaultPane`?t.insertBefore(r,t.lastChild):t.appendChild(r)}return r},bnode2symbol:function(e,t){n.store.copyTo(e,t,[`two-direction`,`delete`])},generateRequest:function(n,r,i,a){let s;a||(s=r||m(this.lastModified),t.utils.emptyNode(s));let c=o,l=c.bnode();if(c.add(l,t.ns.rdf(`type`),t.ns.link(`Request`)),n.length,c.add(l,t.ns.link(`message`),c.literal(n)),c.add(l,t.ns.link(`to`),c.literal(`The User`)),c.add(l,t.ns.link(`from`),c.literal(`The User`)),!a){let t;t=i?s.appendChild(e.outlinePredicateTD(l,s,!1,!1)):s.appendChild(e.outlineObjectTD(l)),t.className=`undetermined`,t.textContent=n}return l},showMenu:function(r,a,o,s,p){t.log.info(`myDocument is now `+c.location),t.log.info(`outline.doucment is now `+e.document.location);let m=this,h=c.createElement(`div`);if(l(`
42
42
  **** In showMenu, menuType = `+a+`
43
43
  `),s)for(let e in s)console.log(` extra `+e+`: `+s[e]+`
44
44
  `);console.log(`CREATED MENU