solid-ui 2.4.27 → 2.4.28-0f50605d

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 (121) hide show
  1. package/README.md +6 -1
  2. package/dist/670.solid-ui.min.js +1 -0
  3. package/dist/805.solid-ui.min.js +3 -0
  4. package/dist/805.solid-ui.min.js.LICENSE.txt +58 -0
  5. package/dist/805.solid-ui.min.js.map +1 -0
  6. package/dist/_2b19.solid-ui.js +14 -0
  7. package/dist/_2b19.solid-ui.js.map +1 -0
  8. package/dist/index.html +1 -9
  9. package/dist/{main.js → solid-ui.js} +9583 -21517
  10. package/dist/solid-ui.js.map +1 -0
  11. package/dist/solid-ui.min.js +3 -0
  12. package/dist/solid-ui.min.js.LICENSE.txt +54 -0
  13. package/dist/solid-ui.min.js.map +1 -0
  14. package/dist/vendors-node_modules_jsonld_lib_jsonld_js.solid-ui.js +12134 -0
  15. package/dist/vendors-node_modules_jsonld_lib_jsonld_js.solid-ui.js.map +1 -0
  16. package/lib/acl/access-controller.d.ts +2 -3
  17. package/lib/acl/access-controller.d.ts.map +1 -1
  18. package/lib/acl/access-controller.js +17 -15
  19. package/lib/acl/access-controller.js.map +1 -1
  20. package/lib/acl/access-groups.d.ts.map +1 -1
  21. package/lib/acl/access-groups.js +78 -8
  22. package/lib/acl/access-groups.js.map +1 -1
  23. package/lib/acl/acl-control.d.ts.map +1 -1
  24. package/lib/acl/acl-control.js +10 -11
  25. package/lib/acl/acl-control.js.map +1 -1
  26. package/lib/acl/acl.d.ts +1 -1
  27. package/lib/acl/acl.js +1 -1
  28. package/lib/acl/acl.js.map +1 -1
  29. package/lib/acl/add-agent-buttons.d.ts.map +1 -1
  30. package/lib/acl/add-agent-buttons.js +4 -3
  31. package/lib/acl/add-agent-buttons.js.map +1 -1
  32. package/lib/chat/bookmarks.js +6 -7
  33. package/lib/chat/bookmarks.js.map +1 -1
  34. package/lib/chat/chatLogic.js +288 -67
  35. package/lib/chat/chatLogic.js.map +1 -1
  36. package/lib/chat/dateFolder.js +129 -126
  37. package/lib/chat/dateFolder.js.map +1 -1
  38. package/lib/chat/infinite.js +637 -423
  39. package/lib/chat/infinite.js.map +1 -1
  40. package/lib/chat/keys.d.ts +13 -0
  41. package/lib/chat/keys.d.ts.map +1 -0
  42. package/lib/chat/keys.js +233 -0
  43. package/lib/chat/keys.js.map +1 -0
  44. package/lib/chat/message.js +361 -163
  45. package/lib/chat/message.js.map +1 -1
  46. package/lib/chat/messageTools.js +463 -277
  47. package/lib/chat/messageTools.js.map +1 -1
  48. package/lib/chat/signature.d.ts +22 -0
  49. package/lib/chat/signature.d.ts.map +1 -0
  50. package/lib/chat/signature.js +43 -0
  51. package/lib/chat/signature.js.map +1 -0
  52. package/lib/chat/thread.js +299 -209
  53. package/lib/chat/thread.js.map +1 -1
  54. package/lib/footer/index.d.ts.map +1 -1
  55. package/lib/footer/index.js +5 -1
  56. package/lib/footer/index.js.map +1 -1
  57. package/lib/header/index.d.ts.map +1 -1
  58. package/lib/header/index.js +46 -20
  59. package/lib/header/index.js.map +1 -1
  60. package/lib/log.js +5 -5
  61. package/lib/log.js.map +1 -1
  62. package/lib/login/login.d.ts.map +1 -1
  63. package/lib/login/login.js +63 -38
  64. package/lib/login/login.js.map +1 -1
  65. package/lib/pad.js +4 -1
  66. package/lib/pad.js.map +1 -1
  67. package/lib/participation.js +2 -1
  68. package/lib/participation.js.map +1 -1
  69. package/lib/preferences.js +4 -0
  70. package/lib/preferences.js.map +1 -1
  71. package/lib/style.js +60 -2
  72. package/lib/style.js.map +1 -1
  73. package/lib/utils/headerFooterHelpers.d.ts +0 -4
  74. package/lib/utils/headerFooterHelpers.d.ts.map +1 -1
  75. package/lib/utils/headerFooterHelpers.js +1 -26
  76. package/lib/utils/headerFooterHelpers.js.map +1 -1
  77. package/lib/utils/keyHelpers/accessData.d.ts +9 -0
  78. package/lib/utils/keyHelpers/accessData.d.ts.map +1 -0
  79. package/lib/utils/keyHelpers/accessData.js +110 -0
  80. package/lib/utils/keyHelpers/accessData.js.map +1 -0
  81. package/lib/utils/keyHelpers/acl.d.ts +20 -0
  82. package/lib/utils/keyHelpers/acl.d.ts.map +1 -0
  83. package/lib/utils/keyHelpers/acl.js +93 -0
  84. package/lib/utils/keyHelpers/acl.js.map +1 -0
  85. package/lib/utils/keyHelpers/otherHelpers.d.ts +3 -0
  86. package/lib/utils/keyHelpers/otherHelpers.d.ts.map +1 -0
  87. package/lib/utils/keyHelpers/otherHelpers.js +23 -0
  88. package/lib/utils/keyHelpers/otherHelpers.js.map +1 -0
  89. package/lib/versionInfo.js +6 -6
  90. package/lib/versionInfo.js.map +1 -1
  91. package/lib/widgets/buttons.d.ts.map +1 -1
  92. package/lib/widgets/buttons.js +43 -51
  93. package/lib/widgets/buttons.js.map +1 -1
  94. package/lib/widgets/forms/autocomplete/autocompleteBar.js +8 -1
  95. package/lib/widgets/forms/autocomplete/autocompleteBar.js.map +1 -1
  96. package/lib/widgets/forms/autocomplete/autocompletePicker.js +8 -3
  97. package/lib/widgets/forms/autocomplete/autocompletePicker.js.map +1 -1
  98. package/lib/widgets/forms/autocomplete/language.js +5 -0
  99. package/lib/widgets/forms/autocomplete/language.js.map +1 -1
  100. package/lib/widgets/forms.js +12 -5
  101. package/lib/widgets/forms.js.map +1 -1
  102. package/lib/widgets/peoplePicker.js +11 -0
  103. package/lib/widgets/peoplePicker.js.map +1 -1
  104. package/package.json +17 -11
  105. package/dist/main.js.map +0 -1
  106. package/lib/acl/styles.d.ts +0 -90
  107. package/lib/acl/styles.d.ts.map +0 -1
  108. package/lib/acl/styles.js +0 -98
  109. package/lib/acl/styles.js.map +0 -1
  110. package/lib/footer/styleMap.d.ts +0 -8
  111. package/lib/footer/styleMap.d.ts.map +0 -1
  112. package/lib/footer/styleMap.js +0 -15
  113. package/lib/footer/styleMap.js.map +0 -1
  114. package/lib/header/styleMap.d.ts +0 -117
  115. package/lib/header/styleMap.d.ts.map +0 -1
  116. package/lib/header/styleMap.js +0 -139
  117. package/lib/header/styleMap.js.map +0 -1
  118. package/lib/jss/index.d.ts +0 -20
  119. package/lib/jss/index.d.ts.map +0 -1
  120. package/lib/jss/index.js +0 -47
  121. package/lib/jss/index.js.map +0 -1
package/lib/style.js CHANGED
@@ -19,7 +19,7 @@ var formFieldNameBoxWidth = '8em'; // The fixed amount to get form fields to lin
19
19
  var style = {
20
20
  // styleModule
21
21
 
22
- checkboxStyle: 'colour: black; font-size: 100%; padding-left: 0.5 em; padding-right: 0.5 em;',
22
+ checkboxStyle: 'color: black; font-size: 100%; padding-left: 0.5 em; padding-right: 0.5 em;',
23
23
  checkboxInputStyle: 'font-size: 150%; height: 1.2em; width: 1.2em; background-color: #eef; border-radius:0.2em; margin: 0.1em',
24
24
  fieldLabelStyle: 'color: #3B5998; text-decoration: none;',
25
25
  formSelectSTyle: 'background-color: #eef; padding: 0.5em; border: .05em solid #88c; border-radius:0.2em; font-size: 100%; margin:0.4em;',
@@ -83,7 +83,65 @@ var style = {
83
83
  // Buttons
84
84
  renderAsDivStyle: 'display: flex; align-items: center; justify-content: space-between; height: 2.5em; padding: 1em;',
85
85
  imageDivStyle: 'width:2.5em; padding:0.5em; height: 2.5em;',
86
- linkDivStyle: 'width:2em; padding:0.5em; height: 4em;'
86
+ linkDivStyle: 'width:2em; padding:0.5em; height: 4em;',
87
+ // ACL
88
+ aclControlBoxContainer: 'margin: 1em',
89
+ aclControlBoxHeader: 'font-size: 120%; margin: 0 0 1rem',
90
+ aclControlBoxStatus: 'display: none; margin: 1rem 0',
91
+ aclControlBoxStatusRevealed: 'display: block',
92
+ aclGroupContent: 'maxWidth: 650',
93
+ accessGroupList: 'display: grid; grid-template-columns: 1fr; margin: 1em; width: 100%',
94
+ accessGroupListItem: 'display: grid; grid-template-columns: 100px auto 30%',
95
+ defaultsController: 'display: flex',
96
+ defaultsControllerNotice: 'color: #888; flexGrow: 1; fontSize: 80%',
97
+ bigButton: 'background-color: white; border: 0.1em solid #888; border-radius: 0.3em; max-width: 50%; padding-bottom: 1em; padding-top: 1em',
98
+ group: 'color: #888',
99
+ group1: 'color: green',
100
+ group2: 'color: #cc0',
101
+ group3: 'color: orange',
102
+ group5: 'color: red',
103
+ group9: 'color: blue',
104
+ group13: 'color: purple',
105
+ trustedAppAddApplicationsTable: 'background-color: #eee',
106
+ trustedAppCancelButton: 'float: right',
107
+ trustedAppControllerI: 'border-color: orange; borderRadius: 1em; borderWidth: 0.1em',
108
+ temporaryStatusInit: 'background: green',
109
+ temporaryStatusEnd: 'background: transparent; transition: background 5s linear',
110
+ // header
111
+ headerUserMenuLink: 'background: none; border: 0; color: black; cursor: pointer; display: block; font-family: Arial; font-size: 1em; text-align: left; padding: 1em; width: 100%; text-decoration: none',
112
+ headerUserMenuLinkHover: 'background: none; border: 0; color: black; cursor: pointer; display: block; font-family: Arial; font-size: 1em; text-align: left; padding: 1em; width: 100%; text-decoration: none; background-image: linear-gradient(to right, #7C4DFF 0%, #18A9E6 50%, #01C9EA 100%)',
113
+ headerUserMenuTrigger: 'background: none; border: 0; cursor: pointer; width: 60px; height: 60px',
114
+ headerUserMenuTriggerImg: 'border-radius: 50%; height: 56px; width: 28px !important',
115
+ headerUserMenuButton: 'background: none; border: 0; color: black; cursor: pointer; display: block; font-family: Arial; font-size: 1em; text-align: left; padding: 1em; width: 100%',
116
+ headerUserMenuButtonHover: 'background: none; border: 0; color: black; cursor: pointer; display: block; font-family: Arial; font-size: 1em; text-align: left; padding: 1em; width: 100%; background-image: linear-gradient(to right, #7C4DFF 0%, #18A9E6 50%, #01C9EA 100%)',
117
+ headerUserMenuList: 'list-style: none; margin: 0; padding: 0',
118
+ headerUserMenuListDisplay: 'list-style: none; margin: 0; padding: 0; display:true',
119
+ headerUserMenuNavigationMenu: 'background: white; border: solid 1px #000000; border-right: 0; position: absolute; right: 0; top: 60px; width: 200px; z-index: 1; display: true',
120
+ headerUserMenuNavigationMenuNotDisplayed: 'background: white; border: solid 1px #000000; border-right: 0; position: absolute; right: 0; top: 60px; width: 200px; z-index: 1; display: none',
121
+ headerUserMenuListItem: 'border-bottom: solid 1px #000000',
122
+ headerUserMenuPhoto: 'border-radius: 50%; background-position: center; background-repeat: no-repeat; background-size: cover; height: 50px; width: 50px',
123
+ headerBanner: 'box-shadow: 0px 1px 4px #000000; display: flex; justify-content: space-between; padding: 0 1.5em; margin-bottom: 4px',
124
+ headerBannerLink: 'display: block',
125
+ headerBannerRightMenu: 'display: flex',
126
+ headerBannerLogin: 'margin-left: auto',
127
+ allChildrenVisible: 'display:true',
128
+ headerBannerLoginInput: 'margin: 0.75em 0 0.75em 0.5em !important; padding: 0.5em !important',
129
+ headerBannerUserMenu: 'border-left: solid 1px #000000; margin-left: auto',
130
+ headerBannerHelpMenu: 'border-left: solid 1px #000000; margin.left: auto',
131
+ headerBannerIcon: 'background-size: 65px 60px !important; height: 60px !important; width: 65px !important',
132
+ // may just be 65px round($icon-size * 352 / 322);
133
+
134
+ // footer
135
+ footer: 'border-top: solid 1px $divider-color; font-size: 0.9em; padding: 0.5em 1.5em',
136
+ // buttons
137
+ primaryButton: 'background-color: #7c4dff; color: #ffffff; font-family: Raleway, Roboto, sans-serif; border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em;text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none',
138
+ primaryButtonHover: 'background-color: #9f7dff; color: #ffffff; font-family: Raleway, Roboto, sans-serif;border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em;text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none; transition: 0.25s all ease-in-out',
139
+ primaryButtonNoBorder: 'background-color: #ffffff; color: #7c4dff; font-family: Raleway, Roboto, sans-serif;border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em;text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none',
140
+ primaryButtonNoBorderHover: 'background-color: #7c4dff; color: #ffffff; font-family: Raleway, Roboto, sans-serif; border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em; text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none; transition: 0.25s all ease-in-out',
141
+ secondaryButton: 'background-color: #01c9ea; color: #ffffff; font-family: Raleway, Roboto, sans-serif;border-radius: 0.25em; border-color: #01c9ea; border: 1px solid; cursor: pointer; font-size: .8em;text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none',
142
+ secondaryButtonHover: 'background-color: #37cde6; color: #ffffff; font-family: Raleway, Roboto, sans-serif;border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em;text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none; transition: 0.25s all ease-in-out',
143
+ secondaryButtonNoBorder: 'background-color: #ffffff; color: #01c9ea; font-family: Raleway, Roboto, sans-serif; border-radius: 0.25em; border-color: #01c9ea; border: 1px solid; cursor: pointer; font-size: .8em; text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none',
144
+ secondaryButtonNoBorderHover: 'background-color: #01c9ea; color: #ffffff; font-family: Raleway, Roboto, sans-serif; border-radius: 0.25em; border-color: #01c9ea; border: 1px solid; cursor: pointer; font-size: .8em; text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none; transition: 0.25s all ease-in-out'
87
145
  };
88
146
  exports.style = style;
89
147
  style.setStyle = function setStyle(ele, styleName) {
package/lib/style.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"style.js","names":["formBorderColor","lowProfileLinkColor","formFieldNameBoxWidth","style","checkboxStyle","checkboxInputStyle","fieldLabelStyle","formSelectSTyle","textInputStyle","textInputStyleUneditable","textInputSize","buttonStyle","commentStyle","iconStyle","smallButtonStyle","classIconStyle","confirmPopupStyle","tabBorderRadius","messageBodyStyle","pendingeditModifier","highlightColor","personaBarStyle","searchInputStyle","autocompleteRowStyle","signInButtonStyle","heading1Style","heading2Style","heading3Style","heading4Style","formHeadingColor","formHeadingStyle","formTextInput","formGroupStyle","concat","formFieldLabelStyle","formFieldNameBoxStyle","textInputBackgroundColor","textInputBackgroundColorUneditable","textInputColor","textInputColorPending","multilineTextInputStyle","renderAsDivStyle","imageDivStyle","linkDivStyle","exports","setStyle","ele","styleName","module"],"sources":["../src/style.js"],"sourcesContent":["// Common readable consistent stylesheet\n// to avoid using style sheets which are document-global\n// and make programmable style toggling with selection, drag over, etc easier\n\n// These must all end with semicolon so they can be appended to.\n\nconst formBorderColor = '#888888' // Mid-grey\nconst lowProfileLinkColor = '#3B5998' // Grey-blue, e.g., for field labels linking to ontology\nconst formFieldNameBoxWidth = '8em' // The fixed amount to get form fields to line up\n// The latter we put in when switching awy from using tables. Getting allignment between\n// fields in different groups though is hard problem.\n\nexport const style = { // styleModule\n\n checkboxStyle: 'colour: black; font-size: 100%; padding-left: 0.5 em; padding-right: 0.5 em;',\n checkboxInputStyle: 'font-size: 150%; height: 1.2em; width: 1.2em; background-color: #eef; border-radius:0.2em; margin: 0.1em',\n\n fieldLabelStyle: 'color: #3B5998; text-decoration: none;',\n formSelectSTyle:\n 'background-color: #eef; padding: 0.5em; border: .05em solid #88c; border-radius:0.2em; font-size: 100%; margin:0.4em;',\n textInputStyle:\n 'background-color: #eef; padding: 0.5em; border: .05em solid #88c; border-radius:0.2em; font-size: 100%; margin:0.4em;',\n textInputStyleUneditable: // Color difference only\n 'background-color: white; padding: 0.5em; border: .05em solid white; border-radius:0.2em; font-size: 100%; margin:0.4em;',\n textInputSize: 20, // Default text input size in characters roughly\n buttonStyle:\n 'background-color: #fff; padding: 0.7em; border: .01em solid white; border-radius:0.2em; font-size: 100%; margin: 0.3em;', // 'background-color: #eef;\n commentStyle: 'padding: 0.7em; border: none; font-size: 100%; white-space: pre-wrap;',\n iconStyle: 'width: 3em; height: 3em; margin: 0.1em; border-radius: 1em;',\n smallButtonStyle: 'margin: 0.2em; width: 1em; height:1em;',\n classIconStyle: 'width: 3em; height: 3em; margin: 0.1em; border-radius: 0.2em; border: 0.1em solid green; padding: 0.2em; background-color: #efe;', // combine with buttonStyle\n confirmPopupStyle: 'padding: 0.7em; border-radius: 0.2em; border: 0.1em solid orange; background-color: white; box-shadow: 0.5em 0.9em #888;',\n tabBorderRadius: '0.2em',\n messageBodyStyle:\n 'white-space: pre-wrap; width: 99%; font-size:100%; border: 0.07em solid #eee; border-radius:0.2em; padding: .3em 0.5em; margin: 0.1em;',\n pendingeditModifier: 'color: #bbb;',\n highlightColor: '#7C4DFF', // Solid lavendar https://design.inrupt.com/atomic-core/?cat=Core\n\n // Contacts\n personaBarStyle: 'width: 100%; height: 4em; background-color: #eee; vertical-align: middle;',\n searchInputStyle: 'border: 0.1em solid #444; border-radius: 0.2em; width: 100%; font-size: 100%; padding: 0.1em 0.6em; margin 0.2em;',\n autocompleteRowStyle: 'border: 0.2em solid straw;',\n\n // Login buttons\n signInButtonStyle: 'padding: 1em; border-radius:0.2em; font-size: 100%;', // was 0.5em radius\n\n // Forms\n heading1Style: 'font-size: 180%; font-weight: bold; color: #888888; padding: 0.5em; margin: 0.7em 0.0m;', // originally was brown; now grey\n heading2Style: 'font-size: 130%; font-weight: bold; color: #888888; padding: 0.4em; margin: 0.7em 0.0em;', // originally was brown; now grey\n heading3Style: 'font-size: 120%; font-weight: bold; color: #888888; padding: 0.3em; margin: 0.7em 0.0em;', // For example, in large forms or before a small form\n heading4Style: 'font-size: 110%; font-weight: bold; color: #888888; padding: 0.2em; margin: 0.7em 0.0em;', // Lowest level used by default in small things\n\n formBorderColor, // originally was brown; now grey\n formHeadingColor: '#888888', // originally was brown; now grey\n formHeadingStyle: 'font-size: 110%; font-weight: bold; color: #888888; padding: 0.2em; margin: 0.7em 0.0em;', // originally was brown; now grey\n formTextInput: 'font-size: 100%; margin: 0.1em; padding: 0.1em;', // originally used this\n formGroupStyle: [`padding-left: 0em; border: 0.0em solid ${formBorderColor}; border-radius: 0.2em;`, // weight 0\n `padding-left: 2em; border: 0.05em solid ${formBorderColor}; border-radius: 0.2em;`,\n `padding-left: 2em; border: 0.1em solid ${formBorderColor}; border-radius: 0.2em;`,\n `padding-left: 2em; border: 0.2em solid ${formBorderColor}; border-radius: 0.2em;` // @@ pink\n ],\n\n formFieldLabelStyle: `'color: ${lowProfileLinkColor}; text-decoration: none;'`,\n formFieldNameBoxWidth,\n formFieldNameBoxStyle: `padding: 0.3em; vertical-align: middle; width:${formFieldNameBoxWidth};`,\n textInputBackgroundColor: '#eef',\n textInputBackgroundColorUneditable: '#fff',\n textInputColor: '#000',\n textInputColorPending: '#888',\n multilineTextInputStyle: 'font-size:100%; white-space: pre-wrap; background-color: #eef;' +\n ' border: 0.07em solid gray; padding: 1em 0.5em; margin: 1em 1em;',\n\n // Buttons\n renderAsDivStyle: 'display: flex; align-items: center; justify-content: space-between; height: 2.5em; padding: 1em;',\n imageDivStyle: 'width:2.5em; padding:0.5em; height: 2.5em;',\n linkDivStyle: 'width:2em; padding:0.5em; height: 4em;'\n}\n\nstyle.setStyle = function setStyle (ele, styleName) {\n ele.style = style[styleName]\n}\n\nmodule.exports = style // @@ No way to do this in ESM\n"],"mappings":";;;;;;AAAA;AACA;AACA;;AAEA;;AAEA,IAAMA,eAAe,GAAG,SAAS,EAAC;AAClC,IAAMC,mBAAmB,GAAG,SAAS,EAAC;AACtC,IAAMC,qBAAqB,GAAG,KAAK,EAAC;AACpC;AACA;;AAEO,IAAMC,KAAK,GAAG;EAAE;;EAErBC,aAAa,EAAE,8EAA8E;EAC7FC,kBAAkB,EAAE,0GAA0G;EAE9HC,eAAe,EAAE,wCAAwC;EACzDC,eAAe,EACb,yHAAyH;EAC3HC,cAAc,EACZ,yHAAyH;EAC3HC,wBAAwB;EAAE;EACxB,2HAA2H;EAC7HC,aAAa,EAAE,EAAE;EAAE;EACnBC,WAAW,EACP,2HAA2H;EAAE;EACjIC,YAAY,EAAE,wEAAwE;EACtFC,SAAS,EAAE,6DAA6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,GAAAA,KAAA;AAEDA,KAAK,CAAC0C,QAAQ,GAAG,SAASA,QAAQA,CAAEC,GAAG,EAAEC,SAAS,EAAE;EAClDD,GAAG,CAAC3C,KAAK,GAAGA,KAAK,CAAC4C,SAAS,CAAC;AAC9B,CAAC;AAEDC,MAAM,CAACJ,OAAO,GAAGzC,KAAK,EAAC"}
1
+ {"version":3,"file":"style.js","names":["formBorderColor","lowProfileLinkColor","formFieldNameBoxWidth","style","checkboxStyle","checkboxInputStyle","fieldLabelStyle","formSelectSTyle","textInputStyle","textInputStyleUneditable","textInputSize","buttonStyle","commentStyle","iconStyle","smallButtonStyle","classIconStyle","confirmPopupStyle","tabBorderRadius","messageBodyStyle","pendingeditModifier","highlightColor","personaBarStyle","searchInputStyle","autocompleteRowStyle","signInButtonStyle","heading1Style","heading2Style","heading3Style","heading4Style","formHeadingColor","formHeadingStyle","formTextInput","formGroupStyle","concat","formFieldLabelStyle","formFieldNameBoxStyle","textInputBackgroundColor","textInputBackgroundColorUneditable","textInputColor","textInputColorPending","multilineTextInputStyle","renderAsDivStyle","imageDivStyle","linkDivStyle","aclControlBoxContainer","aclControlBoxHeader","aclControlBoxStatus","aclControlBoxStatusRevealed","aclGroupContent","accessGroupList","accessGroupListItem","defaultsController","defaultsControllerNotice","bigButton","group","group1","group2","group3","group5","group9","group13","trustedAppAddApplicationsTable","trustedAppCancelButton","trustedAppControllerI","temporaryStatusInit","temporaryStatusEnd","headerUserMenuLink","headerUserMenuLinkHover","headerUserMenuTrigger","headerUserMenuTriggerImg","headerUserMenuButton","headerUserMenuButtonHover","headerUserMenuList","headerUserMenuListDisplay","headerUserMenuNavigationMenu","headerUserMenuNavigationMenuNotDisplayed","headerUserMenuListItem","headerUserMenuPhoto","headerBanner","headerBannerLink","headerBannerRightMenu","headerBannerLogin","allChildrenVisible","headerBannerLoginInput","headerBannerUserMenu","headerBannerHelpMenu","headerBannerIcon","footer","primaryButton","primaryButtonHover","primaryButtonNoBorder","primaryButtonNoBorderHover","secondaryButton","secondaryButtonHover","secondaryButtonNoBorder","secondaryButtonNoBorderHover","exports","setStyle","ele","styleName","module"],"sources":["../src/style.js"],"sourcesContent":["// Common readable consistent stylesheet\n// to avoid using style sheets which are document-global\n// and make programmable style toggling with selection, drag over, etc easier\n\n// These must all end with semicolon so they can be appended to.\n\nconst formBorderColor = '#888888' // Mid-grey\nconst lowProfileLinkColor = '#3B5998' // Grey-blue, e.g., for field labels linking to ontology\nconst formFieldNameBoxWidth = '8em' // The fixed amount to get form fields to line up\n// The latter we put in when switching awy from using tables. Getting allignment between\n// fields in different groups though is hard problem.\n\nexport const style = { // styleModule\n\n checkboxStyle: 'color: black; font-size: 100%; padding-left: 0.5 em; padding-right: 0.5 em;',\n checkboxInputStyle: 'font-size: 150%; height: 1.2em; width: 1.2em; background-color: #eef; border-radius:0.2em; margin: 0.1em',\n\n fieldLabelStyle: 'color: #3B5998; text-decoration: none;',\n formSelectSTyle:\n 'background-color: #eef; padding: 0.5em; border: .05em solid #88c; border-radius:0.2em; font-size: 100%; margin:0.4em;',\n textInputStyle:\n 'background-color: #eef; padding: 0.5em; border: .05em solid #88c; border-radius:0.2em; font-size: 100%; margin:0.4em;',\n textInputStyleUneditable: // Color difference only\n 'background-color: white; padding: 0.5em; border: .05em solid white; border-radius:0.2em; font-size: 100%; margin:0.4em;',\n textInputSize: 20, // Default text input size in characters roughly\n buttonStyle:\n 'background-color: #fff; padding: 0.7em; border: .01em solid white; border-radius:0.2em; font-size: 100%; margin: 0.3em;', // 'background-color: #eef;\n commentStyle: 'padding: 0.7em; border: none; font-size: 100%; white-space: pre-wrap;',\n iconStyle: 'width: 3em; height: 3em; margin: 0.1em; border-radius: 1em;',\n smallButtonStyle: 'margin: 0.2em; width: 1em; height:1em;',\n classIconStyle: 'width: 3em; height: 3em; margin: 0.1em; border-radius: 0.2em; border: 0.1em solid green; padding: 0.2em; background-color: #efe;', // combine with buttonStyle\n confirmPopupStyle: 'padding: 0.7em; border-radius: 0.2em; border: 0.1em solid orange; background-color: white; box-shadow: 0.5em 0.9em #888;',\n tabBorderRadius: '0.2em',\n messageBodyStyle:\n 'white-space: pre-wrap; width: 99%; font-size:100%; border: 0.07em solid #eee; border-radius:0.2em; padding: .3em 0.5em; margin: 0.1em;',\n pendingeditModifier: 'color: #bbb;',\n highlightColor: '#7C4DFF', // Solid lavendar https://design.inrupt.com/atomic-core/?cat=Core\n\n // Contacts\n personaBarStyle: 'width: 100%; height: 4em; background-color: #eee; vertical-align: middle;',\n searchInputStyle: 'border: 0.1em solid #444; border-radius: 0.2em; width: 100%; font-size: 100%; padding: 0.1em 0.6em; margin 0.2em;',\n autocompleteRowStyle: 'border: 0.2em solid straw;',\n\n // Login buttons\n signInButtonStyle: 'padding: 1em; border-radius:0.2em; font-size: 100%;', // was 0.5em radius\n\n // Forms\n heading1Style: 'font-size: 180%; font-weight: bold; color: #888888; padding: 0.5em; margin: 0.7em 0.0m;', // originally was brown; now grey\n heading2Style: 'font-size: 130%; font-weight: bold; color: #888888; padding: 0.4em; margin: 0.7em 0.0em;', // originally was brown; now grey\n heading3Style: 'font-size: 120%; font-weight: bold; color: #888888; padding: 0.3em; margin: 0.7em 0.0em;', // For example, in large forms or before a small form\n heading4Style: 'font-size: 110%; font-weight: bold; color: #888888; padding: 0.2em; margin: 0.7em 0.0em;', // Lowest level used by default in small things\n\n formBorderColor, // originally was brown; now grey\n formHeadingColor: '#888888', // originally was brown; now grey\n formHeadingStyle: 'font-size: 110%; font-weight: bold; color: #888888; padding: 0.2em; margin: 0.7em 0.0em;', // originally was brown; now grey\n formTextInput: 'font-size: 100%; margin: 0.1em; padding: 0.1em;', // originally used this\n formGroupStyle: [`padding-left: 0em; border: 0.0em solid ${formBorderColor}; border-radius: 0.2em;`, // weight 0\n `padding-left: 2em; border: 0.05em solid ${formBorderColor}; border-radius: 0.2em;`,\n `padding-left: 2em; border: 0.1em solid ${formBorderColor}; border-radius: 0.2em;`,\n `padding-left: 2em; border: 0.2em solid ${formBorderColor}; border-radius: 0.2em;` // @@ pink\n ],\n\n formFieldLabelStyle: `'color: ${lowProfileLinkColor}; text-decoration: none;'`,\n formFieldNameBoxWidth,\n formFieldNameBoxStyle: `padding: 0.3em; vertical-align: middle; width:${formFieldNameBoxWidth};`,\n textInputBackgroundColor: '#eef',\n textInputBackgroundColorUneditable: '#fff',\n textInputColor: '#000',\n textInputColorPending: '#888',\n multilineTextInputStyle: 'font-size:100%; white-space: pre-wrap; background-color: #eef;' +\n ' border: 0.07em solid gray; padding: 1em 0.5em; margin: 1em 1em;',\n\n // Buttons\n renderAsDivStyle: 'display: flex; align-items: center; justify-content: space-between; height: 2.5em; padding: 1em;',\n imageDivStyle: 'width:2.5em; padding:0.5em; height: 2.5em;',\n linkDivStyle: 'width:2em; padding:0.5em; height: 4em;',\n\n // ACL\n aclControlBoxContainer: 'margin: 1em',\n aclControlBoxHeader: 'font-size: 120%; margin: 0 0 1rem',\n aclControlBoxStatus: 'display: none; margin: 1rem 0',\n aclControlBoxStatusRevealed: 'display: block',\n aclGroupContent: 'maxWidth: 650',\n accessGroupList: 'display: grid; grid-template-columns: 1fr; margin: 1em; width: 100%',\n accessGroupListItem: 'display: grid; grid-template-columns: 100px auto 30%',\n defaultsController: 'display: flex',\n defaultsControllerNotice: 'color: #888; flexGrow: 1; fontSize: 80%',\n bigButton: 'background-color: white; border: 0.1em solid #888; border-radius: 0.3em; max-width: 50%; padding-bottom: 1em; padding-top: 1em',\n group: 'color: #888',\n group1: 'color: green',\n group2: 'color: #cc0',\n group3: 'color: orange',\n group5: 'color: red',\n group9: 'color: blue',\n group13: 'color: purple',\n\n trustedAppAddApplicationsTable: 'background-color: #eee',\n trustedAppCancelButton: 'float: right',\n trustedAppControllerI: 'border-color: orange; borderRadius: 1em; borderWidth: 0.1em',\n temporaryStatusInit: 'background: green',\n temporaryStatusEnd: 'background: transparent; transition: background 5s linear',\n\n // header\n headerUserMenuLink: 'background: none; border: 0; color: black; cursor: pointer; display: block; font-family: Arial; font-size: 1em; text-align: left; padding: 1em; width: 100%; text-decoration: none',\n headerUserMenuLinkHover: 'background: none; border: 0; color: black; cursor: pointer; display: block; font-family: Arial; font-size: 1em; text-align: left; padding: 1em; width: 100%; text-decoration: none; background-image: linear-gradient(to right, #7C4DFF 0%, #18A9E6 50%, #01C9EA 100%)',\n headerUserMenuTrigger: 'background: none; border: 0; cursor: pointer; width: 60px; height: 60px',\n headerUserMenuTriggerImg: 'border-radius: 50%; height: 56px; width: 28px !important',\n headerUserMenuButton: 'background: none; border: 0; color: black; cursor: pointer; display: block; font-family: Arial; font-size: 1em; text-align: left; padding: 1em; width: 100%',\n headerUserMenuButtonHover: 'background: none; border: 0; color: black; cursor: pointer; display: block; font-family: Arial; font-size: 1em; text-align: left; padding: 1em; width: 100%; background-image: linear-gradient(to right, #7C4DFF 0%, #18A9E6 50%, #01C9EA 100%)',\n headerUserMenuList: 'list-style: none; margin: 0; padding: 0',\n headerUserMenuListDisplay: 'list-style: none; margin: 0; padding: 0; display:true',\n headerUserMenuNavigationMenu: 'background: white; border: solid 1px #000000; border-right: 0; position: absolute; right: 0; top: 60px; width: 200px; z-index: 1; display: true',\n headerUserMenuNavigationMenuNotDisplayed: 'background: white; border: solid 1px #000000; border-right: 0; position: absolute; right: 0; top: 60px; width: 200px; z-index: 1; display: none',\n headerUserMenuListItem: 'border-bottom: solid 1px #000000',\n headerUserMenuPhoto: 'border-radius: 50%; background-position: center; background-repeat: no-repeat; background-size: cover; height: 50px; width: 50px',\n headerBanner: 'box-shadow: 0px 1px 4px #000000; display: flex; justify-content: space-between; padding: 0 1.5em; margin-bottom: 4px',\n headerBannerLink: 'display: block',\n headerBannerRightMenu: 'display: flex',\n headerBannerLogin: 'margin-left: auto',\n allChildrenVisible: 'display:true',\n headerBannerLoginInput: 'margin: 0.75em 0 0.75em 0.5em !important; padding: 0.5em !important',\n headerBannerUserMenu: 'border-left: solid 1px #000000; margin-left: auto',\n headerBannerHelpMenu: 'border-left: solid 1px #000000; margin.left: auto',\n headerBannerIcon: 'background-size: 65px 60px !important; height: 60px !important; width: 65px !important', // may just be 65px round($icon-size * 352 / 322);\n\n // footer\n footer: 'border-top: solid 1px $divider-color; font-size: 0.9em; padding: 0.5em 1.5em',\n\n // buttons\n primaryButton: 'background-color: #7c4dff; color: #ffffff; font-family: Raleway, Roboto, sans-serif; border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em;text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none',\n\n primaryButtonHover: 'background-color: #9f7dff; color: #ffffff; font-family: Raleway, Roboto, sans-serif;border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em;text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none; transition: 0.25s all ease-in-out',\n\n primaryButtonNoBorder: 'background-color: #ffffff; color: #7c4dff; font-family: Raleway, Roboto, sans-serif;border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em;text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none',\n\n primaryButtonNoBorderHover: 'background-color: #7c4dff; color: #ffffff; font-family: Raleway, Roboto, sans-serif; border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em; text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none; transition: 0.25s all ease-in-out',\n\n secondaryButton: 'background-color: #01c9ea; color: #ffffff; font-family: Raleway, Roboto, sans-serif;border-radius: 0.25em; border-color: #01c9ea; border: 1px solid; cursor: pointer; font-size: .8em;text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none',\n\n secondaryButtonHover: 'background-color: #37cde6; color: #ffffff; font-family: Raleway, Roboto, sans-serif;border-radius: 0.25em; border-color: #7c4dff; border: 1px solid; cursor: pointer; font-size: .8em;text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none; transition: 0.25s all ease-in-out',\n\n secondaryButtonNoBorder: 'background-color: #ffffff; color: #01c9ea; font-family: Raleway, Roboto, sans-serif; border-radius: 0.25em; border-color: #01c9ea; border: 1px solid; cursor: pointer; font-size: .8em; text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none',\n\n secondaryButtonNoBorderHover: 'background-color: #01c9ea; color: #ffffff; font-family: Raleway, Roboto, sans-serif; border-radius: 0.25em; border-color: #01c9ea; border: 1px solid; cursor: pointer; font-size: .8em; text-decoration: none; padding: 0.5em 4em; transition: 0.25s all ease-in-out; outline: none; transition: 0.25s all ease-in-out'\n\n}\n\nstyle.setStyle = function setStyle (ele, styleName) {\n ele.style = style[styleName]\n}\n\nmodule.exports = style // @@ No way to do this in ESM\n"],"mappings":";;;;;;AAAA;AACA;AACA;;AAEA;;AAEA,IAAMA,eAAe,GAAG,SAAS,EAAC;AAClC,IAAMC,mBAAmB,GAAG,SAAS,EAAC;AACtC,IAAMC,qBAAqB,GAAG,KAAK,EAAC;AACpC;AACA;;AAEO,IAAMC,KAAK,GAAG;EAAE;;EAErBC,aAAa,EAAE,6EAA6E;EAC5FC,kBAAkB,EAAE,0GAA0G;EAE9HC,eAAe,EAAE,wCAAwC;EACzDC,eAAe,EACb,yHAAyH;EAC3HC,cAAc,EACZ,yHAAyH;EAC3HC,wBAAwB;EAAE;EACxB,2HAA2H;EAC7HC,aAAa,EAAE,EAAE;EAAE;EACnBC,WAAW,EACP,2HAA2H;EAAE;EACjIC,YAAY,EAAE,wEAAwE;EACtFC,SAAS,EAAE,6DAA6D;EACxEC,gBAAgB,EAAE,wCAAwC;EAC1DC,cAAc,EAAE,kIAAkI;EAAE;EACpJC,iBAAiB,EAAE,0HAA0H;EAC7IC,eAAe,EAAE,OAAO;EACxBC,gBAAgB,EACd,wIAAwI;EAC1IC,mBAAmB,EAAE,cAAc;EACnCC,cAAc,EAAE,SAAS;EAAE;;EAE3B;EACAC,eAAe,EAAE,2EAA2E;EAC5FC,gBAAgB,EAAE,mHAAmH;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AE;AAEhC,CAAC;AAAAC,OAAA,CAAA7F,KAAA,GAAAA,KAAA;AAEDA,KAAK,CAAC8F,QAAQ,GAAG,SAASA,QAAQA,CAAEC,GAAG,EAAEC,SAAS,EAAE;EAClDD,GAAG,CAAC/F,KAAK,GAAGA,KAAK,CAACgG,SAAS,CAAC;AAC9B,CAAC;AAEDC,MAAM,CAACJ,OAAO,GAAG7F,KAAK,EAAC"}
@@ -4,10 +4,6 @@ type ThrottleOptions = {
4
4
  throttling?: boolean;
5
5
  trailing?: boolean;
6
6
  };
7
- /**
8
- * @ignore exporting this only for the unit test
9
- */
10
- export declare function addStyleClassToElement(element: any, styleClasses: string[], type?: string): void;
11
7
  /**
12
8
  * @ignore exporting this only for the unit test
13
9
  */
@@ -1 +1 @@
1
- {"version":3,"file":"headerFooterHelpers.d.ts","sourceRoot":"","sources":["../../src/utils/headerFooterHelpers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAc,MAAM,QAAQ,CAAA;AAOzE,KAAK,eAAe,GAAG;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB,CAAA;AAYD;;GAEG;AACH,wBAAgB,sBAAsB,CAAE,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,IAAI,CAAC,EAAE,MAAM,QAM1F;AACD;;GAEG;AACH,wBAAgB,MAAM,IAAK,SAAS,CAGnC;AACD;GACG;AACH,wBAAsB,WAAW,CAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAkD9F;AACD;;GAEG;AACH,wBAAgB,OAAO,CAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,SAAS,GAAG,MAAM,CAIvE;AACD;;GAEG;AACH,wBAAgB,QAAQ,CAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,eAAoB,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAgC9G"}
1
+ {"version":3,"file":"headerFooterHelpers.d.ts","sourceRoot":"","sources":["../../src/utils/headerFooterHelpers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,SAAS,EAAc,MAAM,QAAQ,CAAA;AAIzE,KAAK,eAAe,GAAG;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB,CAAA;AAED;;GAEG;AACH,wBAAgB,MAAM,IAAK,SAAS,CAGnC;AACD;GACG;AACH,wBAAsB,WAAW,CAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAkD9F;AACD;;GAEG;AACH,wBAAgB,OAAO,CAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,SAAS,GAAG,MAAM,CAIvE;AACD;;GAEG;AACH,wBAAgB,QAAQ,CAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,eAAoB,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAgC9G"}
@@ -4,45 +4,20 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.addStyleClassToElement = addStyleClassToElement;
8
7
  exports.getName = getName;
9
8
  exports.getPod = getPod;
10
9
  exports.getPodOwner = getPodOwner;
11
10
  exports.throttle = throttle;
12
11
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
13
12
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
14
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
13
  var _rdflib = require("rdflib");
16
14
  var _ = require("..");
17
- var _styleMap = require("../header/styleMap");
18
- var _styleMap2 = require("../footer/styleMap");
19
- var _jss = require("../jss");
20
15
  /*
21
16
  Copied from mashlib/src/global/metadata.ts
22
17
  */
23
18
 
24
- /**
25
- * @internal
26
- */
27
- function getStyle(styleClass, type) {
28
- if (type && type === 'footer') {
29
- return _styleMap2.styleMap[styleClass];
30
- } else {
31
- return _styleMap.styleMap[styleClass];
32
- }
33
- }
19
+ /* @ts-ignore no-console */
34
20
 
35
- /**
36
- * @ignore exporting this only for the unit test
37
- */
38
- function addStyleClassToElement(element, styleClasses, type) {
39
- styleClasses.forEach(function (styleClass) {
40
- var style = getStyle(styleClass, type);
41
- var _getClasses = (0, _jss.getClasses)(document.head, (0, _defineProperty2["default"])({}, styleClass, style)),
42
- classes = _getClasses.classes;
43
- element.classList.add(classes[styleClass]);
44
- });
45
- }
46
21
  /**
47
22
  * @ignore exporting this only for the unit test
48
23
  */
@@ -1 +1 @@
1
- {"version":3,"file":"headerFooterHelpers.js","names":["_rdflib","require","_","_styleMap","_styleMap2","_jss","getStyle","styleClass","type","footerStyleMap","headerStyleMap","addStyleClassToElement","element","styleClasses","forEach","style","_getClasses","getClasses","document","head","_defineProperty2","classes","classList","add","getPod","sym","location","origin","site","getPodOwner","_x","_x2","_getPodOwner","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee","pod","store","response","containerTurtle","podOwner","guess","wrap","_callee$","_context","prev","next","any","ns","ldp","fetcher","webOperation","uri","initFetchOptions","headers","accept","sent","responseText","parse","t0","console","error","abrupt","holds","rdf","space","warn","solid","load","doc","t1","concat","t2","stop","getName","user","anyValue","vcard","foaf","throttle","func","wait","options","length","undefined","context","args","result","timeout","previous","later","leading","Date","now","remaining","clearTimeout","trailing","setTimeout"],"sources":["../../src/utils/headerFooterHelpers.ts"],"sourcesContent":["/*\n Copied from mashlib/src/global/metadata.ts\n */\nimport { IndexedFormula, LiveStore, NamedNode, parse, sym } from 'rdflib'\nimport { ns } from '..'\nimport { styleMap as headerStyleMap } from '../header/styleMap'\nimport { styleMap as footerStyleMap } from '../footer/styleMap'\nimport { getClasses } from '../jss'\n\n/* @ts-ignore no-console */\ntype ThrottleOptions = {\n leading?: boolean;\n throttling?: boolean;\n trailing?: boolean;\n}\n/**\n * @internal\n */\nfunction getStyle (styleClass, type?) {\n if (type && type === 'footer') {\n return footerStyleMap[styleClass]\n } else {\n return headerStyleMap[styleClass]\n }\n}\n\n/**\n * @ignore exporting this only for the unit test\n */\nexport function addStyleClassToElement (element: any, styleClasses: string[], type?: string) {\n styleClasses.forEach((styleClass) => {\n const style = getStyle(styleClass, type)\n const { classes } = getClasses(document.head, { [styleClass]: style })\n element.classList.add(classes[styleClass])\n })\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function getPod (): NamedNode {\n // @@ TODO: This is given that mashlib runs on NSS - might need to change when we want it to run on other Pod servers\n return sym(document.location.origin).site()\n}\n/**\n */\nexport async function getPodOwner (pod: NamedNode, store: LiveStore): Promise<NamedNode | null> {\n // This is a massive guess. In future\n // const podOwner = sym(`${pod.uri}profile/card#me`)\n/* eslint-disable no-console */\n try {\n // load turtle Container representation\n if (!store.any(pod, null, ns.ldp('Container'), pod)) {\n const response = await store.fetcher.webOperation('GET', pod.uri, store.fetcher.initFetchOptions(pod.uri, { headers: { accept: 'text/turtle' } }))\n const containerTurtle = response.responseText\n parse(containerTurtle as string, store, pod.uri, 'text/turtle')\n }\n } catch (err) {\n console.error('Error loading pod ' + pod + ': ' + err)\n return null\n }\n if (!store.holds(pod, ns.rdf('type'), ns.space('Storage'), pod)) {\n console.warn('Pod ' + pod + ' does not declare itself as a space:Storage')\n return null\n }\n const podOwner = store.any(pod, ns.solid('owner'), null, pod) ||\n store.any(null, ns.space('storage'), pod, pod)\n if (podOwner) {\n try {\n await store.fetcher.load((podOwner as NamedNode).doc())\n } catch (err) {\n console.warn('Unable to load profile of pod owner ' + podOwner)\n return null\n }\n if (!store.holds(podOwner, ns.space('storage'), pod, (podOwner as NamedNode).doc())) {\n console.warn(`Pod owner ${podOwner} does NOT list pod ${pod} as their storage`)\n }\n return podOwner as NamedNode// Success!\n } else { // pod owner not declared in pod\n // @@ TODO: This is given the structure that NSS provides\n // This is a massive guess. For old pods which don't have owner link\n const guess = sym(`${pod.uri}profile/card#me`)\n try {\n // @ts-ignore LiveStore always has fetcher\n await store.fetcher.load(guess)\n } catch (err) {\n console.error('Ooops. Guessed wrong pod owner webid {$guess} : can\\'t load it.')\n return null\n }\n if (store.holds(guess, ns.space('storage'), pod, guess.doc())) {\n console.warn('Using guessed pod owner webid but it links back.')\n return guess\n }\n return null\n }\n /* eslint-enable no-console */\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function getName (store: IndexedFormula, user: NamedNode): string {\n return store.anyValue(user, ns.vcard('fn'), null, user.doc()) ||\n store.anyValue(user, ns.foaf('name'), null, user.doc()) ||\n user.uri\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function throttle (func: Function, wait: number, options: ThrottleOptions = {}): (...args: any[]) => any {\n let context: any,\n args: any,\n result: any\n let timeout: any = null\n let previous = 0\n const later = function () {\n previous = !options.leading ? 0 : Date.now()\n timeout = null\n result = func.apply(context, args)\n if (!timeout) context = args = null\n }\n return function () {\n const now = Date.now()\n if (!previous && !options.leading) previous = now\n const remaining = wait - (now - previous)\n // @ts-ignore\n context = this\n args = arguments\n if (remaining <= 0 || remaining > wait) {\n if (timeout) {\n clearTimeout(timeout)\n timeout = null\n }\n previous = now\n result = func.apply(context, args)\n if (!timeout) context = args = null\n } else if (!timeout && options.trailing !== false) {\n timeout = setTimeout(later, remaining)\n }\n return result\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,CAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,UA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"file":"headerFooterHelpers.js","names":["_rdflib","require","_","getPod","sym","document","location","origin","site","getPodOwner","_x","_x2","_getPodOwner","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee","pod","store","response","containerTurtle","podOwner","guess","wrap","_callee$","_context","prev","next","any","ns","ldp","fetcher","webOperation","uri","initFetchOptions","headers","accept","sent","responseText","parse","t0","console","error","abrupt","holds","rdf","space","warn","solid","load","doc","t1","concat","t2","stop","getName","user","anyValue","vcard","foaf","throttle","func","wait","options","length","undefined","context","args","result","timeout","previous","later","leading","Date","now","remaining","clearTimeout","trailing","setTimeout"],"sources":["../../src/utils/headerFooterHelpers.ts"],"sourcesContent":["/*\n Copied from mashlib/src/global/metadata.ts\n */\nimport { IndexedFormula, LiveStore, NamedNode, parse, sym } from 'rdflib'\nimport { ns } from '..'\n\n/* @ts-ignore no-console */\ntype ThrottleOptions = {\n leading?: boolean;\n throttling?: boolean;\n trailing?: boolean;\n}\n\n/**\n * @ignore exporting this only for the unit test\n */\nexport function getPod (): NamedNode {\n // @@ TODO: This is given that mashlib runs on NSS - might need to change when we want it to run on other Pod servers\n return sym(document.location.origin).site()\n}\n/**\n */\nexport async function getPodOwner (pod: NamedNode, store: LiveStore): Promise<NamedNode | null> {\n // This is a massive guess. In future\n // const podOwner = sym(`${pod.uri}profile/card#me`)\n/* eslint-disable no-console */\n try {\n // load turtle Container representation\n if (!store.any(pod, null, ns.ldp('Container'), pod)) {\n const response = await store.fetcher.webOperation('GET', pod.uri, store.fetcher.initFetchOptions(pod.uri, { headers: { accept: 'text/turtle' } }))\n const containerTurtle = response.responseText\n parse(containerTurtle as string, store, pod.uri, 'text/turtle')\n }\n } catch (err) {\n console.error('Error loading pod ' + pod + ': ' + err)\n return null\n }\n if (!store.holds(pod, ns.rdf('type'), ns.space('Storage'), pod)) {\n console.warn('Pod ' + pod + ' does not declare itself as a space:Storage')\n return null\n }\n const podOwner = store.any(pod, ns.solid('owner'), null, pod) ||\n store.any(null, ns.space('storage'), pod, pod)\n if (podOwner) {\n try {\n await store.fetcher.load((podOwner as NamedNode).doc())\n } catch (err) {\n console.warn('Unable to load profile of pod owner ' + podOwner)\n return null\n }\n if (!store.holds(podOwner, ns.space('storage'), pod, (podOwner as NamedNode).doc())) {\n console.warn(`Pod owner ${podOwner} does NOT list pod ${pod} as their storage`)\n }\n return podOwner as NamedNode// Success!\n } else { // pod owner not declared in pod\n // @@ TODO: This is given the structure that NSS provides\n // This is a massive guess. For old pods which don't have owner link\n const guess = sym(`${pod.uri}profile/card#me`)\n try {\n // @ts-ignore LiveStore always has fetcher\n await store.fetcher.load(guess)\n } catch (err) {\n console.error('Ooops. Guessed wrong pod owner webid {$guess} : can\\'t load it.')\n return null\n }\n if (store.holds(guess, ns.space('storage'), pod, guess.doc())) {\n console.warn('Using guessed pod owner webid but it links back.')\n return guess\n }\n return null\n }\n /* eslint-enable no-console */\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function getName (store: IndexedFormula, user: NamedNode): string {\n return store.anyValue(user, ns.vcard('fn'), null, user.doc()) ||\n store.anyValue(user, ns.foaf('name'), null, user.doc()) ||\n user.uri\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function throttle (func: Function, wait: number, options: ThrottleOptions = {}): (...args: any[]) => any {\n let context: any,\n args: any,\n result: any\n let timeout: any = null\n let previous = 0\n const later = function () {\n previous = !options.leading ? 0 : Date.now()\n timeout = null\n result = func.apply(context, args)\n if (!timeout) context = args = null\n }\n return function () {\n const now = Date.now()\n if (!previous && !options.leading) previous = now\n const remaining = wait - (now - previous)\n // @ts-ignore\n context = this\n args = arguments\n if (remaining <= 0 || remaining > wait) {\n if (timeout) {\n clearTimeout(timeout)\n timeout = null\n }\n previous = now\n result = func.apply(context, args)\n if (!timeout) context = args = null\n } else if (!timeout && options.trailing !== false) {\n timeout = setTimeout(later, remaining)\n }\n return result\n }\n}\n"],"mappings":";;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,CAAA,GA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,GAAGvD,SAAS;IAChB,IAAI+D,SAAS,IAAI,CAAC,IAAIA,SAAS,GAAGb,IAAI,EAAE;MACtC,IAAIO,OAAO,EAAE;QACXO,YAAY,CAACP,OAAO,CAAC;QACrBA,OAAO,GAAG,IAAI;MAChB;MACAC,QAAQ,GAAGI,GAAG;MACdN,MAAM,GAAGP,IAAI,CAAClD,KAAK,CAACuD,OAAO,EAAEC,IAAI,CAAC;MAClC,IAAI,CAACE,OAAO,EAAEH,OAAO,GAAGC,IAAI,GAAG,IAAI;IACrC,CAAC,MAAM,IAAI,CAACE,OAAO,IAAIN,OAAO,CAACc,QAAQ,KAAK,KAAK,EAAE;MACjDR,OAAO,GAAGS,UAAU,CAACP,KAAK,EAAEI,SAAS,CAAC;IACxC;IACA,OAAOP,MAAM;EACf,CAAC;AACH"}
@@ -0,0 +1,9 @@
1
+ import { NamedNode } from 'rdflib';
2
+ export declare const pubKeyUrl: (webId: NamedNode) => any;
3
+ export declare const privKeyUrl: (webId: NamedNode) => any;
4
+ export declare function getExistingPublicKey(webId: NamedNode, publicKeyUrl: string): Promise<string | undefined>;
5
+ export declare function getExistingPrivateKey(webId: NamedNode, privateKeyUrl: string): Promise<string | undefined>;
6
+ type KeyType = 'publicKey' | 'privateKey';
7
+ export declare function getKeyIfExists(webId: NamedNode, keyUrl: string, keyType: KeyType): Promise<string | undefined>;
8
+ export {};
9
+ //# sourceMappingURL=accessData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accessData.d.ts","sourceRoot":"","sources":["../../../src/utils/keyHelpers/accessData.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAGlC,eAAO,MAAM,SAAS,UAAW,SAAS,QASzC,CAAA;AAED,eAAO,MAAM,UAAU,UAAW,SAAS,QAS1C,CAAA;AAED,wBAAsB,oBAAoB,CAAE,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,+BAEjF;AAED,wBAAsB,qBAAqB,CAAE,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,+BAEnF;AAED,KAAK,OAAO,GAAG,WAAW,GAAG,YAAY,CAAA;AAEzC,wBAAsB,cAAc,CAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,+BASvF"}
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.getExistingPrivateKey = getExistingPrivateKey;
9
+ exports.getExistingPublicKey = getExistingPublicKey;
10
+ exports.getKeyIfExists = getKeyIfExists;
11
+ exports.pubKeyUrl = exports.privKeyUrl = void 0;
12
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
13
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
14
+ var debug = _interopRequireWildcard(require("../../debug"));
15
+ var _solidLogic = require("solid-logic");
16
+ var ns = _interopRequireWildcard(require("../../ns"));
17
+ var _otherHelpers = require("./otherHelpers");
18
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
20
+ var pubKeyUrl = function pubKeyUrl(webId) {
21
+ var url;
22
+ try {
23
+ var root = (0, _otherHelpers.getRootIfPreferencesExist)(webId);
24
+ url = "".concat(root, "/profile/keys/publicKey.ttl");
25
+ } catch (err) {
26
+ debug.error(err);
27
+ }
28
+ return url;
29
+ };
30
+ exports.pubKeyUrl = pubKeyUrl;
31
+ var privKeyUrl = function privKeyUrl(webId) {
32
+ var url;
33
+ try {
34
+ var root = (0, _otherHelpers.getRootIfPreferencesExist)(webId);
35
+ url = "".concat(root, "/keys/privateKey.ttl");
36
+ } catch (err) {
37
+ debug.error(err);
38
+ }
39
+ return url;
40
+ };
41
+ exports.privKeyUrl = privKeyUrl;
42
+ function getExistingPublicKey(_x, _x2) {
43
+ return _getExistingPublicKey.apply(this, arguments);
44
+ }
45
+ function _getExistingPublicKey() {
46
+ _getExistingPublicKey = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(webId, publicKeyUrl) {
47
+ return _regenerator["default"].wrap(function _callee$(_context) {
48
+ while (1) switch (_context.prev = _context.next) {
49
+ case 0:
50
+ _context.next = 2;
51
+ return getKeyIfExists(webId, publicKeyUrl, 'publicKey');
52
+ case 2:
53
+ return _context.abrupt("return", _context.sent);
54
+ case 3:
55
+ case "end":
56
+ return _context.stop();
57
+ }
58
+ }, _callee);
59
+ }));
60
+ return _getExistingPublicKey.apply(this, arguments);
61
+ }
62
+ function getExistingPrivateKey(_x3, _x4) {
63
+ return _getExistingPrivateKey.apply(this, arguments);
64
+ }
65
+ function _getExistingPrivateKey() {
66
+ _getExistingPrivateKey = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(webId, privateKeyUrl) {
67
+ return _regenerator["default"].wrap(function _callee2$(_context2) {
68
+ while (1) switch (_context2.prev = _context2.next) {
69
+ case 0:
70
+ _context2.next = 2;
71
+ return getKeyIfExists(webId, privateKeyUrl, 'privateKey');
72
+ case 2:
73
+ return _context2.abrupt("return", _context2.sent);
74
+ case 3:
75
+ case "end":
76
+ return _context2.stop();
77
+ }
78
+ }, _callee2);
79
+ }));
80
+ return _getExistingPrivateKey.apply(this, arguments);
81
+ }
82
+ function getKeyIfExists(_x5, _x6, _x7) {
83
+ return _getKeyIfExists.apply(this, arguments);
84
+ }
85
+ function _getKeyIfExists() {
86
+ _getKeyIfExists = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(webId, keyUrl, keyType) {
87
+ var key;
88
+ return _regenerator["default"].wrap(function _callee3$(_context3) {
89
+ while (1) switch (_context3.prev = _context3.next) {
90
+ case 0:
91
+ _context3.prev = 0;
92
+ _context3.next = 3;
93
+ return _solidLogic.store.fetcher.load(keyUrl);
94
+ case 3:
95
+ key = _solidLogic.store.any(webId, ns.solid(keyType)); // store.sym(CERT + keyType))
96
+ return _context3.abrupt("return", key === null || key === void 0 ? void 0 : key.value);
97
+ case 7:
98
+ _context3.prev = 7;
99
+ _context3.t0 = _context3["catch"](0);
100
+ debug.error('createIfNotExists doc FAILED: ' + keyUrl + ': ' + _context3.t0);
101
+ return _context3.abrupt("return", undefined);
102
+ case 11:
103
+ case "end":
104
+ return _context3.stop();
105
+ }
106
+ }, _callee3, null, [[0, 7]]);
107
+ }));
108
+ return _getKeyIfExists.apply(this, arguments);
109
+ }
110
+ //# sourceMappingURL=accessData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accessData.js","names":["debug","_interopRequireWildcard","require","_solidLogic","ns","_otherHelpers","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","pubKeyUrl","webId","url","root","getRootIfPreferencesExist","concat","err","error","exports","privKeyUrl","getExistingPublicKey","_x","_x2","_getExistingPublicKey","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee","publicKeyUrl","wrap","_callee$","_context","prev","next","getKeyIfExists","abrupt","sent","stop","getExistingPrivateKey","_x3","_x4","_getExistingPrivateKey","_callee2","privateKeyUrl","_callee2$","_context2","_x5","_x6","_x7","_getKeyIfExists","_callee3","keyUrl","keyType","_callee3$","_context3","store","fetcher","load","any","solid","value","t0","undefined"],"sources":["../../../src/utils/keyHelpers/accessData.ts"],"sourcesContent":["import * as debug from '../../debug'\nimport { store } from 'solid-logic'\nimport * as ns from '../../ns'\nimport { NamedNode } from 'rdflib'\nimport { getRootIfPreferencesExist } from './otherHelpers'\n\nexport const pubKeyUrl = (webId: NamedNode) => {\n let url\n try {\n const root = getRootIfPreferencesExist(webId)\n url = `${root}/profile/keys/publicKey.ttl`\n } catch (err) {\n debug.error(err)\n }\n return url\n}\n\nexport const privKeyUrl = (webId: NamedNode) => {\n let url\n try {\n const root = getRootIfPreferencesExist(webId)\n url = `${root}/keys/privateKey.ttl`\n } catch (err) {\n debug.error(err)\n }\n return url\n}\n\nexport async function getExistingPublicKey (webId: NamedNode, publicKeyUrl: string) {\n return await getKeyIfExists(webId, publicKeyUrl, 'publicKey')\n}\n\nexport async function getExistingPrivateKey (webId: NamedNode, privateKeyUrl: string) {\n return await getKeyIfExists(webId, privateKeyUrl, 'privateKey')\n}\n\ntype KeyType = 'publicKey' | 'privateKey'\n\nexport async function getKeyIfExists (webId: NamedNode, keyUrl: string, keyType: KeyType) {\n try {\n await store.fetcher.load(keyUrl)\n const key = store.any(webId, ns.solid(keyType)) // store.sym(CERT + keyType))\n return key?.value // as NamedNode\n } catch (err) {\n debug.error('createIfNotExists doc FAILED: ' + keyUrl + ': ' + err)\n return undefined\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAC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AM,CAAC;QAAA;UAC1BjD,GAAG,GAAGqD,iBAAK,CAACG,GAAG,CAACjD,KAAK,EAAEzB,EAAE,CAAC2E,KAAK,CAACP,OAAO,CAAC,CAAC,EAAC;UAAA,OAAAE,SAAA,CAAAnB,MAAA,WACzCjC,GAAG,aAAHA,GAAG,uBAAHA,GAAG,CAAE0D,KAAK;QAAA;UAAAN,SAAA,CAAAtB,IAAA;UAAAsB,SAAA,CAAAO,EAAA,GAAAP,SAAA;UAEjB1E,KAAK,CAACmC,KAAK,CAAC,gCAAgC,GAAGoC,MAAM,GAAG,IAAI,GAAAG,SAAA,CAAAO,EAAM,CAAC;UAAA,OAAAP,SAAA,CAAAnB,MAAA,WAC5D2B,SAAS;QAAA;QAAA;UAAA,OAAAR,SAAA,CAAAjB,IAAA;MAAA;IAAA,GAAAa,QAAA;EAAA,CAEnB;EAAA,OAAAD,eAAA,CAAA3B,KAAA,OAAAC,SAAA;AAAA"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * set ACL
3
+ * @param keyDoc
4
+ * @param aclBody
5
+ */
6
+ export declare function setAcl(keyDoc: string, aclBody: string): Promise<void>;
7
+ /**
8
+ * key container ACL
9
+ * @param me
10
+ * @returns aclBody
11
+ */
12
+ export declare const keyContainerAclBody: (me: string) => string;
13
+ /**
14
+ * Read only ACL
15
+ * @param keyDoc
16
+ * @param me
17
+ * @returns aclBody
18
+ */
19
+ export declare const keyAclBody: (keyDoc: any, me: any) => string;
20
+ //# sourceMappingURL=acl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acl.d.ts","sourceRoot":"","sources":["../../../src/utils/keyHelpers/acl.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAsB,MAAM,CAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,iBAsB5D;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,OAAQ,MAAM,WAe7C,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,UAAU,kCAatB,CAAA"}
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.keyContainerAclBody = exports.keyAclBody = void 0;
9
+ exports.setAcl = setAcl;
10
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
12
+ var debug = _interopRequireWildcard(require("../../debug"));
13
+ var _solidLogic = require("solid-logic");
14
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
15
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
16
+ /**
17
+ * set ACL
18
+ * @param keyDoc
19
+ * @param aclBody
20
+ */
21
+ function setAcl(_x, _x2) {
22
+ return _setAcl.apply(this, arguments);
23
+ }
24
+ /**
25
+ * key container ACL
26
+ * @param me
27
+ * @returns aclBody
28
+ */
29
+ function _setAcl() {
30
+ _setAcl = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(keyDoc, aclBody) {
31
+ var keyAclDoc, _err$response;
32
+ return _regenerator["default"].wrap(function _callee$(_context) {
33
+ while (1) switch (_context.prev = _context.next) {
34
+ case 0:
35
+ _context.next = 2;
36
+ return _solidLogic.store.fetcher.load(keyDoc);
37
+ case 2:
38
+ // FIXME: check the Why value on this quad:
39
+ debug.log(_solidLogic.store.statementsMatching(_solidLogic.store.sym(keyDoc), _solidLogic.store.sym('http://www.iana.org/assignments/link-relations/acl')));
40
+ keyAclDoc = _solidLogic.store.any(_solidLogic.store.sym(keyDoc), _solidLogic.store.sym('http://www.iana.org/assignments/link-relations/acl'));
41
+ if (keyAclDoc) {
42
+ _context.next = 6;
43
+ break;
44
+ }
45
+ throw new Error('Key ACL doc not found!');
46
+ case 6:
47
+ _context.prev = 6;
48
+ _context.next = 9;
49
+ return _solidLogic.store.fetcher.webOperation('PUT', keyAclDoc.value, {
50
+ data: aclBody,
51
+ contentType: 'text/turtle'
52
+ });
53
+ case 9:
54
+ _context.next = 16;
55
+ break;
56
+ case 11:
57
+ _context.prev = 11;
58
+ _context.t0 = _context["catch"](6);
59
+ if (!((_context.t0 === null || _context.t0 === void 0 ? void 0 : (_err$response = _context.t0.response) === null || _err$response === void 0 ? void 0 : _err$response.status) !== 404)) {
60
+ _context.next = 15;
61
+ break;
62
+ }
63
+ throw new Error(_context.t0);
64
+ case 15:
65
+ debug.log('delete ' + keyAclDoc.value + ' ' + _context.t0.response.status); // should test 404 and 2xx
66
+ case 16:
67
+ case "end":
68
+ return _context.stop();
69
+ }
70
+ }, _callee, null, [[6, 11]]);
71
+ }));
72
+ return _setAcl.apply(this, arguments);
73
+ }
74
+ var keyContainerAclBody = function keyContainerAclBody(me) {
75
+ var aclBody = "\n@prefix : <#>.\n@prefix acl: <http://www.w3.org/ns/auth/acl#>.\n@prefix foaf: <http://xmlns.com/foaf/0.1/>.\n@prefix key: <./>.\n\n:ReadWrite\n a acl:Authorization;\n acl:accessTo key:;\n acl:default key:;\n acl:agent <".concat(me, ">;\n acl:mode acl:Read, acl:Write.\n");
76
+ return aclBody;
77
+ };
78
+
79
+ /**
80
+ * Read only ACL
81
+ * @param keyDoc
82
+ * @param me
83
+ * @returns aclBody
84
+ */
85
+ exports.keyContainerAclBody = keyContainerAclBody;
86
+ var keyAclBody = function keyAclBody(keyDoc, me) {
87
+ var keyAgent = 'acl:agentClass foaf:Agent'; // publicKey
88
+ if (me !== null && me !== void 0 && me.length) keyAgent = "acl:agent <".concat(me, ">"); // privateKey
89
+ var aclBody = "\n@prefix foaf: <http://xmlns.com/foaf/0.1/>.\n@prefix acl: <http://www.w3.org/ns/auth/acl#>.\n<#Read>\n a acl:Authorization;\n ".concat(keyAgent, ";\n acl:accessTo <").concat(keyDoc.split('/').pop(), ">;\n acl:mode acl:Read.\n");
90
+ return aclBody;
91
+ };
92
+ exports.keyAclBody = keyAclBody;
93
+ //# sourceMappingURL=acl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acl.js","names":["debug","_interopRequireWildcard","require","_solidLogic","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","setAcl","_x","_x2","_setAcl","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee","keyDoc","aclBody","keyAclDoc","_err$response","wrap","_callee$","_context","prev","next","store","fetcher","load","log","statementsMatching","sym","any","Error","webOperation","value","data","contentType","t0","response","status","stop","keyContainerAclBody","me","concat","exports","keyAclBody","keyAgent","length","split","pop"],"sources":["../../../src/utils/keyHelpers/acl.ts"],"sourcesContent":["import * as debug from '../../debug'\nimport { store } from 'solid-logic'\n\n/**\n * set ACL\n * @param keyDoc\n * @param aclBody\n */\nexport async function setAcl (keyDoc: string, aclBody: string) {\n // Some servers don't present a Link http response header\n // if the container doesn't exist yet, refetch the resource\n\n await store.fetcher.load(keyDoc)\n\n // FIXME: check the Why value on this quad:\n debug.log(store.statementsMatching(store.sym(keyDoc), store.sym('http://www.iana.org/assignments/link-relations/acl')))\n const keyAclDoc = store.any(store.sym(keyDoc), store.sym('http://www.iana.org/assignments/link-relations/acl'))\n if (!keyAclDoc) {\n throw new Error('Key ACL doc not found!')\n }\n\n try {\n await store.fetcher.webOperation('PUT', keyAclDoc.value, {\n data: aclBody,\n contentType: 'text/turtle'\n })\n } catch (err) {\n if (err?.response?.status !== 404) { throw new Error(err) }\n debug.log('delete ' + keyAclDoc.value + ' ' + err.response.status) // should test 404 and 2xx\n }\n}\n\n/**\n * key container ACL\n * @param me\n * @returns aclBody\n */\nexport const keyContainerAclBody = (me: string) => {\n const aclBody = `\n@prefix : <#>.\n@prefix acl: <http://www.w3.org/ns/auth/acl#>.\n@prefix foaf: <http://xmlns.com/foaf/0.1/>.\n@prefix key: <./>.\n\n:ReadWrite\n a acl:Authorization;\n acl:accessTo key:;\n acl:default key:;\n acl:agent <${me}>;\n acl:mode acl:Read, acl:Write.\n`\n return aclBody\n}\n\n/**\n * Read only ACL\n * @param keyDoc\n * @param me\n * @returns aclBody\n */\nexport const keyAclBody = (keyDoc, me) => {\n let keyAgent = 'acl:agentClass foaf:Agent' // publicKey\n if (me?.length) keyAgent = `acl:agent <${me}>` // privateKey\n const aclBody = `\n@prefix foaf: <http://xmlns.com/foaf/0.1/>.\n@prefix acl: <http://www.w3.org/ns/auth/acl#>.\n<#Read>\n a acl:Authorization;\n ${keyAgent};\n acl:accessTo <${keyDoc.split('/').pop()}>;\n acl:mode acl:Read.\n`\n return aclBody\n}\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAAmC,SAAAE,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OA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,KAAK,CAAAV,QAAA,CAAAe,EAAA,CAAK;QAAA;UACzDzD,KAAK,CAACgD,GAAG,CAAC,SAAS,GAAGV,SAAS,CAACgB,KAAK,GAAG,GAAG,GAAGZ,QAAA,CAAAe,EAAA,CAAIC,QAAQ,CAACC,MAAM,CAAC,EAAC;QAAA;QAAA;UAAA,OAAAjB,QAAA,CAAAkB,IAAA;MAAA;IAAA,GAAAzB,OAAA;EAAA,CAEtE;EAAA,OAAAN,OAAA,CAAAC,KAAA,OAAAC,SAAA;AAAA;AAOM,IAAM8B,mBAAmB,GAAG,SAAtBA,mBAAmBA,CAAIC,EAAU,EAAK;EACjD,IAAMzB,OAAO,+OAAA0B,MAAA,CAUED,EAAE,4CAElB;EACC,OAAOzB,OAAO;AAChB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AALA2B,OAAA,CAAAH,mBAAA,GAAAA,mBAAA;AAMO,IAAMI,UAAU,GAAG,SAAbA,UAAUA,CAAI7B,MAAM,EAAE0B,EAAE,EAAK;EACxC,IAAII,QAAQ,GAAG,2BAA2B,EAAC;EAC3C,IAAIJ,EAAE,aAAFA,EAAE,eAAFA,EAAE,CAAEK,MAAM,EAAED,QAAQ,iBAAAH,MAAA,CAAiBD,EAAE,MAAG,EAAC;EAC/C,IAAMzB,OAAO,4IAAA0B,MAAA,CAKTG,QAAQ,2BAAAH,MAAA,CACM3B,MAAM,CAACgC,KAAK,CAAC,GAAG,CAAC,CAACC,GAAG,EAAE,iCAE1C;EACC,OAAOhC,OAAO;AAChB,CAAC;AAAA2B,OAAA,CAAAC,UAAA,GAAAA,UAAA"}
@@ -0,0 +1,3 @@
1
+ import { NamedNode } from 'rdflib';
2
+ export declare const getRootIfPreferencesExist: (webId: NamedNode) => string;
3
+ //# sourceMappingURL=otherHelpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"otherHelpers.d.ts","sourceRoot":"","sources":["../../../src/utils/keyHelpers/otherHelpers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAIlC,eAAO,MAAM,yBAAyB,UAAW,SAAS,WAKzD,CAAA"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ var _typeof = require("@babel/runtime/helpers/typeof");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.getRootIfPreferencesExist = void 0;
8
+ var _solidLogic = require("solid-logic");
9
+ var ns = _interopRequireWildcard(require("../../ns"));
10
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
12
+ // Will rename this file later. We will probably be using solid-logic anyway
13
+ // moved it out so I can mock
14
+
15
+ var getRootIfPreferencesExist = function getRootIfPreferencesExist(webId) {
16
+ var _store$any, _root;
17
+ var root = (_store$any = _solidLogic.store.any(webId, ns.space('preferencesFile'), null, webId.doc())) === null || _store$any === void 0 ? void 0 : _store$any.value;
18
+ root = (_root = root) === null || _root === void 0 ? void 0 : _root.split('/').slice(0, -2).join('/');
19
+ if (!root) throw new Error("prefererencesFile is expected to exist in ".concat(webId));
20
+ return root;
21
+ };
22
+ exports.getRootIfPreferencesExist = getRootIfPreferencesExist;
23
+ //# sourceMappingURL=otherHelpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"otherHelpers.js","names":["_solidLogic","require","ns","_interopRequireWildcard","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","getRootIfPreferencesExist","webId","_store$any","_root","root","store","any","space","doc","value","split","slice","join","Error","concat","exports"],"sources":["../../../src/utils/keyHelpers/otherHelpers.ts"],"sourcesContent":["import { store } from 'solid-logic'\nimport * as ns from '../../ns'\nimport { NamedNode } from 'rdflib'\n// Will rename this file later. We will probably be using solid-logic anyway\n// moved it out so I can mock\n\nexport const getRootIfPreferencesExist = (webId: NamedNode) => {\n let root = store.any(webId, ns.space('preferencesFile'), null, webId.doc())?.value\n root = root?.split('/').slice(0, -2).join('/')\n if (!root) throw new Error(`prefererencesFile is expected to exist in ${webId}`)\n return root\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,EAAA,GAAAC,uBAAA,CAAAF,OAAA;AAA8B,SAAAG,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAF,wBAAAM,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,aAAAE,OAAA,CAAAF,GAAA,yBAAAA,GAAA,uCAAAA,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA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K,EAAG;EAChF,OAAOG,IAAI;AACb,CAAC;AAAAW,OAAA,CAAAf,yBAAA,GAAAA,yBAAA"}
@@ -5,17 +5,17 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.versionInfo = void 0;
7
7
  var versionInfo = {
8
- buildTime: '2023-03-17T10:43:05Z',
9
- commit: '5b3471ff0bc08942d334b9bc9a6992adcb5cdb6b',
8
+ buildTime: '2023-06-03T23:47:41Z',
9
+ commit: '0f50605ddb2c3d741241f3c550cff483d05cb1ea',
10
10
  npmInfo: {
11
- 'solid-ui': '2.4.27',
11
+ 'solid-ui': '2.4.28',
12
12
  npm: '8.19.4',
13
- node: '16.19.1',
14
- v8: '9.4.146.26-node.24',
13
+ node: '16.20.0',
14
+ v8: '9.4.146.26-node.26',
15
15
  uv: '1.43.0',
16
16
  zlib: '1.2.11',
17
17
  brotli: '1.0.9',
18
- ares: '1.18.1',
18
+ ares: '1.19.0',
19
19
  modules: '93',
20
20
  nghttp2: '1.47.0',
21
21
  napi: '8',