solid-ui 2.4.27-13192548 → 2.4.27-18070a02
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.
- package/README.md +5 -1
- package/dist/670.solid-ui.min.js +1 -0
- package/dist/805.solid-ui.min.js +3 -0
- package/dist/805.solid-ui.min.js.LICENSE.txt +58 -0
- package/dist/805.solid-ui.min.js.map +1 -0
- package/dist/_2b19.solid-ui.js +14 -0
- package/dist/_2b19.solid-ui.js.map +1 -0
- package/dist/solid-ui.js +8579 -21946
- package/dist/solid-ui.js.map +1 -1
- package/dist/solid-ui.min.js +1 -1
- package/dist/solid-ui.min.js.LICENSE.txt +4 -67
- package/dist/solid-ui.min.js.map +1 -1
- package/dist/vendors-node_modules_jsonld_lib_jsonld_js.solid-ui.js +12134 -0
- package/dist/vendors-node_modules_jsonld_lib_jsonld_js.solid-ui.js.map +1 -0
- package/lib/acl/access-controller.d.ts +2 -3
- package/lib/acl/access-controller.d.ts.map +1 -1
- package/lib/acl/access-controller.js +17 -15
- package/lib/acl/access-controller.js.map +1 -1
- package/lib/acl/access-groups.d.ts.map +1 -1
- package/lib/acl/access-groups.js +78 -8
- package/lib/acl/access-groups.js.map +1 -1
- package/lib/acl/acl-control.d.ts.map +1 -1
- package/lib/acl/acl-control.js +10 -11
- package/lib/acl/acl-control.js.map +1 -1
- package/lib/acl/acl.d.ts +1 -1
- package/lib/acl/acl.js +1 -1
- package/lib/acl/acl.js.map +1 -1
- package/lib/acl/add-agent-buttons.d.ts.map +1 -1
- package/lib/acl/add-agent-buttons.js +4 -3
- package/lib/acl/add-agent-buttons.js.map +1 -1
- package/lib/chat/bookmarks.js +7 -6
- package/lib/chat/bookmarks.js.map +1 -1
- package/lib/chat/chatLogic.js +103 -248
- package/lib/chat/chatLogic.js.map +1 -1
- package/lib/chat/infinite.js +426 -604
- package/lib/chat/infinite.js.map +1 -1
- package/lib/chat/keys.d.ts +6 -0
- package/lib/chat/keys.d.ts.map +1 -0
- package/lib/chat/keys.js +215 -0
- package/lib/chat/keys.js.map +1 -0
- package/lib/chat/message.js +191 -285
- package/lib/chat/message.js.map +1 -1
- package/lib/chat/messageTools.js +276 -464
- package/lib/chat/messageTools.js.map +1 -1
- package/lib/chat/signature.d.ts +25 -0
- package/lib/chat/signature.d.ts.map +1 -0
- package/lib/chat/signature.js +113 -0
- package/lib/chat/signature.js.map +1 -0
- package/lib/chat/thread.js +144 -166
- package/lib/chat/thread.js.map +1 -1
- package/lib/footer/index.d.ts.map +1 -1
- package/lib/footer/index.js +5 -1
- package/lib/footer/index.js.map +1 -1
- package/lib/header/index.d.ts.map +1 -1
- package/lib/header/index.js +41 -20
- package/lib/header/index.js.map +1 -1
- package/lib/login/login.d.ts.map +1 -1
- package/lib/login/login.js +13 -15
- package/lib/login/login.js.map +1 -1
- package/lib/preferences.js +0 -4
- package/lib/preferences.js.map +1 -1
- package/lib/style.js +60 -2
- package/lib/style.js.map +1 -1
- package/lib/utils/headerFooterHelpers.d.ts +0 -4
- package/lib/utils/headerFooterHelpers.d.ts.map +1 -1
- package/lib/utils/headerFooterHelpers.js +0 -27
- package/lib/utils/headerFooterHelpers.js.map +1 -1
- package/lib/utils/keyHelpers/accessData.d.ts +10 -0
- package/lib/utils/keyHelpers/accessData.d.ts.map +1 -0
- package/lib/utils/keyHelpers/accessData.js +226 -0
- package/lib/utils/keyHelpers/accessData.js.map +1 -0
- package/lib/utils/keyHelpers/acl.d.ts +20 -0
- package/lib/utils/keyHelpers/acl.d.ts.map +1 -0
- package/lib/utils/keyHelpers/acl.js +101 -0
- package/lib/utils/keyHelpers/acl.js.map +1 -0
- package/lib/versionInfo.js +2 -2
- package/lib/versionInfo.js.map +1 -1
- package/lib/widgets/buttons.d.ts.map +1 -1
- package/lib/widgets/buttons.js +43 -49
- package/lib/widgets/buttons.js.map +1 -1
- package/package.json +9 -8
- package/lib/acl/styles.d.ts +0 -90
- package/lib/acl/styles.d.ts.map +0 -1
- package/lib/acl/styles.js +0 -98
- package/lib/acl/styles.js.map +0 -1
- package/lib/footer/styleMap.d.ts +0 -8
- package/lib/footer/styleMap.d.ts.map +0 -1
- package/lib/footer/styleMap.js +0 -15
- package/lib/footer/styleMap.js.map +0 -1
- package/lib/header/styleMap.d.ts +0 -117
- package/lib/header/styleMap.d.ts.map +0 -1
- package/lib/header/styleMap.js +0 -139
- package/lib/header/styleMap.js.map +0 -1
- package/lib/jss/index.d.ts +0 -20
- package/lib/jss/index.d.ts.map +0 -1
- package/lib/jss/index.js +0 -47
- 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: '
|
|
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,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;EACrIC,oBAAoB,EAAE,4BAA4B;EAElD;EACAC,iBAAiB,EAAE,qDAAqD;EAAE;;EAE1E;EACAC,aAAa,EAAE,yFAAyF;EAAE;EAC1GC,aAAa,EAAE,0FAA0F;EAAE;EAC3GC,aAAa,EAAE,0FAA0F;EAAE;EAC3GC,aAAa,EAAE,0FAA0F;EAAE;;EAE3G5B,eAAe,EAAfA,eAAe;EAAE;EACjB6B,gBAAgB,EAAE,SAAS;EAAE;EAC7BC,gBAAgB,EAAE,2FAA2F;EAAE;EAC/GC,aAAa,EAAE,iDAAiD;EAAE;EAClEC,cAAc,EAAE,2CAAAC,MAAA,CAA2CjC,eAAe,8BAA2B;EAAA,2CAAAiC,MAAA,CACxDjC,eAAe,wEAAAiC,MAAA,CAChBjC,eAAe,wEAAAiC,MAAA,CACfjC,eAAe,6BAA0B;EAAA,CACpF;EAEDkC,mBAAmB,aAAAD,MAAA,CAAahC,mBAAmB,8BAA2B;EAC9EC,qBAAqB,EAArBA,qBAAqB;EACrBiC,qBAAqB,mDAAAF,MAAA,CAAmD/B,qBAAqB,MAAG;EAChGkC,wBAAwB,EAAE,MAAM;EAChCC,kCAAkC,EAAE,MAAM;EAC1CC,cAAc,EAAE,MAAM;EACtBC,qBAAqB,EAAE,MAAM;EAC7BC,uBAAuB,EAAE,gEAAgE,GACzF,kEAAkE;EAElE;EACAC,gBAAgB,EAAE,kGAAkG;EACpHC,aAAa,EAAE,4CAA4C;EAC3DC,YAAY,EAAE;AAChB,CAAC;AAAAC,OAAA,CAAAzC,KAAA,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,GAA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EAAE,yCAAyC;EAC7DC,yBAAyB,EAAE,uDAAuD;EAClFC,4BAA4B,EAAE,iJAAiJ;EAC/KC,wCAAwC,EAAE,iJAAiJ;EAC3LC,sBAAsB,EAAE,kCAAkC;EAC1DC,mBAAmB,EAAE,kIAAkI;EACvJC,YAAY,EAAE,sHAAsH;EACpIC,gBAAgB,EAAE,gBAAgB;EAClCC,qBAAqB,EAAE,eAAe;EACtCC,iBAAiB,EAAE,mBAAmB;EACtCC,kBAAkB,EAAE,cAAc;EAClCC,sBAAsB,EAAE,qEAAqE;EAC7FC,oBAAoB,EAAE,mDAAmD;EACzEC,oBAAoB,EAAE,mDAAmD;EACzEC,gBAAgB,EAAE,wFAAwF;EAAE;;EAE5G;EACAC,MAAM,EAAE,8EAA8E;EAEtF;EACAC,aAAa,EAAE,oRAAoR;EAEnSC,kBAAkB,EAAE,sTAAsT;EAE1UC,qBAAqB,EAAE,mRAAmR;EAE1SC,0BAA0B,EAAE,wTAAwT;EAEpVC,eAAe,EAAE,mRAAmR;EAEpSC,oBAAoB,EAAE,sTAAsT;EAE5UC,uBAAuB,EAAE,qRAAqR;EAE9SC,4BAA4B,EAAE;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;
|
|
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,18 @@ 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
|
-
}
|
|
34
|
-
|
|
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
19
|
/**
|
|
47
20
|
* @ignore exporting this only for the unit test
|
|
48
21
|
*/
|
|
@@ -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,UAAA,GAAAH,OAAA;AACA,IAAAI,IAAA,GAAAJ,OAAA;AAPA;AACA;AACA;;AAaA;AACA;AACA;AACA,SAASK,QAAQA,CAAEC,UAAU,EAAEC,IAAK,EAAE;EACpC,IAAIA,IAAI,IAAIA,IAAI,KAAK,QAAQ,EAAE;IAC7B,OAAOC,mBAAc,CAACF,UAAU,CAAC;EACnC,CAAC,MAAM;IACL,OAAOG,kBAAc,CAACH,UAAU,CAAC;EACnC;AACF;;AAEA;AACA;AACA;AACO,SAASI,sBAAsBA,CAAEC,OAAY,EAAEC,YAAsB,EAAEL,IAAa,EAAE;EAC3FK,YAAY,CAACC,OAAO,CAAC,UAACP,UAAU,EAAK;IACnC,IAAMQ,KAAK,GAAGT,QAAQ,CAACC,UAAU,EAAEC,IAAI,CAAC;IACxC,IAAAQ,WAAA,GAAoB,IAAAC,eAAU,EAACC,QAAQ,CAACC,IAAI,MAAAC,gBAAA,iBAAKb,UAAU,EAAGQ,KAAK,EAAG;MAA9DM,OAAO,GAAAL,WAAA,CAAPK,OAAO;IACfT,OAAO,CAACU,SAAS,CAACC,GAAG,CAACF,OAAO,CAACd,UAAU,CAAC,CAAC;EAC5C,CAAC,CAAC;AACJ;AACA;AACA;AACA;AACO,SAASiB,MAAMA,CAAA,EAAe;EACnC;E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,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"}
|
|
1
|
+
{"version":3,"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,GAAAD,OAAA;AAJA;AACA;AACA;;AAWA;AACA;AACA;AACO,SAASE,MAAMA,CAAA,EAAe;EACnC;EACA,OAAO,IAAAC,WAAG,EAACC,QAAQ,CAACC,QAAQ,CAACC,MAAM,CAAC,CAACC,IAAI,EAAE;AAC7C;AACA;AACA;AADA,SAEsBC,WAAWA,CAAAC,EAAA,EAAAC,GAAA;EAAA,OAAAC,YAAA,CAAAC,KAAA,OAAAC,SAAA;AAAA;AAmDjC;AACA;AACA;AAFA,SAAAF,aAAA;EAAAA,YAAA,OAAAG,kBAAA,2BAAAC,YAAA,YAAAC,IAAA,CAnDO,SAAAC,QAA4BC,GAAc,EAAEC,KAAgB;IAAA,IAAAC,QAAA,EAAAC,eAAA,EAAAC,QAAA,EAAAC,KAAA;IAAA,OAAAR,YAAA,YAAAS,IAAA,UAAAC,SAAAC,QAAA;MAAA,kBAAAA,QAAA,CAAAC,IAAA,GAAAD,QAAA,CAAAE,IAAA;QAAA;UAAAF,QAAA,CAAAC,IAAA;UAAA,IAM1DR,KAAK,CAACU,GAAG,CAACX,GAAG,EAAE,IAAI,EAAEY,IAAE,CAACC,GAAG,CAAC,WAAW,CAAC,EAAEb,GAAG,CAAC;YAAAQ,QAAA,CAAAE,IAAA;YAAA;UAAA;UAAAF,QA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;IAC5CL,OAAO,GAAG,IAAI;IACdD,MAAM,GAAGP,IAAI,CAAClD,KAAK,CAACuD,OAAO,EAAEC,IAAI,CAAC;IAClC,IAAI,CAACE,OAAO,EAAEH,OAAO,GAAGC,IAAI,GAAG,IAAI;EACrC,CAAC;EACD,OAAO,YAAY;IACjB,IAAMO,GAAG,GAAGD,IAAI,CAACC,GAAG,EAAE;IACtB,IAAI,CAACJ,QAAQ,IAAI,CAACP,OAAO,CAACS,OAAO,EAAEF,QAAQ,GAAGI,GAAG;IACjD,IAAMC,SAAS,GAAGb,IAAI,IAAIY,GAAG,GAAGJ,QAAQ,CAAC;IACzC;IACAJ,OAAO,GAAG,IAAI;IACdC,IAAI,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,10 @@
|
|
|
1
|
+
import { NamedNode } from 'rdflib';
|
|
2
|
+
export declare const getPodRoot: (webId: NamedNode) => Promise<string | undefined>;
|
|
3
|
+
export declare const pubKeyUrl: (webId: NamedNode) => Promise<string>;
|
|
4
|
+
export declare function getExistingPublicKey(webId: NamedNode, publicKeyUrl: string): Promise<string | undefined>;
|
|
5
|
+
export declare const privKeyUrl: (webId: NamedNode) => Promise<string>;
|
|
6
|
+
export declare function getExistingPrivateKey(webId: NamedNode, privateKeyUrl: string): Promise<string | undefined>;
|
|
7
|
+
type KeyType = 'PublicKey' | 'PrivateKey';
|
|
8
|
+
export declare function getKeyIfExists(webId: NamedNode, keyUrl: string, keyType: KeyType): Promise<string | undefined>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=accessData.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accessData.d.ts","sourceRoot":"","sources":["../../../src/utils/keyHelpers/accessData.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAElC,eAAO,MAAM,UAAU,UAAiB,SAAS,gCAsBhD,CAAA;AAED,eAAO,MAAM,SAAS,UAAiB,SAAS,oBAI/C,CAAA;AAED,wBAAsB,oBAAoB,CAAE,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,+BAGjF;AAED,eAAO,MAAM,UAAU,UAAiB,SAAS,oBAIhD,CAAA;AAED,wBAAsB,qBAAqB,CAAE,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,+BAGnF;AAED,KAAK,OAAO,GAAG,WAAW,GAAG,YAAY,CAAA;AAEzC,wBAAsB,cAAc,CAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,+BAyBvF"}
|
|
@@ -0,0 +1,226 @@
|
|
|
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 = exports.getPodRoot = 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 _signature = require("../../chat/signature");
|
|
16
|
+
var _solidLogic = require("solid-logic");
|
|
17
|
+
var ns = _interopRequireWildcard(require("../../ns"));
|
|
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 getPodRoot = /*#__PURE__*/function () {
|
|
21
|
+
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(webId) {
|
|
22
|
+
var _podRoot;
|
|
23
|
+
var webIdURL, storages, podRoot, path, _res$headers$get, res;
|
|
24
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
25
|
+
while (1) switch (_context.prev = _context.next) {
|
|
26
|
+
case 0:
|
|
27
|
+
webIdURL = new URL(webId.uri); // find storages in webId document
|
|
28
|
+
_context.next = 3;
|
|
29
|
+
return _solidLogic.store.fetcher.load(webId.uri);
|
|
30
|
+
case 3:
|
|
31
|
+
storages = _solidLogic.store.each(webId, ns.space('storage'), null, webId.doc());
|
|
32
|
+
if (storages !== null && storages !== void 0 && storages.length) {
|
|
33
|
+
_context.next = 19;
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
// find storage recursively in webId URL
|
|
37
|
+
path = webIdURL.pathname;
|
|
38
|
+
case 6:
|
|
39
|
+
if (!path.length) {
|
|
40
|
+
_context.next = 17;
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
path = path.substring(0, path.lastIndexOf('/'));
|
|
44
|
+
podRoot = _solidLogic.store.sym(webIdURL.origin + path + '/');
|
|
45
|
+
_context.next = 11;
|
|
46
|
+
return _solidLogic.store.fetcher.webOperation('HEAD', podRoot.uri);
|
|
47
|
+
case 11:
|
|
48
|
+
res = _context.sent;
|
|
49
|
+
if (!((_res$headers$get = res.headers.get('link')) !== null && _res$headers$get !== void 0 && _res$headers$get.includes(ns.space('Storage').value))) {
|
|
50
|
+
_context.next = 14;
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
return _context.abrupt("break", 17);
|
|
54
|
+
case 14:
|
|
55
|
+
if (!path) debug.warn("Current user storage not found for\n".concat(webId));
|
|
56
|
+
_context.next = 6;
|
|
57
|
+
break;
|
|
58
|
+
case 17:
|
|
59
|
+
_context.next = 21;
|
|
60
|
+
break;
|
|
61
|
+
case 19:
|
|
62
|
+
// give preference to storage in webId root
|
|
63
|
+
podRoot = storages.find(function (storage) {
|
|
64
|
+
return webIdURL.origin === new URL(storage.value).origin;
|
|
65
|
+
});
|
|
66
|
+
if (!podRoot) podRoot = storages[0];
|
|
67
|
+
case 21:
|
|
68
|
+
return _context.abrupt("return", (_podRoot = podRoot) === null || _podRoot === void 0 ? void 0 : _podRoot.value);
|
|
69
|
+
case 22:
|
|
70
|
+
case "end":
|
|
71
|
+
return _context.stop();
|
|
72
|
+
}
|
|
73
|
+
}, _callee);
|
|
74
|
+
}));
|
|
75
|
+
return function getPodRoot(_x) {
|
|
76
|
+
return _ref.apply(this, arguments);
|
|
77
|
+
};
|
|
78
|
+
}();
|
|
79
|
+
exports.getPodRoot = getPodRoot;
|
|
80
|
+
var pubKeyUrl = /*#__PURE__*/function () {
|
|
81
|
+
var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(webId) {
|
|
82
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
83
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
84
|
+
case 0:
|
|
85
|
+
_context2.prev = 0;
|
|
86
|
+
_context2.next = 3;
|
|
87
|
+
return getPodRoot(webId);
|
|
88
|
+
case 3:
|
|
89
|
+
_context2.t0 = _context2.sent;
|
|
90
|
+
return _context2.abrupt("return", _context2.t0 + 'profile/keys/publicKey.ttl');
|
|
91
|
+
case 7:
|
|
92
|
+
_context2.prev = 7;
|
|
93
|
+
_context2.t1 = _context2["catch"](0);
|
|
94
|
+
throw new Error(_context2.t1);
|
|
95
|
+
case 10:
|
|
96
|
+
case "end":
|
|
97
|
+
return _context2.stop();
|
|
98
|
+
}
|
|
99
|
+
}, _callee2, null, [[0, 7]]);
|
|
100
|
+
}));
|
|
101
|
+
return function pubKeyUrl(_x2) {
|
|
102
|
+
return _ref2.apply(this, arguments);
|
|
103
|
+
};
|
|
104
|
+
}();
|
|
105
|
+
exports.pubKeyUrl = pubKeyUrl;
|
|
106
|
+
function getExistingPublicKey(_x3, _x4) {
|
|
107
|
+
return _getExistingPublicKey.apply(this, arguments);
|
|
108
|
+
}
|
|
109
|
+
function _getExistingPublicKey() {
|
|
110
|
+
_getExistingPublicKey = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(webId, publicKeyUrl) {
|
|
111
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
112
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
113
|
+
case 0:
|
|
114
|
+
_context4.next = 2;
|
|
115
|
+
return getKeyIfExists(webId, publicKeyUrl, 'PublicKey');
|
|
116
|
+
case 2:
|
|
117
|
+
return _context4.abrupt("return", _context4.sent);
|
|
118
|
+
case 3:
|
|
119
|
+
case "end":
|
|
120
|
+
return _context4.stop();
|
|
121
|
+
}
|
|
122
|
+
}, _callee4);
|
|
123
|
+
}));
|
|
124
|
+
return _getExistingPublicKey.apply(this, arguments);
|
|
125
|
+
}
|
|
126
|
+
var privKeyUrl = /*#__PURE__*/function () {
|
|
127
|
+
var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(webId) {
|
|
128
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
129
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
130
|
+
case 0:
|
|
131
|
+
_context3.prev = 0;
|
|
132
|
+
_context3.next = 3;
|
|
133
|
+
return getPodRoot(webId);
|
|
134
|
+
case 3:
|
|
135
|
+
_context3.t0 = _context3.sent;
|
|
136
|
+
return _context3.abrupt("return", _context3.t0 + 'profile/keys/privateKey.ttl');
|
|
137
|
+
case 7:
|
|
138
|
+
_context3.prev = 7;
|
|
139
|
+
_context3.t1 = _context3["catch"](0);
|
|
140
|
+
throw new Error(_context3.t1);
|
|
141
|
+
case 10:
|
|
142
|
+
case "end":
|
|
143
|
+
return _context3.stop();
|
|
144
|
+
}
|
|
145
|
+
}, _callee3, null, [[0, 7]]);
|
|
146
|
+
}));
|
|
147
|
+
return function privKeyUrl(_x5) {
|
|
148
|
+
return _ref3.apply(this, arguments);
|
|
149
|
+
};
|
|
150
|
+
}();
|
|
151
|
+
exports.privKeyUrl = privKeyUrl;
|
|
152
|
+
function getExistingPrivateKey(_x6, _x7) {
|
|
153
|
+
return _getExistingPrivateKey.apply(this, arguments);
|
|
154
|
+
}
|
|
155
|
+
function _getExistingPrivateKey() {
|
|
156
|
+
_getExistingPrivateKey = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(webId, privateKeyUrl) {
|
|
157
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
158
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
159
|
+
case 0:
|
|
160
|
+
_context5.next = 2;
|
|
161
|
+
return getKeyIfExists(webId, privateKeyUrl, 'PrivateKey');
|
|
162
|
+
case 2:
|
|
163
|
+
return _context5.abrupt("return", _context5.sent);
|
|
164
|
+
case 3:
|
|
165
|
+
case "end":
|
|
166
|
+
return _context5.stop();
|
|
167
|
+
}
|
|
168
|
+
}, _callee5);
|
|
169
|
+
}));
|
|
170
|
+
return _getExistingPrivateKey.apply(this, arguments);
|
|
171
|
+
}
|
|
172
|
+
function getKeyIfExists(_x8, _x9, _x10) {
|
|
173
|
+
return _getKeyIfExists.apply(this, arguments);
|
|
174
|
+
}
|
|
175
|
+
function _getKeyIfExists() {
|
|
176
|
+
_getKeyIfExists = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(webId, keyUrl, keyType) {
|
|
177
|
+
var key, _err$response, data, contentType, response;
|
|
178
|
+
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
|
179
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
180
|
+
case 0:
|
|
181
|
+
_context6.prev = 0;
|
|
182
|
+
_context6.next = 3;
|
|
183
|
+
return _solidLogic.store.fetcher.load(keyUrl);
|
|
184
|
+
case 3:
|
|
185
|
+
key = _solidLogic.store.any(webId, _solidLogic.store.sym(_signature.CERT + keyType));
|
|
186
|
+
return _context6.abrupt("return", key === null || key === void 0 ? void 0 : key.value);
|
|
187
|
+
case 7:
|
|
188
|
+
_context6.prev = 7;
|
|
189
|
+
_context6.t0 = _context6["catch"](0);
|
|
190
|
+
if (!((_context6.t0 === null || _context6.t0 === void 0 ? void 0 : (_err$response = _context6.t0.response) === null || _err$response === void 0 ? void 0 : _err$response.status) === 404)) {
|
|
191
|
+
_context6.next = 24;
|
|
192
|
+
break;
|
|
193
|
+
}
|
|
194
|
+
_context6.prev = 10;
|
|
195
|
+
// create resource
|
|
196
|
+
data = '';
|
|
197
|
+
contentType = 'text/turtle';
|
|
198
|
+
_context6.next = 15;
|
|
199
|
+
return _solidLogic.store.fetcher.webOperation('PUT', keyUrl, {
|
|
200
|
+
data: data,
|
|
201
|
+
contentType: contentType
|
|
202
|
+
});
|
|
203
|
+
case 15:
|
|
204
|
+
response = _context6.sent;
|
|
205
|
+
_context6.next = 22;
|
|
206
|
+
break;
|
|
207
|
+
case 18:
|
|
208
|
+
_context6.prev = 18;
|
|
209
|
+
_context6.t1 = _context6["catch"](10);
|
|
210
|
+
debug.log('createIfNotExists doc FAILED: ' + keyUrl + ': ' + _context6.t1);
|
|
211
|
+
throw _context6.t1;
|
|
212
|
+
case 22:
|
|
213
|
+
delete _solidLogic.store.fetcher.requested[keyUrl]; // delete cached 404 error
|
|
214
|
+
return _context6.abrupt("return", undefined);
|
|
215
|
+
case 24:
|
|
216
|
+
debug.log('createIfNotExists doc FAILED: ' + keyUrl + ': ' + _context6.t0);
|
|
217
|
+
throw _context6.t0;
|
|
218
|
+
case 26:
|
|
219
|
+
case "end":
|
|
220
|
+
return _context6.stop();
|
|
221
|
+
}
|
|
222
|
+
}, _callee6, null, [[0, 7], [10, 18]]);
|
|
223
|
+
}));
|
|
224
|
+
return _getKeyIfExists.apply(this, arguments);
|
|
225
|
+
}
|
|
226
|
+
//# sourceMappingURL=accessData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accessData.js","names":["debug","_interopRequireWildcard","require","_signature","_solidLogic","ns","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","getPodRoot","_ref","_asyncToGenerator2","_regenerator","mark","_callee","webId","_podRoot","webIdURL","storages","podRoot","path","_res$headers$get","res","wrap","_callee$","_context","prev","next","URL","uri","store","fetcher","load","each","space","doc","length","pathname","substring","lastIndexOf","sym","origin","webOperation","sent","headers","includes","value","abrupt","warn","concat","find","storage","stop","_x","apply","arguments","exports","pubKeyUrl","_ref2","_callee2","_callee2$","_context2","t0","t1","Error","_x2","getExistingPublicKey","_x3","_x4","_getExistingPublicKey","_callee4","publicKeyUrl","_callee4$","_context4","getKeyIfExists","privKeyUrl","_ref3","_callee3","_callee3$","_context3","_x5","getExistingPrivateKey","_x6","_x7","_getExistingPrivateKey","_callee5","privateKeyUrl","_callee5$","_context5","_x8","_x9","_x10","_getKeyIfExists","_callee6","keyUrl","keyType","_err$response","data","contentType","response","_callee6$","_context6","any","CERT","status","log","requested","undefined"],"sources":["../../../src/utils/keyHelpers/accessData.ts"],"sourcesContent":["import * as debug from '../../debug'\nimport { CERT } from '../../chat/signature'\nimport { store } from 'solid-logic'\nimport * as ns from '../../ns'\nimport { NamedNode } from 'rdflib'\n\nexport const getPodRoot = async (webId: NamedNode) => {\n const webIdURL = new URL(webId.uri)\n // find storages in webId document\n await store.fetcher.load(webId.uri)\n const storages = store.each(webId, ns.space('storage'), null, webId.doc())\n var podRoot: NamedNode | undefined\n if (!storages?.length) {\n // find storage recursively in webId URL\n let path = webIdURL.pathname\n while (path.length) {\n path = path.substring(0, path.lastIndexOf('/'))\n podRoot = store.sym(webIdURL.origin + path + '/')\n const res = await store.fetcher.webOperation('HEAD', podRoot.uri)\n if (res.headers.get('link')?.includes(ns.space('Storage').value)) break\n if (!path) debug.warn(`Current user storage not found for\\n${webId}`)\n }\n } else {\n // give preference to storage in webId root\n podRoot = storages.find((storage) => webIdURL.origin === new URL(storage.value).origin) as NamedNode\n if (!podRoot) podRoot = storages[0] as NamedNode\n }\n return podRoot?.value\n}\n\nexport const pubKeyUrl = async (webId: NamedNode) => {\n try {\n return await getPodRoot(webId) + 'profile/keys/publicKey.ttl'\n } catch (err) { throw new Error(err) }\n}\n\nexport async function getExistingPublicKey (webId: NamedNode, publicKeyUrl: string) {\n // find publickey\n return await getKeyIfExists(webId, publicKeyUrl, 'PublicKey')\n}\n\nexport const privKeyUrl = async (webId: NamedNode) => {\n try {\n return await getPodRoot(webId) + 'profile/keys/privateKey.ttl'\n } catch (err) { throw new Error(err) }\n}\n\nexport async function getExistingPrivateKey (webId: NamedNode, privateKeyUrl: string) {\n // find privateKey\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, store.sym(CERT + keyType))\n return key?.value // as NamedNode\n } catch (err) {\n if (err?.response?.status === 404) { // If PATCH on some server do not all create intermediate containers\n try {\n // create resource\n const data = ''\n const contentType = 'text/turtle'\n const response = await store.fetcher.webOperation('PUT', keyUrl, {\n data,\n contentType\n })\n } catch (err) {\n debug.log('createIfNotExists doc FAILED: ' + keyUrl + ': ' + err)\n throw err\n }\n delete store.fetcher.requested[keyUrl] // delete cached 404 error\n return undefined\n }\n debug.log('createIfNotExists doc FAILED: ' + keyUrl + ': ' + err)\n throw err\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,EAAA,GAAAJ,uBAAA,CAAAC,OAAA;AAA8B,SAAAI,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,SAAAN,wBAAAU,GAAA,EAAAJ,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M,EAAE;YAC/DG,IAAI,EAAJA,IAAI;YACJC,WAAW,EAAXA;UACF,CAAC,CAAC;QAAA;UAHIC,QAAQ,GAAAE,SAAA,CAAA1D,IAAA;UAAA0D,SAAA,CAAA1E,IAAA;UAAA;QAAA;UAAA0E,SAAA,CAAA3E,IAAA;UAAA2E,SAAA,CAAAtC,EAAA,GAAAsC,SAAA;UAKdxH,KAAK,CAAC4H,GAAG,CAAC,gCAAgC,GAAGX,MAAM,GAAG,IAAI,GAAAO,SAAA,CAAAtC,EAAM,CAAC;UAAA,MAAAsC,SAAA,CAAAtC,EAAA;QAAA;UAGnE,OAAOjC,iBAAK,CAACC,OAAO,CAAC2E,SAAS,CAACZ,MAAM,CAAC,EAAC;UAAA,OAAAO,SAAA,CAAAtD,MAAA,WAChC4D,SAAS;QAAA;UAElB9H,KAAK,CAAC4H,GAAG,CAAC,gCAAgC,GAAGX,MAAM,GAAG,IAAI,GAAAO,SAAA,CAAAvC,EAAM,CAAC;UAAA,MAAAuC,SAAA,CAAAvC,EAAA;QAAA;QAAA;UAAA,OAAAuC,SAAA,CAAAjD,IAAA;MAAA;IAAA,GAAAyC,QAAA;EAAA,CAGpE;EAAA,OAAAD,eAAA,CAAAtC,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,iBA0B5D;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,OAAQ,MAAM,WAe7C,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,UAAU,kCAatB,CAAA"}
|