solid-ui 5.0.2-4 → 5.0.2-5

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 (265) hide show
  1. package/dist/acl/access-controller.cjs.js +1 -1
  2. package/dist/acl/access-controller.cjs.js.map +1 -1
  3. package/dist/acl/access-controller.esm.js +37 -37
  4. package/dist/acl/access-groups.cjs.js +2 -2
  5. package/dist/acl/access-groups.cjs.js.map +1 -1
  6. package/dist/acl/access-groups.esm.js +78 -78
  7. package/dist/acl/acl-control.cjs.js +1 -1
  8. package/dist/acl/acl-control.cjs.js.map +1 -1
  9. package/dist/acl/acl-control.esm.js +19 -19
  10. package/dist/acl/add-agent-buttons.cjs.js +1 -1
  11. package/dist/acl/add-agent-buttons.cjs.js.map +1 -1
  12. package/dist/acl/add-agent-buttons.esm.js +51 -51
  13. package/dist/chat/bookmarks.cjs.js +1 -1
  14. package/dist/chat/bookmarks.cjs.js.map +1 -1
  15. package/dist/chat/bookmarks.esm.js +44 -44
  16. package/dist/chat/bookmarks.esm.js.map +1 -1
  17. package/dist/chat/chatLogic.cjs.js +2 -2
  18. package/dist/chat/chatLogic.cjs.js.map +1 -1
  19. package/dist/chat/chatLogic.esm.js +54 -54
  20. package/dist/chat/dateFolder.cjs.js +1 -1
  21. package/dist/chat/dateFolder.cjs.js.map +1 -1
  22. package/dist/chat/dateFolder.esm.js +30 -30
  23. package/dist/chat/infinite.cjs.js +1 -1
  24. package/dist/chat/infinite.cjs.js.map +1 -1
  25. package/dist/chat/infinite.esm.js +49 -49
  26. package/dist/chat/keys.cjs.js +2 -2
  27. package/dist/chat/keys.cjs.js.map +1 -1
  28. package/dist/chat/keys.esm.js +17 -17
  29. package/dist/chat/message.cjs.js +4 -4
  30. package/dist/chat/message.cjs.js.map +1 -1
  31. package/dist/chat/message.esm.js +114 -114
  32. package/dist/chat/message.esm.js.map +1 -1
  33. package/dist/chat/messageTools.cjs.js +1 -1
  34. package/dist/chat/messageTools.cjs.js.map +1 -1
  35. package/dist/chat/messageTools.esm.js +51 -51
  36. package/dist/chunks/{ResourceActionsMenu-Bllpr4M5.js → ResourceActionsMenu-Bx7YWY3E.js} +29 -29
  37. package/dist/chunks/{ResourceActionsMenu-Bllpr4M5.js.map → ResourceActionsMenu-Bx7YWY3E.js.map} +1 -1
  38. package/dist/chunks/{access-control-modal-CwmY_Dod.js → access-control-modal-B1mFFIyz.js} +165 -165
  39. package/dist/chunks/{access-control-modal-CwmY_Dod.js.map → access-control-modal-B1mFFIyz.js.map} +1 -1
  40. package/dist/chunks/{account-CoHPKKDu.js → account-DWmMJre6.js} +22 -22
  41. package/dist/chunks/{account-CoHPKKDu.js.map → account-DWmMJre6.js.map} +1 -1
  42. package/dist/chunks/{auth-CocCqS1p.js → auth-EK-iYNYZ.js} +37 -37
  43. package/dist/chunks/{auth-CocCqS1p.js.map → auth-EK-iYNYZ.js.map} +1 -1
  44. package/dist/chunks/{avatar-sNdKdWVO.js → avatar-BBgvMlqv.js} +13 -13
  45. package/dist/chunks/{avatar-sNdKdWVO.js.map → avatar-BBgvMlqv.js.map} +1 -1
  46. package/dist/chunks/{combobox-fSTp9qoT.js → combobox-DS6byaf1.js} +3 -3
  47. package/dist/chunks/{combobox-fSTp9qoT.js.map → combobox-DS6byaf1.js.map} +1 -1
  48. package/dist/chunks/{error-state-BD4_Wrkz.js → error-state-jV9dlFX2.js} +2 -2
  49. package/dist/chunks/{error-state-BD4_Wrkz.js.map → error-state-jV9dlFX2.js.map} +1 -1
  50. package/dist/chunks/{file-explorer-header-D0TebSYR.js → file-explorer-header-Djp_eFuT.js} +50 -50
  51. package/dist/chunks/{file-explorer-header-D0TebSYR.js.map → file-explorer-header-Djp_eFuT.js.map} +1 -1
  52. package/dist/chunks/{guard-BOicu9dt.js → guard-SxVT1xr4.js} +13 -13
  53. package/dist/chunks/{guard-BOicu9dt.js.map → guard-SxVT1xr4.js.map} +1 -1
  54. package/dist/chunks/{index.esm-C9oV3H3X.js → index.esm-BQrkxchZ.js} +2 -2
  55. package/dist/chunks/{index.esm-C9oV3H3X.js.map → index.esm-BQrkxchZ.js.map} +1 -1
  56. package/dist/chunks/{jsonld-D-TE94B0.js → jsonld-C6IOQ1Tg.js} +2 -2
  57. package/dist/chunks/{jsonld-D-TE94B0.js.map → jsonld-C6IOQ1Tg.js.map} +1 -1
  58. package/dist/chunks/{login-button-clTw_9tX.js → login-button-Dd0rwZJk.js} +11 -11
  59. package/dist/chunks/{login-button-clTw_9tX.js.map → login-button-Dd0rwZJk.js.map} +1 -1
  60. package/dist/chunks/{logout-button-CP-Pz70O.js → logout-button-Da34Lrnq.js} +11 -11
  61. package/dist/chunks/{logout-button-CP-Pz70O.js.map → logout-button-Da34Lrnq.js.map} +1 -1
  62. package/dist/chunks/{menu-D0k2fkiE.js → menu-BNJU654v.js} +2 -2
  63. package/dist/chunks/{menu-D0k2fkiE.js.map → menu-BNJU654v.js.map} +1 -1
  64. package/dist/chunks/{provider-Cuv3Kp6G.js → provider-B3FoP2qW.js} +11 -11
  65. package/dist/chunks/{provider-Cuv3Kp6G.js.map → provider-B3FoP2qW.js.map} +1 -1
  66. package/dist/chunks/{rdf-form-DVmTw3RG.js → rdf-form-BkKDmFPD.js} +36 -36
  67. package/dist/chunks/{rdf-form-DVmTw3RG.js.map → rdf-form-BkKDmFPD.js.map} +1 -1
  68. package/dist/chunks/{rdf-input-CRYLK-27.js → rdf-input-BPePtqfS.js} +61 -61
  69. package/dist/chunks/{rdf-input-CRYLK-27.js.map → rdf-input-BPePtqfS.js.map} +1 -1
  70. package/dist/chunks/{signup-button-CexdMWj6.js → signup-button-DOInssOu.js} +11 -11
  71. package/dist/chunks/{signup-button-CexdMWj6.js.map → signup-button-DOInssOu.js.map} +1 -1
  72. package/dist/chunks/{solidLogicSingleton.esm-BXyHD7mn.js → solidLogicSingleton.esm-Bvt7E7Vl.js} +50 -29
  73. package/dist/chunks/solidLogicSingleton.esm-Bvt7E7Vl.js.map +1 -0
  74. package/dist/chunks/{src-DQgHAH3d.js → src-akaVfkuf.js} +1956 -1944
  75. package/dist/chunks/src-akaVfkuf.js.map +1 -0
  76. package/dist/chunks/{style-CXaw5EYi.js → style-Dlw9-wPn.js} +3 -3
  77. package/dist/chunks/{style-CXaw5EYi.js.map → style-Dlw9-wPn.js.map} +1 -1
  78. package/dist/chunks/{widgets-BBEQu0CS.js → widgets-B1hBVhRL.js} +309 -309
  79. package/dist/chunks/widgets-B1hBVhRL.js.map +1 -0
  80. package/dist/components/access-control-modal/AccessControlAddAccess.cjs.js +1 -1
  81. package/dist/components/access-control-modal/AccessControlAddAccess.esm.js +5 -5
  82. package/dist/components/access-control-modal/AccessControlGeneralAccess.cjs.js +2 -2
  83. package/dist/components/access-control-modal/AccessControlGeneralAccess.cjs.js.map +1 -1
  84. package/dist/components/access-control-modal/AccessControlGeneralAccess.esm.js +12 -12
  85. package/dist/components/access-control-modal/AccessControlModal.cjs.js +2 -2
  86. package/dist/components/access-control-modal/AccessControlModal.cjs.js.map +1 -1
  87. package/dist/components/access-control-modal/AccessControlModal.esm.js +35 -35
  88. package/dist/components/access-control-modal/AccessControlModal.esm.js.map +1 -1
  89. package/dist/components/access-control-modal/AccessControlSharedAccess.cjs.js +1 -1
  90. package/dist/components/access-control-modal/AccessControlSharedAccess.esm.js +2 -2
  91. package/dist/components/access-control-modal/accessTargetResolver.cjs.js +1 -1
  92. package/dist/components/access-control-modal/accessTargetResolver.cjs.js.map +1 -1
  93. package/dist/components/access-control-modal/accessTargetResolver.esm.js +21 -21
  94. package/dist/components/access-control-modal.js +1 -1
  95. package/dist/components/account/Account.cjs.js +1 -1
  96. package/dist/components/account/Account.esm.js +3 -3
  97. package/dist/components/account.js +1 -1
  98. package/dist/components/all.cjs.js +1 -1
  99. package/dist/components/all.esm.js +16 -16
  100. package/dist/components/avatar.js +1 -1
  101. package/dist/components/combobox/Combobox.cjs.js +1 -1
  102. package/dist/components/combobox/Combobox.esm.js +1 -1
  103. package/dist/components/combobox.js +1 -1
  104. package/dist/components/dialog/Dialog.cjs.js +2 -2
  105. package/dist/components/dialog/Dialog.cjs.js.map +1 -1
  106. package/dist/components/dialog/Dialog.esm.js +9 -9
  107. package/dist/components/dialog/Dialog.esm.js.map +1 -1
  108. package/dist/components/dialog-provider/DialogProvider.cjs.js +1 -1
  109. package/dist/components/dialog-provider/DialogProvider.cjs.js.map +1 -1
  110. package/dist/components/dialog-provider/DialogProvider.esm.js +6 -6
  111. package/dist/components/dialogs-root/DialogsRoot.cjs.js +2 -2
  112. package/dist/components/dialogs-root/DialogsRoot.cjs.js.map +1 -1
  113. package/dist/components/dialogs-root/DialogsRoot.esm.js +7 -7
  114. package/dist/components/error-state/ErrorState.cjs.js +1 -1
  115. package/dist/components/error-state/ErrorState.esm.js +1 -1
  116. package/dist/components/error-state.js +1 -1
  117. package/dist/components/file-explorer-header/FileExplorerHeaderControls.cjs.js +2 -2
  118. package/dist/components/file-explorer-header/FileExplorerHeaderControls.cjs.js.map +1 -1
  119. package/dist/components/file-explorer-header/FileExplorerHeaderControls.esm.js +10 -10
  120. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.cjs.js +1 -1
  121. package/dist/components/file-explorer-header/FileExplorerHeaderSummary.esm.js +5 -5
  122. package/dist/components/file-explorer-header.js +1 -1
  123. package/dist/components/guard.js +1 -1
  124. package/dist/components/login-button/LoginButton.cjs.js +1 -1
  125. package/dist/components/login-button/LoginButton.esm.js +1 -1
  126. package/dist/components/login-button.js +1 -1
  127. package/dist/components/login-modal/LoginModal.cjs.js +1 -1
  128. package/dist/components/login-modal/LoginModal.esm.js +2 -2
  129. package/dist/components/login-modal.js +1 -1
  130. package/dist/components/logout-button/LogoutButton.cjs.js +1 -1
  131. package/dist/components/logout-button/LogoutButton.esm.js +1 -1
  132. package/dist/components/logout-button.js +1 -1
  133. package/dist/components/menu/Menu.cjs.js +1 -1
  134. package/dist/components/menu/Menu.cjs.js.map +1 -1
  135. package/dist/components/menu/Menu.esm.js +1 -1
  136. package/dist/components/menu/Menu.esm.js.map +1 -1
  137. package/dist/components/menu.js +1 -1
  138. package/dist/components/provider.js +1 -1
  139. package/dist/components/rdf-form/RDFForm.cjs.js +3 -3
  140. package/dist/components/rdf-form/RDFForm.cjs.js.map +1 -1
  141. package/dist/components/rdf-form/RDFForm.esm.js +13 -13
  142. package/dist/components/rdf-form/RDFForm.esm.js.map +1 -1
  143. package/dist/components/rdf-form.js +1 -1
  144. package/dist/components/rdf-input/RDFInput.cjs.js +2 -2
  145. package/dist/components/rdf-input/RDFInput.cjs.js.map +1 -1
  146. package/dist/components/rdf-input/RDFInput.esm.js +4 -4
  147. package/dist/components/rdf-input/RDFInput.esm.js.map +1 -1
  148. package/dist/components/rdf-input.js +1 -1
  149. package/dist/components/resource-actions-menu/ResourceActionsMenu.cjs.js +3 -3
  150. package/dist/components/resource-actions-menu/ResourceActionsMenu.cjs.js.map +1 -1
  151. package/dist/components/resource-actions-menu/ResourceActionsMenu.esm.js +7 -7
  152. package/dist/components/resource-actions-menu.js +1 -1
  153. package/dist/components/select/Select.cjs.js +1 -1
  154. package/dist/components/select/Select.cjs.js.map +1 -1
  155. package/dist/components/select/Select.esm.js +1 -1
  156. package/dist/components/signup-button/SignupButton.cjs.js +1 -1
  157. package/dist/components/signup-button/SignupButton.esm.js +1 -1
  158. package/dist/components/signup-button.js +1 -1
  159. package/dist/components.js +21 -21
  160. package/dist/create/create.cjs.js +1 -1
  161. package/dist/create/create.cjs.js.map +1 -1
  162. package/dist/create/create.esm.js +23 -23
  163. package/dist/header/index.cjs.js +1 -1
  164. package/dist/header/index.cjs.js.map +1 -1
  165. package/dist/header/index.esm.js +53 -53
  166. package/dist/index.cjs.js +1 -1
  167. package/dist/index.cjs.js.map +1 -1
  168. package/dist/index.esm.js +20 -20
  169. package/dist/index.js +5 -5
  170. package/dist/lib/auth/SolidAuth.cjs.js +1 -1
  171. package/dist/lib/auth/SolidAuth.cjs.js.map +1 -1
  172. package/dist/lib/auth/SolidAuth.esm.js +8 -8
  173. package/dist/lib/auth/SolidAuth.esm.js.map +1 -1
  174. package/dist/lib/code-editor/CodeEditor.cjs.js +1 -1
  175. package/dist/lib/code-editor/CodeEditor.cjs.js.map +1 -1
  176. package/dist/lib/code-editor/CodeEditor.d.ts.map +1 -1
  177. package/dist/lib/code-editor/CodeEditor.esm.js +34 -30
  178. package/dist/lib/code-editor/CodeEditor.esm.js.map +1 -1
  179. package/dist/lib/components/dialog-component/DialogComponent.cjs.js +1 -1
  180. package/dist/lib/components/dialog-component/DialogComponent.cjs.js.map +1 -1
  181. package/dist/lib/components/dialog-component/DialogComponent.esm.js +4 -4
  182. package/dist/lib/components/index.cjs.js +1 -1
  183. package/dist/lib/components/index.esm.js +3 -3
  184. package/dist/lib/dialogs/helpers.cjs.js +1 -1
  185. package/dist/lib/dialogs/helpers.cjs.js.map +1 -1
  186. package/dist/lib/dialogs/helpers.esm.js +4 -4
  187. package/dist/lib/file-explorer/relevant-panes.cjs.js +1 -1
  188. package/dist/lib/file-explorer/relevant-panes.cjs.js.map +1 -1
  189. package/dist/lib/file-explorer/relevant-panes.esm.js +8 -8
  190. package/dist/lib/messageArea.cjs.js +1 -1
  191. package/dist/lib/messageArea.cjs.js.map +1 -1
  192. package/dist/lib/messageArea.esm.js +27 -27
  193. package/dist/lib/pad.cjs.js +1 -1
  194. package/dist/lib/pad.cjs.js.map +1 -1
  195. package/dist/lib/pad.esm.js +15 -15
  196. package/dist/lib/participation.cjs.js +1 -1
  197. package/dist/lib/participation.cjs.js.map +1 -1
  198. package/dist/lib/participation.esm.js +59 -59
  199. package/dist/lib/preferences.cjs.js +1 -1
  200. package/dist/lib/preferences.cjs.js.map +1 -1
  201. package/dist/lib/preferences.esm.js +28 -28
  202. package/dist/lib/table.cjs.js +3 -3
  203. package/dist/lib/table.cjs.js.map +1 -1
  204. package/dist/lib/table.esm.js +123 -123
  205. package/dist/lib/table.esm.js.map +1 -1
  206. package/dist/lib/tabs.cjs.js +1 -1
  207. package/dist/lib/tabs.cjs.js.map +1 -1
  208. package/dist/lib/tabs.esm.js +16 -16
  209. package/dist/loader.js +11 -11
  210. package/dist/login/login.cjs.js +6 -6
  211. package/dist/login/login.cjs.js.map +1 -1
  212. package/dist/login/login.esm.js +142 -142
  213. package/dist/media/media-capture.cjs.js +1 -1
  214. package/dist/media/media-capture.cjs.js.map +1 -1
  215. package/dist/media/media-capture.esm.js +6 -6
  216. package/dist/solid-ui.js +18 -18
  217. package/dist/solid-ui.min.js +18 -18
  218. package/dist/solid-ui.min.js.map +1 -1
  219. package/dist/utils/index.cjs.js +1 -1
  220. package/dist/utils/index.cjs.js.map +1 -1
  221. package/dist/utils/index.esm.js +4 -4
  222. package/dist/utils/keyHelpers/accessData.cjs.js +1 -1
  223. package/dist/utils/keyHelpers/accessData.cjs.js.map +1 -1
  224. package/dist/utils/keyHelpers/accessData.esm.js +15 -15
  225. package/dist/utils/label.cjs.js +1 -1
  226. package/dist/utils/label.cjs.js.map +1 -1
  227. package/dist/utils/label.esm.js +4 -4
  228. package/dist/widgets/buttons.cjs.js +12 -12
  229. package/dist/widgets/buttons.cjs.js.map +1 -1
  230. package/dist/widgets/buttons.esm.js +179 -179
  231. package/dist/widgets/error.cjs.js +1 -1
  232. package/dist/widgets/error.cjs.js.map +1 -1
  233. package/dist/widgets/error.esm.js +5 -5
  234. package/dist/widgets/forms/autocomplete/autocompleteBar.cjs.js +1 -1
  235. package/dist/widgets/forms/autocomplete/autocompleteBar.cjs.js.map +1 -1
  236. package/dist/widgets/forms/autocomplete/autocompleteBar.esm.js +17 -17
  237. package/dist/widgets/forms/autocomplete/autocompleteField.cjs.js +1 -1
  238. package/dist/widgets/forms/autocomplete/autocompleteField.cjs.js.map +1 -1
  239. package/dist/widgets/forms/autocomplete/autocompleteField.esm.js +23 -23
  240. package/dist/widgets/forms/autocomplete/autocompletePicker.cjs.js +1 -1
  241. package/dist/widgets/forms/autocomplete/autocompletePicker.cjs.js.map +1 -1
  242. package/dist/widgets/forms/autocomplete/autocompletePicker.esm.js +26 -26
  243. package/dist/widgets/forms/autocomplete/language.cjs.js +1 -1
  244. package/dist/widgets/forms/autocomplete/language.cjs.js.map +1 -1
  245. package/dist/widgets/forms/autocomplete/language.esm.js +9 -9
  246. package/dist/widgets/forms/autocomplete/publicData.cjs.js +5 -5
  247. package/dist/widgets/forms/autocomplete/publicData.cjs.js.map +1 -1
  248. package/dist/widgets/forms/autocomplete/publicData.esm.js +67 -67
  249. package/dist/widgets/forms/basic.cjs.js +1 -1
  250. package/dist/widgets/forms/basic.cjs.js.map +1 -1
  251. package/dist/widgets/forms/basic.esm.js +11 -11
  252. package/dist/widgets/forms.cjs.js +4 -4
  253. package/dist/widgets/forms.cjs.js.map +1 -1
  254. package/dist/widgets/forms.esm.js +561 -561
  255. package/dist/widgets/forms.esm.js.map +1 -1
  256. package/dist/widgets/index.cjs.js +1 -1
  257. package/dist/widgets/index.cjs.js.map +1 -1
  258. package/dist/widgets/index.esm.js +82 -82
  259. package/dist/widgets/peoplePicker.cjs.js +2 -2
  260. package/dist/widgets/peoplePicker.cjs.js.map +1 -1
  261. package/dist/widgets/peoplePicker.esm.js +82 -82
  262. package/package.json +3 -3
  263. package/dist/chunks/solidLogicSingleton.esm-BXyHD7mn.js.map +0 -1
  264. package/dist/chunks/src-DQgHAH3d.js.map +0 -1
  265. package/dist/chunks/widgets-BBEQu0CS.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"rdf-input-CRYLK-27.js","names":["sym","parse","ns","baseUri","loadDocument","store","documentSource","documentName","documentURI","preferRemote","finalDocumentUri","document","holds","undefined","removeStatements","statementsMatching","parseSource","Promise","resolve","reject","err","console","error","fetcher","load","force","clearPreviousData","then","catch","trim","length","Error","fetchData","sortBySequence","list","subfields","map","p","k","any","ui","seq","Number","value","isNaN","sort","a","b","pair","mostSpecificClassURI","subject","typeUri","findTypeURIs","specificTypes","bottomTypeURIs","finalTypes","t","push","findForm","sourceUri","docUrl","split","fragment","includes","candidate","rdf","forms","each","found","find","term","termType","sym","ns","ns","style","fieldParams","ui","uri","size","type","dt","pattern","namedNode","defaultInputValue","formGroupStyle","element","commentStyle","formHeadingStyle","ns","NoopStore","store","Error","createContext","NoopStore","DEFAULT_STORE","storeContext","Symbol","createContext","property","state","html","ns","customElement","generateId","WebComponent","Literal","st","label","mostSpecificClassURI","fieldParams","fieldTypeParams","DEFAULT_STORE","storeContext","consume","_classDecs","_RDFInput","_A","WeakMap","_B","_C","_D","_E","_F","_ref","_storeContextDecs","context","subscribe","_formSubjectDecs","attribute","type","Object","_dataSubjectDecs","_storeVersionDecs","Number","_localInputValueDecs","_readonlyDecs","Boolean","reflect","RDFInput","_classPrivateFieldGet","v","_classPrivateFieldSet","formSubject","dataSubject","storeVersion","localInputValue","readonly","constructor","_classPrivateFieldInitSpec","_initProto","_init_storeContext","_init_formSubject","_init_dataSubject","_init_storeVersion","_init_localInputValue","_defineProperty","_init_readonly","id","render","formDocument","getDocument","uiPropertyTerm","getFormProperty","ui","inputLabel","getInputLabel","getReadOnly","fieldType","store","undefined","params","inputType","selectedTerm","getSelectedTerm","placeholder","defaultInputValue","inputValue","_updateInFlight","_pendingUpdateValue","termToInputValue","updateData","subject","doc","graph","any","formFieldSubject","uiLabel","propertyLabel","value","anyJS","defaultTerm","inputTerm","term","decodeURIComponent","String","stripped","replace","e","newValue","target","runPendingUpdate","dataDocument","updater","editable","toDeleteSt","statementsMatching","toInsertSt","objectFromNewValue","namedNode","sym","encodeURIComponent","dt","trim","xsd","map","statement","predicate","why","length","updateMany","err","console","error","_RDFInput2","c","_initClass","_applyDecs","default","consume","property","state","ns","fieldTypeParams","RDFInput","RDFInput","st","namedNode","Literal","ns_default","style","label","c","customElement","n$1","WebComponent","b","n","generateId","fetchData","document","documentURI","store","sortBySequence","subfields","list","k","p","seq","a","pair","mostSpecificClassURI","typeUri","subject","specificTypes","finalTypes","t","findForm","docUrl","sourceUri","fragment","candidate","term","fieldParams","DEFAULT_STORE","storeContext","_RDFInput2","_initProto","_initClass","_classDecs","_storeContextDecs","_init_storeContext","_formSubjectDecs","_init_formSubject","_dataSubjectDecs","_init_dataSubject","_storeVersionDecs","_init_storeVersion","_localInputValueDecs","_init_localInputValue","_readonlyDecs","_init_readonly","_ref","_defineProperty","_toPropertyKey","r","_classPrivateFieldInitSpec","_checkPrivateRedeclaration","_classPrivateFieldSet","s","_assertClassBrand","_classPrivateFieldGet","_applyDecs","i","o","applyDec","m","h","y","v","g","u","w","S","A","d","_setFunctionName","P","j","D","I","F","l","f","N","_checkInRHS","_toPrimitive","e","_RDFInput","_A","_B","_C","_D","_E","_F","formDocument","uiPropertyTerm","inputLabel","readonly","fieldType","params","inputType","selectedTerm","placeholder","inputValue","property","graph","formFieldSubject","uiLabel","propertyLabel","defaultTerm","dataSubject","newValue","dataDocument","toDeleteSt","toInsertSt","objectFromNewValue","statement","err","rdf_input_default"],"sources":["../../src/lib/forms/rdfFormsHelper.ts","../../src/lib/forms/fieldParams.ts","../../src/lib/forms/store/NoopStore.ts","../../src/lib/forms/store/StoreContext.ts","../../src/components/rdf-input/RDFInput.ts","../../src/components/rdf-input/index.ts"],"sourcesContent":["import { sym, LiveStore, parse } from 'rdflib'\nimport type { Term } from 'rdflib/lib/tf-types'\n// eslint-disable-next-line camelcase\nimport type { Quad_Subject, NamedNode } from 'rdflib/lib/tf-types'\nimport ns from '../../lib/ns'\n\nconst baseUri = 'https://solidos.github.io/solid-ui/src/ontology/'\n\nexport function loadDocument (\n store: LiveStore,\n documentSource: string,\n documentName: string,\n documentURI?: string,\n preferRemote = false\n) {\n const finalDocumentUri = documentURI || baseUri + documentName // Full URI to the file\n const document = sym(finalDocumentUri) // rdflib NamedNode for the document\n\n if (store.holds(undefined, undefined, undefined, document)) {\n store.removeStatements(store.statementsMatching(undefined, undefined, undefined, document))\n }\n\n const parseSource = () => {\n return new Promise<void>((resolve, reject) => {\n parse(documentSource, store, finalDocumentUri, 'text/turtle', (err) => {\n if (err) {\n console.error('Parse document error for ', finalDocumentUri, err)\n reject(err)\n } else {\n resolve()\n }\n })\n })\n }\n\n if (preferRemote && documentURI) {\n return store.fetcher.load(documentURI, {\n force: true,\n clearPreviousData: true,\n }).then(() => {}).catch((err) => {\n if (documentSource && documentSource.trim().length > 0) {\n return parseSource()\n }\n throw err\n })\n }\n\n if (documentSource && documentSource.trim().length > 0) {\n return parseSource()\n }\n\n if (documentURI) {\n return store.fetcher.load(documentURI, {\n force: true,\n clearPreviousData: true,\n }).then(() => {})\n }\n\n return Promise.reject(new Error(`No document source or URI for ${documentName}`))\n}\n\nexport async function fetchData (\n store: LiveStore,\n documentURI: string\n) {\n const document = sym(documentURI) // rdflib NamedNode for the document\n\n if (store.holds(undefined, undefined, undefined, document)) {\n store.removeStatements(store.statementsMatching(undefined, undefined, undefined, document))\n }\n\n return await store.fetcher.load(documentURI, {\n force: true,\n clearPreviousData: true,\n })\n}\n\nexport function sortBySequence (\n store: LiveStore,\n list: Term[]\n) {\n const subfields = list.map((p) => {\n const k = store.any(p as any, ns.ui('sequence'))\n const seq = k ? Number((k as { value: string }).value) : 9999\n return [Number.isNaN(seq) ? 9999 : seq, p] as const\n })\n\n subfields.sort((a, b) => a[0] - b[0])\n\n return subfields.map(pair => pair[1])\n}\n\n/**\n * Which class of field is this? Relies on http://www.w3.org/2000/01/rdf-schema#subClassOf and\n * https://linkeddata.github.io/rdflib.js/doc/classes/formula.html#bottomtypeuris\n * to find the most specific RDF type if there are multiple.\n *\n * @param subject a form field, e.g. `namedNode('https://timbl.com/timbl/Public/Test/Forms/individualForm.ttl#fullNameField')`\n * @returns the URI of the most specific known class, e.g. `http://www.w3.org/ns/ui#SingleLineTextField`\n */\n// eslint-disable-next-line camelcase\nexport function mostSpecificClassURI (store: LiveStore, subject: Quad_Subject): string {\n const typeUri = store.findTypeURIs(subject)\n const specificTypes = store.bottomTypeURIs(typeUri) // most specific\n const finalTypes: any[] = []\n for (const t in specificTypes) finalTypes.push(t)\n // if (finalTypes.length > 1) throw \"Didn't expect \"+subject+\" to have multiple bottom types: \"+finalTypes\n return finalTypes[0]\n}\n\n// Find the first ui:Form node in a store, optionally matching a fragment.\n// code based on Jeff Zucker's sol-components: https://github.com/jeff-zucker/sol-components (core/form-utils.js)\nexport function findForm (store: LiveStore, sourceUri: string): NamedNode | null {\n const docUrl = sourceUri.split('#')[0]\n const fragment = sourceUri.includes('#') ? sourceUri.split('#')[1] : null\n if (fragment) {\n const candidate = sym(docUrl + '#' + fragment)\n if (store.holds(candidate, ns.rdf('type'), ns.ui('Form'))) return candidate\n }\n const forms = store.each(null, ns.rdf('type'), ns.ui('Form'))\n const found = forms.find((term) => term.termType === 'NamedNode')\n return found ? (found as NamedNode) : null\n}\n","import ns from '../../lib/ns'\nimport { style } from '../../lib/style'\n\nexport type InputType =\n | 'hidden'\n | 'text'\n | 'search'\n | 'tel'\n | 'url'\n | 'email'\n | 'password'\n | 'datetime'\n | 'date'\n | 'month'\n | 'week'\n | 'time'\n | 'datetime-local'\n | 'number'\n | 'range'\n | 'color'\n | 'checkbox'\n | 'radio'\n | 'file'\n | 'submit'\n | 'image'\n | 'reset'\n | 'button'\n\nexport type FieldParamsObject = {\n size?: number, // input element size attribute\n type?: InputType, // input element type attribute. Default: 'text' (not for Comment and Heading)\n element?: string, // element type to use (Comment and Heading only)\n style?: string, // style to use\n dt?: string, // xsd data type for the RDF Literal corresponding to the field value. Default: xsd:string\n defaultInputValue?: string, // e.g. 'mailto:'. Default value in input field, will be removed when displaying actual value to user.\n namedNode?: boolean, // if true, field value corresponds to the URI of an RDF NamedNode. Overrides dt and defaultInputValue.\n pattern?: RegExp // for client-side input validation; field will go red if violated, green if ok\n}\n\n/**\n * The fieldParams object defines various constants\n * for use in various form fields. Depending on the\n * field in questions, different values may be read\n * from here.\n */\nexport const fieldParams: { [ fieldUri: string ]: FieldParamsObject } = {\n /**\n * Text field\n *\n * For possible date popups see e.g. http://www.dynamicdrive.com/dynamicindex7/jasoncalendar.htm\n * or use HTML5: http://www.w3.org/TR/2011/WD-html-markup-20110113/input.date.html\n */\n [ns.ui('ColorField').uri]: {\n size: 9,\n type: 'color',\n style: 'height: 3em;', // around 1.5em is padding\n dt: 'color',\n pattern: /^\\s*#[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]([0-9a-f][0-9a-f])?\\s*$/\n }, // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/color\n\n [ns.ui('DateField').uri]: {\n size: 20,\n type: 'date',\n dt: 'date',\n pattern: /^\\s*[0-9][0-9][0-9][0-9](-[0-1]?[0-9]-[0-3]?[0-9])?Z?\\s*$/\n },\n\n [ns.ui('DateTimeField').uri]: {\n size: 20,\n type: 'datetime-local', // See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime\n dt: 'dateTime',\n pattern: /^\\s*[0-9][0-9][0-9][0-9](-[0-1]?[0-9]-[0-3]?[0-9])?(T[0-2][0-9]:[0-5][0-9](:[0-5][0-9])?)?Z?\\s*$/\n },\n\n [ns.ui('TimeField').uri]: {\n size: 10,\n type: 'time',\n dt: 'time',\n pattern: /^\\s*([0-2]?[0-9]:[0-5][0-9](:[0-5][0-9])?)\\s*$/\n },\n\n [ns.ui('IntegerField').uri]: {\n size: 12,\n style: 'text-align: right;',\n dt: 'integer',\n pattern: /^\\s*-?[0-9]+\\s*$/\n },\n\n [ns.ui('DecimalField').uri]: {\n size: 12,\n style: 'text-align: right;',\n dt: 'decimal',\n pattern: /^\\s*-?[0-9]*(\\.[0-9]*)?\\s*$/\n },\n\n [ns.ui('FloatField').uri]: {\n size: 12,\n style: 'text-align: right;',\n dt: 'float',\n pattern: /^\\s*-?[0-9]*(\\.[0-9]*)?((e|E)-?[0-9]*)?\\s*$/\n },\n\n [ns.ui('SingleLineTextField').uri]: {\n\n },\n [ns.ui('NamedNodeURIField').uri]: {\n namedNode: true\n },\n [ns.ui('TextField').uri]: {\n\n },\n\n [ns.ui('PhoneField').uri]: {\n size: 20,\n defaultInputValue: 'tel:',\n pattern: /^\\+?[\\d-]+[\\d]*$/\n },\n\n [ns.ui('EmailField').uri]: {\n size: 30,\n defaultInputValue: 'mailto:',\n pattern: /^\\s*.*@.*\\..*\\s*$/ // @@ Get the right regexp here\n },\n\n [ns.ui('Group').uri]: {\n style: style.formGroupStyle\n },\n\n /**\n * Non-interactive fields\n */\n [ns.ui('Comment').uri]: {\n element: 'p',\n style: style.commentStyle\n },\n [ns.ui('Heading').uri]: {\n element: 'h3',\n style: style.formHeadingStyle\n }\n}\n","import { LiveStore } from 'rdflib'\nimport { StoreContext } from './StoreContext'\n\nexport default class NoopStore implements StoreContext {\n get store (): LiveStore {\n throw new Error('Cannot use RDF forms without a store')\n }\n}\n","import { createContext } from '@lit/context'\nimport { LiveStore } from 'rdflib'\nimport NoopStore from './NoopStore'\n\nexport interface StoreContext {\n store: LiveStore\n}\n\nexport const DEFAULT_STORE = new NoopStore()\nexport const storeContext = createContext<StoreContext>(Symbol('storeContext'))\n","import { property, state } from 'lit/decorators.js'\nimport { html } from 'lit/html.js'\nimport ns from '../../lib/ns'\nimport { customElement, generateId, WebComponent } from '@/lib/components'\nimport { Literal, NamedNode, st } from 'rdflib'\nimport { label } from '../../utils'\nimport { mostSpecificClassURI } from '../../lib/forms/rdfFormsHelper'\nimport { FieldParamsObject, fieldParams as fieldTypeParams, InputType } from '../../lib/forms/fieldParams'\nimport { DEFAULT_STORE, storeContext, StoreContext } from '@/lib/forms/store/StoreContext'\nimport { consume } from '@lit/context'\nimport '@/components/input'\n\n@customElement('solid-ui-rdf-input')\nexport default class RDFInput extends WebComponent {\n // example RDF Turtle format source:\n // :nameField a ui:SingleLineTextField ;\n // ui:property vcard:fn;\n // ui:label \"name\" .\n\n // formSubject describes the field metadata\n // dataSubject points to the data resource containing the value\n\n @consume({ context: storeContext, subscribe: true })\n private accessor storeContext: StoreContext = DEFAULT_STORE\n\n @property({ attribute: false, type: Object })\n accessor formSubject: NamedNode | null = null\n\n @property({ attribute: false, type: Object })\n accessor dataSubject: NamedNode | null = null\n\n @property({ type: Number })\n accessor storeVersion = 0\n\n @state()\n private accessor localInputValue: string | null = null\n\n private _updateInFlight = false\n private _pendingUpdateValue: string | null = null\n\n @property({ type: Boolean, reflect: true })\n accessor readonly: boolean = true // to protect data, we default to not editable\n\n constructor () {\n super()\n\n this.id = generateId()\n }\n\n render () {\n const formDocument = this.getDocument(this.formSubject)\n\n // for building the HTML input element\n const uiPropertyTerm = this.getFormProperty(this.formSubject, ns.ui('property'), formDocument)\n const inputLabel = this.getInputLabel(this.formSubject, uiPropertyTerm, formDocument)\n const readonly = this.getReadOnly(this.readonly, this.formSubject, formDocument)\n\n const fieldType = this.formSubject ? mostSpecificClassURI(this.storeContext.store, this.formSubject) : undefined\n const params = fieldType ? fieldTypeParams[fieldType] ?? {} : {}\n const inputType: InputType = params.type ?? 'text'\n\n // for populating the HTML input element\n const selectedTerm = this.getSelectedTerm(this.dataSubject, uiPropertyTerm, this.formSubject, params)\n const placeholder = readonly ? '' : this.defaultInputValue(params)\n const inputValue = this._updateInFlight || this._pendingUpdateValue !== null\n ? this.localInputValue ?? ''\n : this.termToInputValue(selectedTerm)\n\n return html`\n <solid-ui-input\n label=\"${inputLabel}\"\n name=\"name-${this.id}\"\n .value=${inputValue}\n .placeholder=${placeholder}\n type=\"${inputType}\"\n ?readonly=${readonly}\n @input=${this.updateData}\n ></solid-ui-input>`\n }\n\n private getDocument (subject: NamedNode | null | undefined) {\n return subject?.doc ? subject.doc() : undefined\n }\n\n private getFormProperty (subject: NamedNode | null | undefined, property: NamedNode, graph?: any): NamedNode | undefined {\n if (!subject) return undefined\n return this.storeContext.store.any(subject, property, null, graph) as NamedNode | undefined\n }\n\n private getInputLabel (formFieldSubject: NamedNode | null | undefined, uiPropertyTerm?: NamedNode, graph?: any): string {\n if (!formFieldSubject) return ''\n const uiLabel = this.storeContext.store.any(formFieldSubject, ns.ui('label'), null, graph)\n const propertyLabel = uiPropertyTerm ? label(uiPropertyTerm, true) : ''\n return uiLabel ? uiLabel.value : propertyLabel\n }\n\n private getReadOnly (readonly: boolean, formFieldSubject?: NamedNode | null, graph?: any): boolean {\n if (formFieldSubject && readonly === false) { // if readonly is false, we can ovverride it if the field is marked as uneditable in the form\n return !!this.storeContext.store.anyJS(formFieldSubject, ns.ui('suppressEmptyUneditable'), null, graph)\n }\n return readonly\n }\n\n private getSelectedTerm (\n dataSubject?: NamedNode | null,\n uiPropertyTerm?: NamedNode,\n formFieldSubject?: NamedNode | null,\n params?: { defaultInputValue?: string }\n ) {\n const defaultTerm = formFieldSubject\n ? this.storeContext.store.any(formFieldSubject, ns.ui('default'))\n : undefined\n\n if (!uiPropertyTerm || !dataSubject) {\n return defaultTerm\n }\n\n const inputTerm = this.storeContext.store.any(dataSubject, uiPropertyTerm)\n return inputTerm || defaultTerm\n }\n\n private termToInputValue (term: any) {\n if (!term || !('value' in term) || !term.value) return ''\n\n try {\n return decodeURIComponent(term.value)\n } catch {\n return String(term.value)\n }\n }\n\n private defaultInputValue (params: { defaultInputValue?: string } = {}) {\n const stripped = params.defaultInputValue ?? ''\n return stripped.replace(/ /g, '')\n }\n\n private async updateData (e: CustomEvent) {\n const newValue = (e.target as HTMLInputElement).value\n this.localInputValue = newValue\n this._pendingUpdateValue = newValue\n\n if (this._updateInFlight) {\n return\n }\n\n await this.runPendingUpdate()\n }\n\n private async runPendingUpdate () {\n if (this._pendingUpdateValue === null) {\n return\n }\n\n const newValue = this._pendingUpdateValue\n this._pendingUpdateValue = null\n this._updateInFlight = true\n\n const uiPropertyTerm = this.getFormProperty(this.formSubject, ns.ui('property'), this.getDocument(this.formSubject))\n if (!uiPropertyTerm || !this.dataSubject) {\n this._updateInFlight = false\n this.localInputValue = ''\n return\n }\n\n const dataDocument = this.getDocument(this.dataSubject)\n if (dataDocument && this.storeContext.store.updater?.editable(dataDocument) === false) {\n this._updateInFlight = false\n return\n }\n\n const toDeleteSt = this.storeContext.store.statementsMatching(this.dataSubject, uiPropertyTerm)\n let toInsertSt: Array<ReturnType<typeof st>> = []\n\n if (newValue) {\n let objectFromNewValue\n const fieldType = this.formSubject ? mostSpecificClassURI(this.storeContext.store, this.formSubject) : undefined\n const params: FieldParamsObject = fieldType ? fieldTypeParams[fieldType] ?? {} : {}\n if (params.namedNode) {\n objectFromNewValue = this.storeContext.store.sym(newValue)\n } else if (params.defaultInputValue) {\n objectFromNewValue = encodeURIComponent(newValue.replace(/ /g, ''))\n objectFromNewValue = this.storeContext.store.sym(params.defaultInputValue + objectFromNewValue)\n } else {\n if (params.dt) {\n objectFromNewValue = new Literal(\n newValue.trim(),\n undefined,\n ns.xsd(params.dt)\n )\n } else {\n objectFromNewValue = new Literal(newValue)\n }\n }\n toInsertSt = toDeleteSt.map((statement) => st(statement.subject, statement.predicate, objectFromNewValue, statement.why))\n if (toInsertSt.length === 0) {\n toInsertSt = [st(this.dataSubject, uiPropertyTerm, objectFromNewValue, this.getDocument(this.dataSubject))]\n }\n }\n\n try {\n await this.storeContext.store.updater.updateMany(toDeleteSt, toInsertSt as any)\n this.storeVersion += 1\n } catch (err) {\n console.error('RDFInput update failed', err)\n } finally {\n this._updateInFlight = false\n }\n\n if (this._pendingUpdateValue !== null) {\n await this.runPendingUpdate()\n }\n }\n}\n","import RDFInput from './RDFInput'\n\nexport { RDFInput }\nexport default RDFInput\n"],"mappings":";;;;;AA6DA,eAAsBgC,EACpB3B,GACAG,GACA;CACA,IAAMG,IAAWX,EAAIQ,CAAW;CAMhC,OAJIH,EAAMO,MAAMC,KAAAA,GAAWA,KAAAA,GAAWA,KAAAA,GAAWF,CAAQ,KACvDN,EAAMS,iBAAiBT,EAAMU,mBAAmBF,KAAAA,GAAWA,KAAAA,GAAWA,KAAAA,GAAWF,CAAQ,CAAC,GAGrF,MAAMN,EAAMkB,QAAQC,KAAKhB,GAAa;EAC3CiB,OAAO;EACPC,mBAAmB;CACrB,CAAC;AACH;AAEA,SAAgBO,EACd5B,GACA6B,GACA;CACA,IAAMC,IAAYD,EAAKE,KAAKC,MAAM;EAChC,IAAMC,IAAIjC,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;CAAA;CAAA;EAAAG;EAAA;EAAA;CAAA;CAAA;EAAAI;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAE;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;AAAA,GAAArB,GAAA,GAAA,KAAA,GAvMqCV,CAAY,GAAAyH,EAAA;;ACVlD,IAAAqI,KAAe7H"}
1
+ {"version":3,"file":"rdf-input-BPePtqfS.js","names":["sym","parse","ns","baseUri","loadDocument","store","documentSource","documentName","documentURI","preferRemote","finalDocumentUri","document","holds","undefined","removeStatements","statementsMatching","parseSource","Promise","resolve","reject","err","console","error","fetcher","load","force","clearPreviousData","then","catch","trim","length","Error","fetchData","sortBySequence","list","subfields","map","p","k","any","ui","seq","Number","value","isNaN","sort","a","b","pair","mostSpecificClassURI","subject","typeUri","findTypeURIs","specificTypes","bottomTypeURIs","finalTypes","t","push","findForm","sourceUri","docUrl","split","fragment","includes","candidate","rdf","forms","each","found","find","term","termType","sym","ns","ns","style","fieldParams","ui","uri","size","type","dt","pattern","namedNode","defaultInputValue","formGroupStyle","element","commentStyle","formHeadingStyle","ns","NoopStore","store","Error","createContext","NoopStore","DEFAULT_STORE","storeContext","Symbol","createContext","property","state","html","ns","customElement","generateId","WebComponent","Literal","st","label","mostSpecificClassURI","fieldParams","fieldTypeParams","DEFAULT_STORE","storeContext","consume","_classDecs","_RDFInput","_A","WeakMap","_B","_C","_D","_E","_F","_ref","_storeContextDecs","context","subscribe","_formSubjectDecs","attribute","type","Object","_dataSubjectDecs","_storeVersionDecs","Number","_localInputValueDecs","_readonlyDecs","Boolean","reflect","RDFInput","_classPrivateFieldGet","v","_classPrivateFieldSet","formSubject","dataSubject","storeVersion","localInputValue","readonly","constructor","_classPrivateFieldInitSpec","_initProto","_init_storeContext","_init_formSubject","_init_dataSubject","_init_storeVersion","_init_localInputValue","_defineProperty","_init_readonly","id","render","formDocument","getDocument","uiPropertyTerm","getFormProperty","ui","inputLabel","getInputLabel","getReadOnly","fieldType","store","undefined","params","inputType","selectedTerm","getSelectedTerm","placeholder","defaultInputValue","inputValue","_updateInFlight","_pendingUpdateValue","termToInputValue","updateData","subject","doc","graph","any","formFieldSubject","uiLabel","propertyLabel","value","anyJS","defaultTerm","inputTerm","term","decodeURIComponent","String","stripped","replace","e","newValue","target","runPendingUpdate","dataDocument","updater","editable","toDeleteSt","statementsMatching","toInsertSt","objectFromNewValue","namedNode","sym","encodeURIComponent","dt","trim","xsd","map","statement","predicate","why","length","updateMany","err","console","error","_RDFInput2","c","_initClass","_applyDecs","default","consume","property","state","ns","fieldTypeParams","RDFInput","RDFInput","c","customElement","n$1","WebComponent","b","n","generateId","st","namedNode","Literal","ns_default","style","label","fetchData","document","documentURI","store","sortBySequence","subfields","list","k","p","seq","a","pair","mostSpecificClassURI","typeUri","subject","specificTypes","finalTypes","t","findForm","docUrl","sourceUri","fragment","candidate","term","fieldParams","DEFAULT_STORE","storeContext","_RDFInput2","_initProto","_initClass","_classDecs","_storeContextDecs","_init_storeContext","_formSubjectDecs","_init_formSubject","_dataSubjectDecs","_init_dataSubject","_storeVersionDecs","_init_storeVersion","_localInputValueDecs","_init_localInputValue","_readonlyDecs","_init_readonly","_ref","_defineProperty","_toPropertyKey","r","_classPrivateFieldInitSpec","_checkPrivateRedeclaration","_classPrivateFieldSet","s","_assertClassBrand","_classPrivateFieldGet","_applyDecs","i","o","applyDec","m","h","y","v","g","u","w","S","A","d","_setFunctionName","P","j","D","I","F","l","f","N","_checkInRHS","_toPrimitive","e","_RDFInput","_A","_B","_C","_D","_E","_F","formDocument","uiPropertyTerm","inputLabel","readonly","fieldType","params","inputType","selectedTerm","placeholder","inputValue","property","graph","formFieldSubject","uiLabel","propertyLabel","defaultTerm","dataSubject","newValue","dataDocument","toDeleteSt","toInsertSt","objectFromNewValue","statement","err","rdf_input_default"],"sources":["../../src/lib/forms/rdfFormsHelper.ts","../../src/lib/forms/fieldParams.ts","../../src/lib/forms/store/NoopStore.ts","../../src/lib/forms/store/StoreContext.ts","../../src/components/rdf-input/RDFInput.ts","../../src/components/rdf-input/index.ts"],"sourcesContent":["import { sym, LiveStore, parse } from 'rdflib'\nimport type { Term } from 'rdflib/lib/tf-types'\n// eslint-disable-next-line camelcase\nimport type { Quad_Subject, NamedNode } from 'rdflib/lib/tf-types'\nimport ns from '../../lib/ns'\n\nconst baseUri = 'https://solidos.github.io/solid-ui/src/ontology/'\n\nexport function loadDocument (\n store: LiveStore,\n documentSource: string,\n documentName: string,\n documentURI?: string,\n preferRemote = false\n) {\n const finalDocumentUri = documentURI || baseUri + documentName // Full URI to the file\n const document = sym(finalDocumentUri) // rdflib NamedNode for the document\n\n if (store.holds(undefined, undefined, undefined, document)) {\n store.removeStatements(store.statementsMatching(undefined, undefined, undefined, document))\n }\n\n const parseSource = () => {\n return new Promise<void>((resolve, reject) => {\n parse(documentSource, store, finalDocumentUri, 'text/turtle', (err) => {\n if (err) {\n console.error('Parse document error for ', finalDocumentUri, err)\n reject(err)\n } else {\n resolve()\n }\n })\n })\n }\n\n if (preferRemote && documentURI) {\n return store.fetcher.load(documentURI, {\n force: true,\n clearPreviousData: true,\n }).then(() => {}).catch((err) => {\n if (documentSource && documentSource.trim().length > 0) {\n return parseSource()\n }\n throw err\n })\n }\n\n if (documentSource && documentSource.trim().length > 0) {\n return parseSource()\n }\n\n if (documentURI) {\n return store.fetcher.load(documentURI, {\n force: true,\n clearPreviousData: true,\n }).then(() => {})\n }\n\n return Promise.reject(new Error(`No document source or URI for ${documentName}`))\n}\n\nexport async function fetchData (\n store: LiveStore,\n documentURI: string\n) {\n const document = sym(documentURI) // rdflib NamedNode for the document\n\n if (store.holds(undefined, undefined, undefined, document)) {\n store.removeStatements(store.statementsMatching(undefined, undefined, undefined, document))\n }\n\n return await store.fetcher.load(documentURI, {\n force: true,\n clearPreviousData: true,\n })\n}\n\nexport function sortBySequence (\n store: LiveStore,\n list: Term[]\n) {\n const subfields = list.map((p) => {\n const k = store.any(p as any, ns.ui('sequence'))\n const seq = k ? Number((k as { value: string }).value) : 9999\n return [Number.isNaN(seq) ? 9999 : seq, p] as const\n })\n\n subfields.sort((a, b) => a[0] - b[0])\n\n return subfields.map(pair => pair[1])\n}\n\n/**\n * Which class of field is this? Relies on http://www.w3.org/2000/01/rdf-schema#subClassOf and\n * https://linkeddata.github.io/rdflib.js/doc/classes/formula.html#bottomtypeuris\n * to find the most specific RDF type if there are multiple.\n *\n * @param subject a form field, e.g. `namedNode('https://timbl.com/timbl/Public/Test/Forms/individualForm.ttl#fullNameField')`\n * @returns the URI of the most specific known class, e.g. `http://www.w3.org/ns/ui#SingleLineTextField`\n */\n// eslint-disable-next-line camelcase\nexport function mostSpecificClassURI (store: LiveStore, subject: Quad_Subject): string {\n const typeUri = store.findTypeURIs(subject)\n const specificTypes = store.bottomTypeURIs(typeUri) // most specific\n const finalTypes: any[] = []\n for (const t in specificTypes) finalTypes.push(t)\n // if (finalTypes.length > 1) throw \"Didn't expect \"+subject+\" to have multiple bottom types: \"+finalTypes\n return finalTypes[0]\n}\n\n// Find the first ui:Form node in a store, optionally matching a fragment.\n// code based on Jeff Zucker's sol-components: https://github.com/jeff-zucker/sol-components (core/form-utils.js)\nexport function findForm (store: LiveStore, sourceUri: string): NamedNode | null {\n const docUrl = sourceUri.split('#')[0]\n const fragment = sourceUri.includes('#') ? sourceUri.split('#')[1] : null\n if (fragment) {\n const candidate = sym(docUrl + '#' + fragment)\n if (store.holds(candidate, ns.rdf('type'), ns.ui('Form'))) return candidate\n }\n const forms = store.each(null, ns.rdf('type'), ns.ui('Form'))\n const found = forms.find((term) => term.termType === 'NamedNode')\n return found ? (found as NamedNode) : null\n}\n","import ns from '../../lib/ns'\nimport { style } from '../../lib/style'\n\nexport type InputType =\n | 'hidden'\n | 'text'\n | 'search'\n | 'tel'\n | 'url'\n | 'email'\n | 'password'\n | 'datetime'\n | 'date'\n | 'month'\n | 'week'\n | 'time'\n | 'datetime-local'\n | 'number'\n | 'range'\n | 'color'\n | 'checkbox'\n | 'radio'\n | 'file'\n | 'submit'\n | 'image'\n | 'reset'\n | 'button'\n\nexport type FieldParamsObject = {\n size?: number, // input element size attribute\n type?: InputType, // input element type attribute. Default: 'text' (not for Comment and Heading)\n element?: string, // element type to use (Comment and Heading only)\n style?: string, // style to use\n dt?: string, // xsd data type for the RDF Literal corresponding to the field value. Default: xsd:string\n defaultInputValue?: string, // e.g. 'mailto:'. Default value in input field, will be removed when displaying actual value to user.\n namedNode?: boolean, // if true, field value corresponds to the URI of an RDF NamedNode. Overrides dt and defaultInputValue.\n pattern?: RegExp // for client-side input validation; field will go red if violated, green if ok\n}\n\n/**\n * The fieldParams object defines various constants\n * for use in various form fields. Depending on the\n * field in questions, different values may be read\n * from here.\n */\nexport const fieldParams: { [ fieldUri: string ]: FieldParamsObject } = {\n /**\n * Text field\n *\n * For possible date popups see e.g. http://www.dynamicdrive.com/dynamicindex7/jasoncalendar.htm\n * or use HTML5: http://www.w3.org/TR/2011/WD-html-markup-20110113/input.date.html\n */\n [ns.ui('ColorField').uri]: {\n size: 9,\n type: 'color',\n style: 'height: 3em;', // around 1.5em is padding\n dt: 'color',\n pattern: /^\\s*#[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]([0-9a-f][0-9a-f])?\\s*$/\n }, // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/color\n\n [ns.ui('DateField').uri]: {\n size: 20,\n type: 'date',\n dt: 'date',\n pattern: /^\\s*[0-9][0-9][0-9][0-9](-[0-1]?[0-9]-[0-3]?[0-9])?Z?\\s*$/\n },\n\n [ns.ui('DateTimeField').uri]: {\n size: 20,\n type: 'datetime-local', // See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime\n dt: 'dateTime',\n pattern: /^\\s*[0-9][0-9][0-9][0-9](-[0-1]?[0-9]-[0-3]?[0-9])?(T[0-2][0-9]:[0-5][0-9](:[0-5][0-9])?)?Z?\\s*$/\n },\n\n [ns.ui('TimeField').uri]: {\n size: 10,\n type: 'time',\n dt: 'time',\n pattern: /^\\s*([0-2]?[0-9]:[0-5][0-9](:[0-5][0-9])?)\\s*$/\n },\n\n [ns.ui('IntegerField').uri]: {\n size: 12,\n style: 'text-align: right;',\n dt: 'integer',\n pattern: /^\\s*-?[0-9]+\\s*$/\n },\n\n [ns.ui('DecimalField').uri]: {\n size: 12,\n style: 'text-align: right;',\n dt: 'decimal',\n pattern: /^\\s*-?[0-9]*(\\.[0-9]*)?\\s*$/\n },\n\n [ns.ui('FloatField').uri]: {\n size: 12,\n style: 'text-align: right;',\n dt: 'float',\n pattern: /^\\s*-?[0-9]*(\\.[0-9]*)?((e|E)-?[0-9]*)?\\s*$/\n },\n\n [ns.ui('SingleLineTextField').uri]: {\n\n },\n [ns.ui('NamedNodeURIField').uri]: {\n namedNode: true\n },\n [ns.ui('TextField').uri]: {\n\n },\n\n [ns.ui('PhoneField').uri]: {\n size: 20,\n defaultInputValue: 'tel:',\n pattern: /^\\+?[\\d-]+[\\d]*$/\n },\n\n [ns.ui('EmailField').uri]: {\n size: 30,\n defaultInputValue: 'mailto:',\n pattern: /^\\s*.*@.*\\..*\\s*$/ // @@ Get the right regexp here\n },\n\n [ns.ui('Group').uri]: {\n style: style.formGroupStyle\n },\n\n /**\n * Non-interactive fields\n */\n [ns.ui('Comment').uri]: {\n element: 'p',\n style: style.commentStyle\n },\n [ns.ui('Heading').uri]: {\n element: 'h3',\n style: style.formHeadingStyle\n }\n}\n","import { LiveStore } from 'rdflib'\nimport { StoreContext } from './StoreContext'\n\nexport default class NoopStore implements StoreContext {\n get store (): LiveStore {\n throw new Error('Cannot use RDF forms without a store')\n }\n}\n","import { createContext } from '@lit/context'\nimport { LiveStore } from 'rdflib'\nimport NoopStore from './NoopStore'\n\nexport interface StoreContext {\n store: LiveStore\n}\n\nexport const DEFAULT_STORE = new NoopStore()\nexport const storeContext = createContext<StoreContext>(Symbol('storeContext'))\n","import { property, state } from 'lit/decorators.js'\nimport { html } from 'lit/html.js'\nimport ns from '../../lib/ns'\nimport { customElement, generateId, WebComponent } from '@/lib/components'\nimport { Literal, NamedNode, st } from 'rdflib'\nimport { label } from '../../utils'\nimport { mostSpecificClassURI } from '../../lib/forms/rdfFormsHelper'\nimport { FieldParamsObject, fieldParams as fieldTypeParams, InputType } from '../../lib/forms/fieldParams'\nimport { DEFAULT_STORE, storeContext, StoreContext } from '@/lib/forms/store/StoreContext'\nimport { consume } from '@lit/context'\nimport '@/components/input'\n\n@customElement('solid-ui-rdf-input')\nexport default class RDFInput extends WebComponent {\n // example RDF Turtle format source:\n // :nameField a ui:SingleLineTextField ;\n // ui:property vcard:fn;\n // ui:label \"name\" .\n\n // formSubject describes the field metadata\n // dataSubject points to the data resource containing the value\n\n @consume({ context: storeContext, subscribe: true })\n private accessor storeContext: StoreContext = DEFAULT_STORE\n\n @property({ attribute: false, type: Object })\n accessor formSubject: NamedNode | null = null\n\n @property({ attribute: false, type: Object })\n accessor dataSubject: NamedNode | null = null\n\n @property({ type: Number })\n accessor storeVersion = 0\n\n @state()\n private accessor localInputValue: string | null = null\n\n private _updateInFlight = false\n private _pendingUpdateValue: string | null = null\n\n @property({ type: Boolean, reflect: true })\n accessor readonly: boolean = true // to protect data, we default to not editable\n\n constructor () {\n super()\n\n this.id = generateId()\n }\n\n render () {\n const formDocument = this.getDocument(this.formSubject)\n\n // for building the HTML input element\n const uiPropertyTerm = this.getFormProperty(this.formSubject, ns.ui('property'), formDocument)\n const inputLabel = this.getInputLabel(this.formSubject, uiPropertyTerm, formDocument)\n const readonly = this.getReadOnly(this.readonly, this.formSubject, formDocument)\n\n const fieldType = this.formSubject ? mostSpecificClassURI(this.storeContext.store, this.formSubject) : undefined\n const params = fieldType ? fieldTypeParams[fieldType] ?? {} : {}\n const inputType: InputType = params.type ?? 'text'\n\n // for populating the HTML input element\n const selectedTerm = this.getSelectedTerm(this.dataSubject, uiPropertyTerm, this.formSubject, params)\n const placeholder = readonly ? '' : this.defaultInputValue(params)\n const inputValue = this._updateInFlight || this._pendingUpdateValue !== null\n ? this.localInputValue ?? ''\n : this.termToInputValue(selectedTerm)\n\n return html`\n <solid-ui-input\n label=\"${inputLabel}\"\n name=\"name-${this.id}\"\n .value=${inputValue}\n .placeholder=${placeholder}\n type=\"${inputType}\"\n ?readonly=${readonly}\n @input=${this.updateData}\n ></solid-ui-input>`\n }\n\n private getDocument (subject: NamedNode | null | undefined) {\n return subject?.doc ? subject.doc() : undefined\n }\n\n private getFormProperty (subject: NamedNode | null | undefined, property: NamedNode, graph?: any): NamedNode | undefined {\n if (!subject) return undefined\n return this.storeContext.store.any(subject, property, null, graph) as NamedNode | undefined\n }\n\n private getInputLabel (formFieldSubject: NamedNode | null | undefined, uiPropertyTerm?: NamedNode, graph?: any): string {\n if (!formFieldSubject) return ''\n const uiLabel = this.storeContext.store.any(formFieldSubject, ns.ui('label'), null, graph)\n const propertyLabel = uiPropertyTerm ? label(uiPropertyTerm, true) : ''\n return uiLabel ? uiLabel.value : propertyLabel\n }\n\n private getReadOnly (readonly: boolean, formFieldSubject?: NamedNode | null, graph?: any): boolean {\n if (formFieldSubject && readonly === false) { // if readonly is false, we can ovverride it if the field is marked as uneditable in the form\n return !!this.storeContext.store.anyJS(formFieldSubject, ns.ui('suppressEmptyUneditable'), null, graph)\n }\n return readonly\n }\n\n private getSelectedTerm (\n dataSubject?: NamedNode | null,\n uiPropertyTerm?: NamedNode,\n formFieldSubject?: NamedNode | null,\n params?: { defaultInputValue?: string }\n ) {\n const defaultTerm = formFieldSubject\n ? this.storeContext.store.any(formFieldSubject, ns.ui('default'))\n : undefined\n\n if (!uiPropertyTerm || !dataSubject) {\n return defaultTerm\n }\n\n const inputTerm = this.storeContext.store.any(dataSubject, uiPropertyTerm)\n return inputTerm || defaultTerm\n }\n\n private termToInputValue (term: any) {\n if (!term || !('value' in term) || !term.value) return ''\n\n try {\n return decodeURIComponent(term.value)\n } catch {\n return String(term.value)\n }\n }\n\n private defaultInputValue (params: { defaultInputValue?: string } = {}) {\n const stripped = params.defaultInputValue ?? ''\n return stripped.replace(/ /g, '')\n }\n\n private async updateData (e: CustomEvent) {\n const newValue = (e.target as HTMLInputElement).value\n this.localInputValue = newValue\n this._pendingUpdateValue = newValue\n\n if (this._updateInFlight) {\n return\n }\n\n await this.runPendingUpdate()\n }\n\n private async runPendingUpdate () {\n if (this._pendingUpdateValue === null) {\n return\n }\n\n const newValue = this._pendingUpdateValue\n this._pendingUpdateValue = null\n this._updateInFlight = true\n\n const uiPropertyTerm = this.getFormProperty(this.formSubject, ns.ui('property'), this.getDocument(this.formSubject))\n if (!uiPropertyTerm || !this.dataSubject) {\n this._updateInFlight = false\n this.localInputValue = ''\n return\n }\n\n const dataDocument = this.getDocument(this.dataSubject)\n if (dataDocument && this.storeContext.store.updater?.editable(dataDocument) === false) {\n this._updateInFlight = false\n return\n }\n\n const toDeleteSt = this.storeContext.store.statementsMatching(this.dataSubject, uiPropertyTerm)\n let toInsertSt: Array<ReturnType<typeof st>> = []\n\n if (newValue) {\n let objectFromNewValue\n const fieldType = this.formSubject ? mostSpecificClassURI(this.storeContext.store, this.formSubject) : undefined\n const params: FieldParamsObject = fieldType ? fieldTypeParams[fieldType] ?? {} : {}\n if (params.namedNode) {\n objectFromNewValue = this.storeContext.store.sym(newValue)\n } else if (params.defaultInputValue) {\n objectFromNewValue = encodeURIComponent(newValue.replace(/ /g, ''))\n objectFromNewValue = this.storeContext.store.sym(params.defaultInputValue + objectFromNewValue)\n } else {\n if (params.dt) {\n objectFromNewValue = new Literal(\n newValue.trim(),\n undefined,\n ns.xsd(params.dt)\n )\n } else {\n objectFromNewValue = new Literal(newValue)\n }\n }\n toInsertSt = toDeleteSt.map((statement) => st(statement.subject, statement.predicate, objectFromNewValue, statement.why))\n if (toInsertSt.length === 0) {\n toInsertSt = [st(this.dataSubject, uiPropertyTerm, objectFromNewValue, this.getDocument(this.dataSubject))]\n }\n }\n\n try {\n await this.storeContext.store.updater.updateMany(toDeleteSt, toInsertSt as any)\n this.storeVersion += 1\n } catch (err) {\n console.error('RDFInput update failed', err)\n } finally {\n this._updateInFlight = false\n }\n\n if (this._pendingUpdateValue !== null) {\n await this.runPendingUpdate()\n }\n }\n}\n","import RDFInput from './RDFInput'\n\nexport { RDFInput }\nexport default RDFInput\n"],"mappings":";;;;;AA6DA,eAAsBgC,EACpB3B,GACAG,GACA;CACA,IAAMG,IAAWX,EAAIQ,CAAW;CAMhC,OAJIH,EAAMO,MAAMC,KAAAA,GAAWA,KAAAA,GAAWA,KAAAA,GAAWF,CAAQ,KACvDN,EAAMS,iBAAiBT,EAAMU,mBAAmBF,KAAAA,GAAWA,KAAAA,GAAWA,KAAAA,GAAWF,CAAQ,CAAC,GAGrF,MAAMN,EAAMkB,QAAQC,KAAKhB,GAAa;EAC3CiB,OAAO;EACPC,mBAAmB;CACrB,CAAC;AACH;AAEA,SAAgBO,EACd5B,GACA6B,GACA;CACA,IAAMC,IAAYD,EAAKE,KAAKC,MAAM;EAChC,IAAMC,IAAIjC,EAAMkC,IAAIF,GAAUnC,EAAGsC,GAAG,UAAU,CAAC,GACzCC,IAAMH,IAAII,OAAQJ,EAAwBK,KAAK,IAAI;EACzD,OAAO,CAACD,OAAOE,MAAMH,CAAG,IAAI,OAAOA,GAAKJ,CAAC;CAC3C,CAAC;CAID,OAFAF,EAAUU,MAAMC,GAAGC,MAAMD,EAAE,KAAKC,EAAE,EAAE,GAE7BZ,EAAUC,KAAIY,MAAQA,EAAK,EAAE;AACtC;AAWA,SAAgBC,EAAsB5C,GAAkB6C,GAA+B;CACrF,IAAMC,IAAU9C,EAAM+C,aAAaF,CAAO,GACpCG,IAAgBhD,EAAMiD,eAAeH,CAAO,GAC5CI,IAAoB,CAAA;CAC1B,KAAK,IAAMC,KAAKH,GAAeE,EAAWE,KAAKD,CAAC;CAEhD,OAAOD,EAAW;AACpB;AAIA,SAAgBG,EAAUrD,GAAkBsD,GAAqC;CAC/E,IAAMC,IAASD,EAAUE,MAAM,GAAG,CAAC,CAAC,I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,EAAG6G,EAAUlC,SAASkC,EAAUC,WAAWT,GAAoBQ,EAAUE,GAAG,CAAC,GACpHX,EAAWY,WAAW,MACxBZ,IAAa,CAACpG,EAAG,KAAKqC,aAAakB,GAAgB8C,GAAoB,KAAK/C,YAAY,KAAKjB,WAAW,CAAC,CAAC;EAE9G;EAEA,IAAI;GAEF,AADA,MAAM,KAAK/B,aAAawD,MAAMkC,QAAQiB,WAAWf,GAAYE,CAAiB,GAC9E,KAAK9D,gBAAgB;EACvB,SAAS4E,GAAK;GACZC,QAAQC,MAAM,0BAA0BF,CAAG;EAC7C,UAAU;GACR,KAAK3C,kBAAkB;EACzB;EAEA,AAAI,KAAKC,wBAAwB,QAC/B,MAAM,KAAKsB,iBAAiB;CAEhC;AACF,GAAC,CAAAH,GAAA,CAAA/C,GAAAC,GAAAC,GAAAC,GAAAC,GAAAE,GAAAP,IAAA2E,GAAA,CAAA7G,GAAA8G,MAAAC,EAAAH,GAAA;CAAA;EAAAnG;EAAA;EAAA;CAAA;CAAA;EAAAG;EAAA;EAAA;CAAA;CAAA;EAAAI;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;CAAA;EAAAE;EAAA;EAAA;CAAA;CAAA;EAAAC;EAAA;EAAA;CAAA;AAAA,GAAArB,GAAA,GAAA,KAAA,GAvMqCV,CAAY,GAAAyH,EAAA;;ACVlD,IAAAqI,KAAe7H"}
@@ -1,5 +1,5 @@
1
- import { a as e, o as t } from "./auth-CocCqS1p.js";
2
- import { b as n, g as r, o as i, u as a } from "./components-C8c2Ucm5.js";
1
+ import { b as e, g as t, o as n, u as r } from "./components-C8c2Ucm5.js";
2
+ import { a as i, o as a } from "./auth-EK-iYNYZ.js";
3
3
  import "./button-D6qO2idW.js";
4
4
  // src/components/signup-button/SignupButton.ts
5
5
  var o, s, c, l, u, d, f;
@@ -163,14 +163,14 @@ function S(e) {
163
163
  if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (e === null ? "null" : typeof e));
164
164
  return e;
165
165
  }
166
- l = [r("solid-ui-signup-button")];
166
+ l = [t("solid-ui-signup-button")];
167
167
  var C, w = /*#__PURE__*/ new WeakMap();
168
- f = (u = n({
169
- context: t,
168
+ f = (u = e({
169
+ context: a,
170
170
  subscribe: !0
171
- }), "auth"), o = class extends i {
172
- constructor(...t) {
173
- super(...t), p(this, w, (s(this), d(this, e)));
171
+ }), "auth"), o = class extends n {
172
+ constructor(...e) {
173
+ super(...e), p(this, w, (s(this), d(this, i)));
174
174
  }
175
175
  get [f]() {
176
176
  return g(w, this);
@@ -179,7 +179,7 @@ f = (u = n({
179
179
  h(w, this, e);
180
180
  }
181
181
  render() {
182
- return a`
182
+ return r`
183
183
  <slot name="trigger" @click=${this.onClick}>
184
184
  <solid-ui-button>
185
185
  <slot>
@@ -199,9 +199,9 @@ f = (u = n({
199
199
  u,
200
200
  1,
201
201
  "auth"
202
- ]], l, 0, void 0, i), c();
202
+ ]], l, 0, void 0, n), c();
203
203
  // src/components/signup-button/index.ts
204
204
  var T = C;
205
205
  export { C as n, T as t };
206
206
 
207
- //# sourceMappingURL=signup-button-CexdMWj6.js.map
207
+ //# sourceMappingURL=signup-button-DOInssOu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"signup-button-CexdMWj6.js","names":["customElement","WebComponent","consume","html","authContext","DEFAULT_AUTH_CONTEXT","_classDecs","_SignupButton","_A","WeakMap","_ref","_authDecs","context","subscribe","SignupButton","constructor","args","_classPrivateFieldInitSpec","_initProto","_init_auth","_classPrivateFieldGet","auth","v","_classPrivateFieldSet","render","onClick","click","signup","e","preventDefault","_SignupButton2","c","_initClass","_applyDecs","default","consume","SignupButton","SignupButton","DEFAULT_AUTH_CONTEXT","authContext","c","customElement","WebComponent","b","_SignupButton2","_initProto","_initClass","_classDecs","_authDecs","_init_auth","_ref","_classPrivateFieldInitSpec","a","_checkPrivateRedeclaration","_classPrivateFieldSet","s","_assertClassBrand","r","_classPrivateFieldGet","_applyDecs","i","n","o","applyDec","m","h","y","v","g","u","w","A","d","p","_setFunctionName","P","j","D","E","I","O","k","F","l","f","N","_checkInRHS","_toPropertyKey","_toPrimitive","t","e","_SignupButton","_A","args","signup_button_default"],"sources":["../../src/components/signup-button/SignupButton.ts","../../src/components/signup-button/index.ts"],"sourcesContent":["import { customElement, WebComponent } from '@/lib/components'\nimport { consume } from '@lit/context'\nimport { html } from 'lit'\nimport { authContext, AuthContext, DEFAULT_AUTH_CONTEXT } from '@/lib/auth'\n\nimport '@/components/button'\n\n@customElement('solid-ui-signup-button')\nexport default class SignupButton extends WebComponent {\n @consume({ context: authContext, subscribe: true })\n private accessor auth: AuthContext = DEFAULT_AUTH_CONTEXT\n\n protected render () {\n return html`\n <slot name=\"trigger\" @click=${this.onClick}>\n <solid-ui-button>\n <slot>\n Sign Up\n </slot>\n </solid-ui-button>\n </slot>\n `\n }\n\n click () {\n this.auth.signup()\n }\n\n private onClick (e: MouseEvent) {\n e.preventDefault()\n\n this.click()\n }\n}\n","import SignupButton from './SignupButton'\n\nexport { SignupButton }\nexport default SignupButton\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAK4BM,IAAA,CAE3BN,EAAc,wBAAwB,CAAC;AAAA,IAAAO,GAAAC,kBAAA,IAAAC,QAAA;AAAAC,KAAAC,IAErCT,EAAQ;CAAEU,SAASR;CAAaS,WAAW;AAAK,CAAC,GAAC,SAwBpDiB,IAAAhB,cAzByCb,EAAa;CAAAc,YAAA,GAAAC,GAAA;EAAAC,AAAA,MAAA,GAAAD,CAAA,GAAAC,EAAA,MAAAT,IAAAU,EAAA,IAAA,GAAAC,EAAA,MAEhBd,CAAoB,EAAA;CAAA;CAAA,KAAAK,KAAA;EAAA,OAAAU,EAAAZ,GAAA,IAAA;CAAA;CAAA,IAAxCa,KAAIC,GAAA;EAAAC,EAAAf,GAAA,MAAAc,CAAA;CAAA;CAEXE,SAAU;EAClB,OAAOrB,CAAI;oCACqB,KAAKsB,QAAO;;;;;;;;CAQ9C;CAEAC,QAAS;EACP,KAAKL,KAAKM,OAAO;CACnB;CAEQF,QAASG,GAAe;EAG9B,AAFAA,EAAEC,eAAe,GAEjB,KAAKH,MAAM;CACb;AACF,GAAC,CAAAE,GAAA,CAAAT,GAAAD,IAAAa,GAAA,CAAAxB,GAAAyB,MAAAC,EAAAH,GAAA,CAAA;CAAAnB;CAAA;CAAA;AAAA,CAAA,GAAAL,GAAA,GAAA,KAAA,GAzByCL,CAAY,GAAA+B,EAAA;;ACLtD,IAAA8D,IAAe1D"}
1
+ {"version":3,"file":"signup-button-DOInssOu.js","names":["customElement","WebComponent","consume","html","authContext","DEFAULT_AUTH_CONTEXT","_classDecs","_SignupButton","_A","WeakMap","_ref","_authDecs","context","subscribe","SignupButton","constructor","args","_classPrivateFieldInitSpec","_initProto","_init_auth","_classPrivateFieldGet","auth","v","_classPrivateFieldSet","render","onClick","click","signup","e","preventDefault","_SignupButton2","c","_initClass","_applyDecs","default","consume","SignupButton","SignupButton","c","customElement","WebComponent","b","DEFAULT_AUTH_CONTEXT","authContext","_SignupButton2","_initProto","_initClass","_classDecs","_authDecs","_init_auth","_ref","_classPrivateFieldInitSpec","a","_checkPrivateRedeclaration","_classPrivateFieldSet","s","_assertClassBrand","r","_classPrivateFieldGet","_applyDecs","i","n","o","applyDec","m","h","y","v","g","u","w","A","d","p","_setFunctionName","P","j","D","E","I","O","k","F","l","f","N","_checkInRHS","_toPropertyKey","_toPrimitive","t","e","_SignupButton","_A","args","signup_button_default"],"sources":["../../src/components/signup-button/SignupButton.ts","../../src/components/signup-button/index.ts"],"sourcesContent":["import { customElement, WebComponent } from '@/lib/components'\nimport { consume } from '@lit/context'\nimport { html } from 'lit'\nimport { authContext, AuthContext, DEFAULT_AUTH_CONTEXT } from '@/lib/auth'\n\nimport '@/components/button'\n\n@customElement('solid-ui-signup-button')\nexport default class SignupButton extends WebComponent {\n @consume({ context: authContext, subscribe: true })\n private accessor auth: AuthContext = DEFAULT_AUTH_CONTEXT\n\n protected render () {\n return html`\n <slot name=\"trigger\" @click=${this.onClick}>\n <solid-ui-button>\n <slot>\n Sign Up\n </slot>\n </solid-ui-button>\n </slot>\n `\n }\n\n click () {\n this.auth.signup()\n }\n\n private onClick (e: MouseEvent) {\n e.preventDefault()\n\n this.click()\n }\n}\n","import SignupButton from './SignupButton'\n\nexport { SignupButton }\nexport default SignupButton\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAK4BM,IAAA,CAE3BN,EAAc,wBAAwB,CAAC;AAAA,IAAAO,GAAAC,kBAAA,IAAAC,QAAA;AAAAC,KAAAC,IAErCT,EAAQ;CAAEU,SAASR;CAAaS,WAAW;AAAK,CAAC,GAAC,SAwBpDiB,IAAAhB,cAzByCb,EAAa;CAAAc,YAAA,GAAAC,GAAA;EAAAC,AAAA,MAAA,GAAAD,CAAA,GAAAC,EAAA,MAAAT,IAAAU,EAAA,IAAA,GAAAC,EAAA,MAEhBd,CAAoB,EAAA;CAAA;CAAA,KAAAK,KAAA;EAAA,OAAAU,EAAAZ,GAAA,IAAA;CAAA;CAAA,IAAxCa,KAAIC,GAAA;EAAAC,EAAAf,GAAA,MAAAc,CAAA;CAAA;CAEXE,SAAU;EAClB,OAAOrB,CAAI;oCACqB,KAAKsB,QAAO;;;;;;;;CAQ9C;CAEAC,QAAS;EACP,KAAKL,KAAKM,OAAO;CACnB;CAEQF,QAASG,GAAe;EAG9B,AAFAA,EAAEC,eAAe,GAEjB,KAAKH,MAAM;CACb;AACF,GAAC,CAAAE,GAAA,CAAAT,GAAAD,IAAAa,GAAA,CAAAxB,GAAAyB,MAAAC,EAAAH,GAAA,CAAA;CAAAnB;CAAA;CAAA;AAAA,CAAA,GAAAL,GAAA,GAAA,KAAA,GAzByCL,CAAY,GAAA+B,EAAA;;ACLtD,IAAA8D,IAAe1D"}
@@ -7877,7 +7877,7 @@ function Tn(e, t) {
7877
7877
  return e.rdfFactory.collection(t.map((t) => Cn(e, t)));
7878
7878
  }
7879
7879
  async function En(e, t, n) {
7880
- let r = n && Object.prototype.hasOwnProperty.call(n, "termType") ? n.value : n, i = await import("./jsonld-D-TE94B0.js").then((e) => /* @__PURE__ */ u(e.default));
7880
+ let r = n && Object.prototype.hasOwnProperty.call(n, "termType") ? n.value : n, i = await import("./jsonld-C6IOQ1Tg.js").then((e) => /* @__PURE__ */ u(e.default));
7881
7881
  return (await (i.default || i).flatten(JSON.parse(e), null, { base: r })).reduce((e, t) => On(e, n, t), t);
7882
7882
  }
7883
7883
  function Dn(e, t) {
@@ -17113,7 +17113,24 @@ function Nf(e, t, n, r) {
17113
17113
  let n = e.uri.slice(t.uri.length);
17114
17114
  return n.startsWith(".") || n.endsWith(".acl") || n.endsWith(".meta") || n.endsWith("~");
17115
17115
  }
17116
- function f(e) {
17116
+ function f(t, n) {
17117
+ let r = e.findTypeURIs(t), i = n.toLowerCase(), a = et(`${i}/*`).uri.split("*")[0];
17118
+ return Object.keys(r).some((e) => e.startsWith(a)) || {
17119
+ audio: "http://purl.org/dc/dcmitype/Sound",
17120
+ image: "http://purl.org/dc/dcmitype/Image",
17121
+ video: "http://purl.org/dc/dcmitype/MovingImage"
17122
+ }[i] in r ? !0 : (e.fetcher.getHeader(t, "content-type") || []).some((e) => e.split(";", 1)[0].trim().toLowerCase().startsWith(`${i}/`));
17123
+ }
17124
+ function p(e) {
17125
+ return f(e, "image");
17126
+ }
17127
+ function m(e) {
17128
+ return f(e, "audio");
17129
+ }
17130
+ function h(e) {
17131
+ return f(e, "video");
17132
+ }
17133
+ function g(e) {
17117
17134
  let t = typeof e == "string" ? e : e.value;
17118
17135
  try {
17119
17136
  let e = new URL(t);
@@ -17122,7 +17139,7 @@ function Nf(e, t, n, r) {
17122
17139
  return !1;
17123
17140
  }
17124
17141
  }
17125
- function p(t, n) {
17142
+ function _(t, n) {
17126
17143
  let r, i = !1, a = !1, o = !1, s = !1, c, l;
17127
17144
  if (n.headers) {
17128
17145
  r = n.headers.get("content-type")?.split(";")[0] ?? void 0;
@@ -17154,32 +17171,32 @@ function Nf(e, t, n, r) {
17154
17171
  modified: l
17155
17172
  };
17156
17173
  }
17157
- async function m(t) {
17174
+ async function v(t) {
17158
17175
  let n = await e.fetcher.webOperation("HEAD", t.uri);
17159
- return kf(n, "HEAD"), p(t, n);
17176
+ return kf(n, "HEAD"), _(t, n);
17160
17177
  }
17161
- async function h(t) {
17178
+ async function y(t) {
17162
17179
  let n = e.any(t, X.ldp("contains")) || t.dir();
17163
17180
  if (!n || n.termType !== "NamedNode") return !1;
17164
17181
  try {
17165
- return (await m(n)).access.canEdit;
17182
+ return (await v(n)).access.canEdit;
17166
17183
  } catch {
17167
17184
  return !1;
17168
17185
  }
17169
17186
  }
17170
- async function g(e) {
17171
- return h(e);
17187
+ async function b(e) {
17188
+ return y(e);
17172
17189
  }
17173
- async function _(e) {
17174
- return m(e);
17190
+ async function x(e) {
17191
+ return v(e);
17175
17192
  }
17176
- async function v(t) {
17193
+ async function S(t) {
17177
17194
  try {
17178
17195
  let n = await e.fetcher.webOperation("GET", t.uri);
17179
17196
  kf(n, "GET");
17180
17197
  let r = n.responseText;
17181
17198
  if (r === void 0) throw Error("No text in response object");
17182
- let i = p(t, n);
17199
+ let i = _(t, n);
17183
17200
  if (!i.contentType) throw Error("No content-type available");
17184
17201
  return {
17185
17202
  content: r,
@@ -17189,10 +17206,10 @@ function Nf(e, t, n, r) {
17189
17206
  throw Error(`Error reading file: ${e instanceof Error ? e.message : String(e)}`);
17190
17207
  }
17191
17208
  }
17192
- async function y(e) {
17209
+ async function C(e) {
17193
17210
  let t;
17194
17211
  try {
17195
- t = await m(e);
17212
+ t = await v(e);
17196
17213
  } catch {
17197
17214
  t = {
17198
17215
  contentType: void 0,
@@ -17206,7 +17223,7 @@ function Nf(e, t, n, r) {
17206
17223
  modified: void 0
17207
17224
  };
17208
17225
  }
17209
- let n = await g(e), r = {
17226
+ let n = await b(e), r = {
17210
17227
  canEdit: t.access?.canEdit ?? !1,
17211
17228
  canManageAccess: t.access?.canManageAccess ?? !1,
17212
17229
  isPublic: t.access?.isPublic ?? !1,
@@ -17218,16 +17235,16 @@ function Nf(e, t, n, r) {
17218
17235
  access: r
17219
17236
  };
17220
17237
  }
17221
- async function b(e, t) {
17238
+ async function w(e, t) {
17222
17239
  if (t) try {
17223
17240
  await r.deleteTypeIndexRegistrationForResource(e, t);
17224
17241
  } catch {}
17225
17242
  }
17226
- async function x(t, r = {}) {
17243
+ async function T(t, r = {}) {
17227
17244
  let i = t.dir();
17228
17245
  if (a(t)) {
17229
17246
  let e = await n.getContainerMembers(t);
17230
- await Promise.all(e.map((e) => x(Si(e), r)));
17247
+ await Promise.all(e.map((e) => T(Si(e), r)));
17231
17248
  }
17232
17249
  let o;
17233
17250
  try {
@@ -17235,20 +17252,20 @@ function Nf(e, t, n, r) {
17235
17252
  } catch (e) {
17236
17253
  if (!Af(e)) throw e;
17237
17254
  }
17238
- return r.deleteTypeIndexes && await b(t, r.user), i && e.removeMatches(i, X.ldp("contains"), t, i.doc()), e.removeDocument(t), e.fetcher.unload(t.doc()), o;
17255
+ return r.deleteTypeIndexes && await w(t, r.user), i && e.removeMatches(i, X.ldp("contains"), t, i.doc()), e.removeDocument(t), e.fetcher.unload(t.doc()), o;
17239
17256
  }
17240
- async function S(e, t) {
17241
- await x(e, {
17257
+ async function E(e, t) {
17258
+ await T(e, {
17242
17259
  deleteTypeIndexes: !0,
17243
17260
  user: t
17244
17261
  });
17245
17262
  }
17246
17263
  return {
17247
- recursiveDelete: x,
17248
- deleteResourceAndTypeIndexIfExists: S,
17249
- fetchMetadata: _,
17250
- fetchMetadataWithDelete: y,
17251
- fetchContentAndMetadata: v,
17264
+ recursiveDelete: T,
17265
+ deleteResourceAndTypeIndexIfExists: E,
17266
+ fetchMetadata: x,
17267
+ fetchMetadataWithDelete: C,
17268
+ fetchContentAndMetadata: S,
17252
17269
  createContainer: i,
17253
17270
  isContainer: a,
17254
17271
  getContainerMembers: s,
@@ -17257,7 +17274,11 @@ function Nf(e, t, n, r) {
17257
17274
  containerHasIndexDocument: l,
17258
17275
  isStorageRoot: u,
17259
17276
  isHiddenFile: d,
17260
- isWebId: f
17277
+ isMediaType: f,
17278
+ isImage: p,
17279
+ isAudio: m,
17280
+ isVideo: h,
17281
+ isWebId: g
17261
17282
  };
17262
17283
  }
17263
17284
  // node_modules/solid-logic/dist/util/containerLogic.esm.js
@@ -17700,4 +17721,4 @@ function Wf() {
17700
17721
  var Gf = Wf();
17701
17722
  export { fi as A, xe as B, yi as C, xi as D, Si as E, bt as F, o as G, R as H, et as I, u as J, c as K, Be as L, Kr as M, Ot as N, ji as O, Et as P, Ne as R, Ai as S, Ei as T, M as U, ye as V, s as W, ka as _, Go as a, gi as b, Yo as c, Io as d, zo as f, Aa as g, No as h, qo as i, li as j, Ci as k, Wo as l, Ro as m, ks as n, Jo as o, Mo as p, d as q, rs as r, Ko as s, Gf as t, Ho as u, aa as v, bi as w, vi as x, Fi as y, De as z };
17702
17723
 
17703
- //# sourceMappingURL=solidLogicSingleton.esm-BXyHD7mn.js.map
17724
+ //# sourceMappingURL=solidLogicSingleton.esm-Bvt7E7Vl.js.map