solid-ui 2.4.22-d52421dc → 2.4.22-d6a4e62e
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/dist/main.js +9579 -9553
- package/dist/main.js.map +1 -1
- package/lib/acl/access-controller.js +14 -9
- package/lib/acl/access-controller.js.map +1 -1
- package/lib/acl/access-groups.js +15 -10
- package/lib/acl/access-groups.js.map +1 -1
- package/lib/acl/acl-control.js +13 -9
- package/lib/acl/acl-control.js.map +1 -1
- package/lib/acl/acl.js +11 -7
- package/lib/acl/acl.js.map +1 -1
- package/lib/acl/add-agent-buttons.js +18 -13
- package/lib/acl/add-agent-buttons.js.map +1 -1
- package/lib/chat/bookmarks.js +21 -18
- package/lib/chat/bookmarks.js.map +1 -1
- package/lib/chat/chatLogic.js +15 -9
- package/lib/chat/chatLogic.js.map +1 -1
- package/lib/chat/dateFolder.js +17 -12
- package/lib/chat/dateFolder.js.map +1 -1
- package/lib/chat/infinite.js +37 -29
- package/lib/chat/infinite.js.map +1 -1
- package/lib/chat/message.js +14 -14
- package/lib/chat/message.js.map +1 -1
- package/lib/chat/messageTools.js +23 -10
- package/lib/chat/messageTools.js.map +1 -1
- package/lib/chat/thread.js +9 -4
- package/lib/chat/thread.js.map +1 -1
- package/lib/footer/index.js +10 -8
- package/lib/footer/index.js.map +1 -1
- package/lib/header/index.js +17 -9
- package/lib/header/index.js.map +1 -1
- package/lib/iconBase.js +3 -2
- package/lib/iconBase.js.map +1 -1
- package/lib/login/login.d.ts +9 -8
- package/lib/login/login.d.ts.map +1 -1
- package/lib/login/login.js +303 -313
- package/lib/login/login.js.map +1 -1
- package/lib/media/media-capture.js +20 -4
- package/lib/media/media-capture.js.map +1 -1
- package/lib/tabs.d.ts.map +1 -1
- package/lib/tabs.js +21 -18
- package/lib/tabs.js.map +1 -1
- package/lib/utils/headerFooterHelpers.js +7 -5
- package/lib/utils/headerFooterHelpers.js.map +1 -1
- package/lib/versionInfo.d.ts +9 -9
- package/lib/versionInfo.js +13 -13
- package/lib/versionInfo.js.map +1 -1
- package/lib/widgets/error.d.ts +0 -12
- package/lib/widgets/error.d.ts.map +1 -1
- package/lib/widgets/error.js +5 -0
- package/lib/widgets/error.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompleteBar.js +15 -17
- package/lib/widgets/forms/autocomplete/autocompleteBar.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompleteField.js +8 -5
- package/lib/widgets/forms/autocomplete/autocompleteField.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompletePicker.js +19 -21
- package/lib/widgets/forms/autocomplete/autocompletePicker.js.map +1 -1
- package/lib/widgets/forms/autocomplete/language.js +15 -8
- package/lib/widgets/forms/autocomplete/language.js.map +1 -1
- package/lib/widgets/forms/autocomplete/publicData.js +27 -22
- package/lib/widgets/forms/autocomplete/publicData.js.map +1 -1
- package/lib/widgets/forms.js +270 -27
- package/lib/widgets/forms.js.map +1 -1
- package/package.json +46 -44
package/lib/tabs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.js","names":["ContainerElement","HTMLElement","TabWidgetElement","TabElement","tabWidget","options","subject","dom","document","orientation","parseInt","backgroundColor","flipped","vertical","onClose","getColors","selectedColor","color","bodyMainStyle","rootElement","createElement","setAttribute","navElement","appendChild","mainElement","tabContainer","tabElement","bodyContainer","corners","cornersPrepped","concat","slice","cornersStyle","join","margins","marginsPrepped","marginsStyle","paddingStyle","tabStyle","unselectedStyle","selectedStyle","shownStyle","hiddenStyle","refresh","orderedSync","startEmpty","children","length","selectedTab","selectedTab0","Array","from","map","tab","firstChild","find","dataset","name","selectedTabURI","uri","selectedTab1","clickMe","click","addCancelButton","onCloseSet","existingCancelButton","querySelector","removeChild","extraTab","classList","add","tabCancelButton","cancelButton","getAttribute","getItems","items","ordered","store","the","predicate","elements","each","makeNewSlot","item","ele","div","ellipsis","textContent","onclick","resetTabStyle","resetBodyStyle","bodyTR","bodyMain","getOrCreateContainerElement","renderMain","asSettings","innerHTML","renderTabSettings","renderTab","label","newBodyMain","slot","i","j","left","right","differ","sameTerm","insertables","newSlot","newBodyDiv","insertBefore","contains","isLight","colorBlend","a","b","mix","ca","cb","res","str","hex","res2","split","h","l","x","total"],"sources":["../src/tabs.ts"],"sourcesContent":["import { cancelButton } from './widgets'\nimport { label } from './utils'\nimport { NamedNode } from 'rdflib'\nimport { store } from 'solid-logic'\n\n/**\n * @ignore\n */\nclass ContainerElement extends HTMLElement {\n asSettings?: boolean\n}\n\ntype TabWidgetOptions = {\n backgroundColor?: string;\n dom?: HTMLDocument;\n items?: Array<NamedNode>;\n onClose?: (event: Event) => void;\n ordered?: boolean;\n orientation?: '0' | '1' | '2' | '3';\n predicate?: NamedNode;\n renderMain?: (bodyMain: HTMLElement, subject: NamedNode) => void;\n renderTab?: (tabDiv: HTMLButtonElement, subject: NamedNode) => void;\n renderTabSettings?: (bodyMain: ContainerElement, subject: NamedNode) => void;\n selectedTab?: NamedNode;\n startEmpty?: boolean;\n subject?: NamedNode;\n};\n\nexport class TabWidgetElement extends HTMLElement {\n bodyContainer?: HTMLElement\n refresh?: () => void\n tabContainer?: HTMLElement\n}\n\n/**\n * @ignore\n */\nclass TabElement extends HTMLElement {\n bodyTR?: HTMLElement\n subject?: NamedNode\n}\n\n/**\n * Use this widget to generate tabs from triples set in the global store.\n *\n * [Here you can see examples of the tabs](https://solidos.github.io/solid-ui/examples/tabs/).\n *\n * It assumes that items to use for tabs will be in a collection by default,\n * e.g.:\n *\n * ```turtle\n * :subject :predicate ( :item1 :item2 ) .\n * ```\n *\n * You can override this by setting `ordered: false`, in which case it expects\n * unordered triples:\n *\n * ```turtle\n * :subject :predicate :item1, :item 2 .\n * ```\n *\n * Triples that are not ordered in collection are in principle not sorted,\n * which means that tabs could change order every time you render the widget.\n * But in this case the widget will try to sort it in order to keep it\n * consistent.\n *\n * In both of these cases you need to define options `subject` and `predicate`\n * to tell the widget which triples it should be looking for.\n *\n * Finally you can set items manually, using the `items` option, e.g.:\n *\n * ```javascript\n * {\n * items: [\n * namedNode('https://domain.tld/#item1'),\n * namedNode('https://domain.tld/#item2')\n * ]\n * }\n * ```\n *\n * When you set items manually you do not need to set `subject` and\n * `predicate`.\n *\n * In any case you probably want to set the renderMain option to specify\n * what should be rendered for the various items, e.g.:\n *\n * ```javascript\n * {\n * renderMain: (bodyMain, subject) => {\n * bodyMain.innerHTML = renderItem(subject)\n * }\n * }\n * ```\n *\n * **Note:** `renderItem` is a custom function that you need to define yourself.\n *\n * The option `renderTabSettings` allows you to render a custom view in the\n * body container that is shown when you hold the ALT key and click on a\n * tab. It works very much like the `renderMain` option:\n *\n * ```javascript\n * {\n * renderTabSettings: (bodyMain, subject) => {\n * bodyMain.innerHTML = renderTabSettings(subject)\n * }\n * }\n * ```\n *\n * **Note:** `renderTabSettings` is a custom function that you need to define\n * yourself.\n *\n * By default the widget will try to guess the label by using the\n * [[utils.label]] function. If you want to customize this yourself, you can\n * use the `renderTab` option:\n *\n * ```javascript\n * {\n * renderTab: (tabDiv, subject) => {\n * tabDiv.innerText = renderTabText(subject)\n * }\n * }\n * ```\n *\n * **Note:** `renderTabText` is a custom function you need to define yourself.\n *\n * The option renderTab is also important if you want to set which tab should\n * be selected once the widget is rendered. By default it will simply select\n * the first tab, but you can override by setting `dataset.name` on the tab\n * and referring to the same string in `selectedTab`:\n *\n * ```javascript\n * {\n * renderTab: (tabDiv, subject) => {\n * tabDiv.dataset.name = subject.uri\n * },\n * selectedTab: item2.uri\n * }\n * ```\n *\n * You can apply a color to use for tabs and border of the container by using\n * option `background-color`. This is #ddddcc by default.\n *\n * You can override the document object that the widget uses to generate DOM\n * elements by setting the option `dom`. This is encouraged to set if you\n * intend your functionality to be used in environments that don't provide\n * a global `document` object.\n *\n * If you want to render a close button next to the tabs you can set option\n * `onClose` which takes a callback function that is triggered when the\n * button is clicked:\n *\n * ```javascript\n * {\n * onClose: (event) => {\n * // do something that hides the widget altogether\n * }\n * }\n * ```\n *\n * The option `orientation` allows you to set which side the tabs should be\n * located: `'0'` = Top, `'1'` = Left, `'2'` = Bottom, `'3'` = Right\n *\n * If you don't want to render anything in the body container by default,\n * you can set the option `startEmpty` to `true`.\n *\n * @param options\n */\nexport function tabWidget (options: TabWidgetOptions) {\n const subject = options.subject\n const dom = options.dom || document\n const orientation = parseInt(options.orientation || '0')\n const backgroundColor = options.backgroundColor || '#ddddcc'\n const flipped = orientation & 2\n const vertical = orientation & 1\n const onClose = options.onClose\n\n const [selectedColor, color] = getColors(backgroundColor)\n const bodyMainStyle = `flex: 2; width: auto; height: 100%; border: 0.1em; border-style: solid; border-color: ${selectedColor}; padding: 1em;`\n const rootElement: TabWidgetElement = dom.createElement('div') // 20200117a\n\n rootElement.setAttribute(\n 'style',\n 'display: flex; height: 100%; width: 100%; flex-direction: ' +\n (vertical ? 'row' : 'column') +\n (flipped ? '-reverse;' : ';')\n )\n\n const navElement = rootElement.appendChild(dom.createElement('nav'))\n navElement.setAttribute('style', 'margin: 0;')\n\n const mainElement = rootElement.appendChild(dom.createElement('main'))\n\n mainElement.setAttribute('style', 'margin: 0; width:100%; height: 100%;') // override tabbedtab.css\n const tabContainer = navElement.appendChild(dom.createElement('ul'))\n tabContainer.setAttribute(\n 'style',\n `\n list-style-type: none;\n display: flex;\n height: 100%;\n width: 100%;\n margin: 0;\n padding: 0;\n flex-direction: ${vertical ? 'column' : 'row'}\n `\n )\n\n const tabElement = 'li'\n\n const bodyContainer = mainElement\n rootElement.tabContainer = tabContainer\n rootElement.bodyContainer = bodyContainer\n\n const corners = ['0.2em', '0.2em', '0', '0'] // top left, TR, BR, BL\n const cornersPrepped = corners.concat(corners).slice(orientation, orientation + 4)\n const cornersStyle = `border-radius: ${cornersPrepped.join(' ')};`\n\n const margins = ['0.3em', '0.3em', '0', '0.3em'] // top, right, bottom, left\n const marginsPrepped = margins.concat(margins).slice(orientation, orientation + 4)\n const marginsStyle = `margin: ${marginsPrepped.join(' ')};`\n\n const paddingStyle = `padding: ${marginsPrepped.join(' ')};`\n\n const tabStyle = cornersStyle + `position: relative; padding: 0.7em; max-width: 20em; color: ${color};`\n const unselectedStyle = `${\n tabStyle + marginsStyle\n } opacity: 50%; background-color: ${backgroundColor};`\n const selectedStyle = `${tabStyle + marginsStyle} background-color: ${selectedColor};`\n const shownStyle = 'height: 100%; width: 100%;'\n const hiddenStyle = shownStyle + 'display: none;'\n rootElement.refresh = orderedSync\n orderedSync()\n\n if (!options.startEmpty && tabContainer.children.length && options.selectedTab) {\n const selectedTab0 = Array.from(tabContainer.children) // Version left for compatability with ??\n .map((tab) => tab.firstChild as HTMLElement)\n .find((tab) => tab.dataset.name === options.selectedTab)\n\n const selectedTabURI = options.selectedTab.uri\n const selectedTab1 = Array.from(tabContainer.children)\n // @ts-ignore\n .find(\n (tab) =>\n (tab as TabElement).subject &&\n // @ts-ignore\n (tab as TabElement).subject.uri &&\n // @ts-ignore\n (tab as TabElement).subject.uri === selectedTabURI\n )\n\n const tab = selectedTab1 || selectedTab0 || (tabContainer.children[0] as HTMLButtonElement)\n const clickMe = tab.firstChild\n // @ts-ignore\n if (clickMe) clickMe.click()\n } else if (!options.startEmpty) {\n (tabContainer.children[0].firstChild as HTMLButtonElement).click() // Open first tab\n }\n return rootElement\n\n function addCancelButton (tabContainer) {\n if (tabContainer.dataset.onCloseSet) {\n // @@ TODO: this is only here to make the browser tests work\n // Discussion at https://github.com/solidos/solid-ui/pull/110#issuecomment-527080663\n const existingCancelButton = tabContainer.querySelector('.unstyled')\n tabContainer.removeChild(existingCancelButton)\n }\n const extraTab = dom.createElement(tabElement)\n extraTab.classList.add('unstyled')\n const tabCancelButton = cancelButton(dom, onClose)\n tabCancelButton.setAttribute('style', tabCancelButton.getAttribute('style') + paddingStyle)\n extraTab.appendChild(tabCancelButton)\n tabContainer.appendChild(extraTab)\n tabContainer.dataset.onCloseSet = 'true'\n }\n\n function getItems (): Array<NamedNode> {\n if (options.items) return options.items\n if (options.ordered !== false) {\n // options.ordered defaults to true\n return (store.the(subject, options.predicate) as any).elements\n } else {\n return store.each(subject, options.predicate) as any\n }\n }\n\n function makeNewSlot (item: NamedNode) {\n const ele = dom.createElement(tabElement) as TabElement\n ele.setAttribute('style', unselectedStyle)\n ele.subject = item\n const div = ele.appendChild(dom.createElement('button'))\n div.setAttribute('style', 'background: none; border: none; font: inherit; cursor: pointer')\n const ellipsis = dom.createElement('button')\n ellipsis.textContent = '...'\n ellipsis.setAttribute('style', 'position: absolute; right: 0; bottom: 0; width: 20%; background: none; color: inherit; border: none; padding: 0; font: inherit; cursor: pointer; outline: inherit;')\n\n div.onclick = function () {\n resetTabStyle()\n resetBodyStyle()\n ele.setAttribute('style', selectedStyle)\n if (!ele.bodyTR) return\n ele.bodyTR.setAttribute('style', shownStyle)\n const bodyMain = getOrCreateContainerElement(ele)\n if (options.renderMain && ele.subject && bodyMain.asSettings !== false) {\n bodyMain.innerHTML = 'loading item ...' + item\n options.renderMain(bodyMain, ele.subject)\n bodyMain.asSettings = false\n }\n }\n ellipsis.onclick = function () {\n resetTabStyle()\n resetBodyStyle()\n ele.setAttribute('style', selectedStyle)\n if (!ele.bodyTR) return\n ele.bodyTR.setAttribute('style', shownStyle)\n const bodyMain = getOrCreateContainerElement(ele)\n if (options.renderTabSettings && ele.subject && bodyMain.asSettings !== true) {\n bodyMain.innerHTML = 'loading settings ...' + item\n options.renderTabSettings(bodyMain, ele.subject)\n bodyMain.asSettings = true\n }\n }\n\n if (options.renderTab) {\n options.renderTab(div, item)\n ele.appendChild(ellipsis)\n } else {\n div.innerHTML = label(item)\n ele.appendChild(ellipsis)\n }\n return ele\n\n function getOrCreateContainerElement (ele: TabElement): ContainerElement {\n const bodyMain = ele.bodyTR?.children[0] as ContainerElement\n if (bodyMain) return bodyMain\n const newBodyMain = ele.bodyTR!.appendChild(dom.createElement('main'))\n newBodyMain.setAttribute('style', bodyMainStyle)\n return newBodyMain\n }\n }\n\n // @@ Use common one from utils?\n function orderedSync () {\n const items = getItems()\n let slot: TabElement, i, j, left, right\n let differ = false\n // Find how many match at each end\n for (left = 0; left < tabContainer.children.length; left++) {\n slot = tabContainer.children[left] as TabElement\n if (left >= items.length || (slot.subject && !slot.subject.sameTerm(items[left]))) {\n differ = true\n break\n }\n }\n if (!differ && items.length === tabContainer.children.length) {\n return // The two just match in order: a case to optimize for\n }\n for (right = tabContainer.children.length - 1; right >= 0; right--) {\n slot = tabContainer.children[right] as TabElement\n j = right - tabContainer.children.length + items.length\n if (slot.subject && !slot.subject.sameTerm(items[j])) {\n break\n }\n }\n // The elements left ... right in tabContainer.children do not match\n const insertables = items.slice(left, right - tabContainer.children.length + items.length + 1)\n while (right >= left) {\n // remove extra\n tabContainer.removeChild(tabContainer.children[left])\n bodyContainer.removeChild(bodyContainer.children[left])\n right -= 1\n }\n for (i = 0; i < insertables.length; i++) {\n const newSlot = makeNewSlot(insertables[i])\n const newBodyDiv = dom.createElement('div')\n newSlot.bodyTR = newBodyDiv\n if (left === tabContainer.children.length) {\n // None left of original on right\n tabContainer.appendChild(newSlot)\n bodyContainer.appendChild(newBodyDiv)\n } else {\n tabContainer.insertBefore(newSlot, tabContainer.children[left + i])\n bodyContainer.insertBefore(newBodyDiv, bodyContainer.children[left + i])\n }\n }\n if (onClose) {\n addCancelButton(tabContainer)\n }\n }\n\n function resetTabStyle () {\n for (let i = 0; i < tabContainer.children.length; i++) {\n const tab = tabContainer.children[i]\n if (tab.classList.contains('unstyled')) {\n continue\n } else {\n tab.setAttribute('style', unselectedStyle)\n }\n }\n }\n\n function resetBodyStyle () {\n for (let i = 0; i < bodyContainer.children.length; i++) {\n bodyContainer.children[i].setAttribute('style', hiddenStyle)\n }\n }\n}\n\n/**\n * @internal\n */\nfunction getColors (backgroundColor: string): [string, string] {\n return isLight(backgroundColor)\n ? [colorBlend(backgroundColor, '#ffffff', 0.3), '#000000']\n : [colorBlend(backgroundColor, '#000000', 0.3), '#ffffff']\n}\n\n/**\n * @internal\n */\nfunction colorBlend (a: string, b: string, mix: number): string {\n let ca, cb, res\n let str = '#'\n const hex = '0123456789abcdef'\n for (let i = 0; i < 3; i++) {\n ca = parseInt(a.slice(i * 2 + 1, i * 2 + 3), 16)\n cb = parseInt(b.slice(i * 2 + 1, i * 2 + 3), 16)\n res = ca * (1.0 - mix) + cb * mix // @@@ rounding\n const res2 = parseInt(('' + res).split('.')[0]) // @@ ugh\n const h = parseInt(('' + res2 / 16).split('.')[0]) // @@ ugh\n const l = parseInt(('' + (res2 % 16)).split('.')[0]) // @@ ugh\n str += hex[h] + hex[l]\n }\n return str\n}\n\n/**\n * @internal\n */\nfunction isLight (x: string): boolean {\n let total = 0\n for (let i = 0; i < 3; i++) {\n total += parseInt(x.slice(i * 2 + 1, i * 2 + 3), 16)\n }\n return total > 128 * 3\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;;;;;AAEA;AACA;AACA;IACMA,gB;;;;;;;;;;;;;;;;;;;;kDAAyBC,W;;IAoBlBC,gB;;;;;;;;;;;;;;;;;;;;;;kDAAyBD,W;AAMtC;AACA;AACA;;;;;IACME,U;;;;;;;;;;;;;;;;;;;;;kDAAmBF,W;AAKzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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AhC,CAAb;IACAkB,GAAG,GAAGF,EAAE,IAAI,MAAMD,GAAV,CAAF,GAAmBE,EAAE,GAAGF,GAA9B,CAH0B,CAGQ;;IAClC,IAAMM,IAAI,GAAGjH,QAAQ,CAAC,CAAC,KAAK8G,GAAN,EAAWI,KAAX,CAAiB,GAAjB,EAAsB,CAAtB,CAAD,CAArB,CAJ0B,CAIsB;;IAChD,IAAMC,CAAC,GAAGnH,QAAQ,CAAC,CAAC,KAAKiH,IAAI,GAAG,EAAb,EAAiBC,KAAjB,CAAuB,GAAvB,EAA4B,CAA5B,CAAD,CAAlB,CAL0B,CAKyB;;IACnD,IAAME,CAAC,GAAGpH,QAAQ,CAAC,CAAC,KAAMiH,IAAI,GAAG,EAAd,EAAmBC,KAAnB,CAAyB,GAAzB,EAA8B,CAA9B,CAAD,CAAlB,CAN0B,CAM2B;;IACrDH,GAAG,IAAIC,GAAG,CAACG,CAAD,CAAH,GAASH,GAAG,CAACI,CAAD,CAAnB;EACD;;EACD,OAAOL,GAAP;AACD;AAED;AACA;AACA;;;AACA,SAASR,OAAT,CAAkBc,CAAlB,EAAsC;EACpC,IAAIC,KAAK,GAAG,CAAZ;;EACA,KAAK,IAAI1B,CAAC,GAAG,CAAb,EAAgBA,CAAC,GAAG,CAApB,EAAuBA,CAAC,EAAxB,EAA4B;IAC1B0B,KAAK,IAAItH,QAAQ,CAACqH,CAAC,CAAChG,KAAF,CAAQuE,CAAC,GAAG,CAAJ,GAAQ,CAAhB,EAAmBA,CAAC,GAAG,CAAJ,GAAQ,CAA3B,CAAD,EAAgC,EAAhC,CAAjB;EACD;;EACD,OAAO0B,KAAK,GAAG,MAAM,CAArB;AACD"}
|
|
1
|
+
{"version":3,"file":"tabs.js","names":["ContainerElement","HTMLElement","TabWidgetElement","TabElement","tabWidget","options","subject","dom","document","orientation","parseInt","backgroundColor","flipped","vertical","onClose","getColors","selectedColor","color","bodyMainStyle","rootElement","createElement","setAttribute","navElement","appendChild","mainElement","tabContainer","tabElement","bodyContainer","corners","cornersPrepped","concat","slice","cornersStyle","join","margins","marginsPrepped","marginsStyle","paddingStyle","tabStyle","unselectedStyle","selectedStyle","shownStyle","hiddenStyle","refresh","orderedSync","startEmpty","children","length","selectedTab","selectedTab0","Array","from","map","tab","firstChild","find","dataset","name","selectedTabURI","uri","selectedTab1","clickMe","click","addCancelButton","onCloseSet","existingCancelButton","querySelector","removeChild","extraTab","classList","add","tabCancelButton","cancelButton","getAttribute","getItems","items","ordered","store","the","predicate","elements","each","makeNewSlot","item","ele","div","onclick","resetTabStyle","resetBodyStyle","bodyTR","bodyMain","getOrCreateContainerElement","renderMain","asSettings","innerHTML","renderTabSettings","ellipsis","textContent","renderTab","label","newBodyMain","slot","i","j","left","right","differ","sameTerm","insertables","newSlot","newBodyDiv","insertBefore","contains","isLight","colorBlend","a","b","mix","ca","cb","res","str","hex","res2","split","h","l","x","total"],"sources":["../src/tabs.ts"],"sourcesContent":["import { cancelButton } from './widgets'\nimport { label } from './utils'\nimport { NamedNode } from 'rdflib'\nimport { store } from 'solid-logic'\n\n/**\n * @ignore\n */\nclass ContainerElement extends HTMLElement {\n asSettings?: boolean\n}\n\ntype TabWidgetOptions = {\n backgroundColor?: string;\n dom?: HTMLDocument;\n items?: Array<NamedNode>;\n onClose?: (event: Event) => void;\n ordered?: boolean;\n orientation?: '0' | '1' | '2' | '3';\n predicate?: NamedNode;\n renderMain?: (bodyMain: HTMLElement, subject: NamedNode) => void;\n renderTab?: (tabDiv: HTMLButtonElement, subject: NamedNode) => void;\n renderTabSettings?: (bodyMain: ContainerElement, subject: NamedNode) => void;\n selectedTab?: NamedNode;\n startEmpty?: boolean;\n subject?: NamedNode;\n};\n\nexport class TabWidgetElement extends HTMLElement {\n bodyContainer?: HTMLElement\n refresh?: () => void\n tabContainer?: HTMLElement\n}\n\n/**\n * @ignore\n */\nclass TabElement extends HTMLElement {\n bodyTR?: HTMLElement\n subject?: NamedNode\n}\n\n/**\n * Use this widget to generate tabs from triples set in the global store.\n *\n * [Here you can see examples of the tabs](https://solidos.github.io/solid-ui/examples/tabs/).\n *\n * It assumes that items to use for tabs will be in a collection by default,\n * e.g.:\n *\n * ```turtle\n * :subject :predicate ( :item1 :item2 ) .\n * ```\n *\n * You can override this by setting `ordered: false`, in which case it expects\n * unordered triples:\n *\n * ```turtle\n * :subject :predicate :item1, :item 2 .\n * ```\n *\n * Triples that are not ordered in collection are in principle not sorted,\n * which means that tabs could change order every time you render the widget.\n * But in this case the widget will try to sort it in order to keep it\n * consistent.\n *\n * In both of these cases you need to define options `subject` and `predicate`\n * to tell the widget which triples it should be looking for.\n *\n * Finally you can set items manually, using the `items` option, e.g.:\n *\n * ```javascript\n * {\n * items: [\n * namedNode('https://domain.tld/#item1'),\n * namedNode('https://domain.tld/#item2')\n * ]\n * }\n * ```\n *\n * When you set items manually you do not need to set `subject` and\n * `predicate`.\n *\n * In any case you probably want to set the renderMain option to specify\n * what should be rendered for the various items, e.g.:\n *\n * ```javascript\n * {\n * renderMain: (bodyMain, subject) => {\n * bodyMain.innerHTML = renderItem(subject)\n * }\n * }\n * ```\n *\n * **Note:** `renderItem` is a custom function that you need to define yourself.\n *\n * The option `renderTabSettings` allows you to render a custom view in the\n * body container that is shown when you hold the ALT key and click on a\n * tab. It works very much like the `renderMain` option:\n *\n * ```javascript\n * {\n * renderTabSettings: (bodyMain, subject) => {\n * bodyMain.innerHTML = renderTabSettings(subject)\n * }\n * }\n * ```\n *\n * **Note:** `renderTabSettings` is a custom function that you need to define\n * yourself.\n *\n * By default the widget will try to guess the label by using the\n * [[utils.label]] function. If you want to customize this yourself, you can\n * use the `renderTab` option:\n *\n * ```javascript\n * {\n * renderTab: (tabDiv, subject) => {\n * tabDiv.innerText = renderTabText(subject)\n * }\n * }\n * ```\n *\n * **Note:** `renderTabText` is a custom function you need to define yourself.\n *\n * The option renderTab is also important if you want to set which tab should\n * be selected once the widget is rendered. By default it will simply select\n * the first tab, but you can override by setting `dataset.name` on the tab\n * and referring to the same string in `selectedTab`:\n *\n * ```javascript\n * {\n * renderTab: (tabDiv, subject) => {\n * tabDiv.dataset.name = subject.uri\n * },\n * selectedTab: item2.uri\n * }\n * ```\n *\n * You can apply a color to use for tabs and border of the container by using\n * option `background-color`. This is #ddddcc by default.\n *\n * You can override the document object that the widget uses to generate DOM\n * elements by setting the option `dom`. This is encouraged to set if you\n * intend your functionality to be used in environments that don't provide\n * a global `document` object.\n *\n * If you want to render a close button next to the tabs you can set option\n * `onClose` which takes a callback function that is triggered when the\n * button is clicked:\n *\n * ```javascript\n * {\n * onClose: (event) => {\n * // do something that hides the widget altogether\n * }\n * }\n * ```\n *\n * The option `orientation` allows you to set which side the tabs should be\n * located: `'0'` = Top, `'1'` = Left, `'2'` = Bottom, `'3'` = Right\n *\n * If you don't want to render anything in the body container by default,\n * you can set the option `startEmpty` to `true`.\n *\n * @param options\n */\nexport function tabWidget (options: TabWidgetOptions) {\n const subject = options.subject\n const dom = options.dom || document\n const orientation = parseInt(options.orientation || '0')\n const backgroundColor = options.backgroundColor || '#ddddcc'\n const flipped = orientation & 2\n const vertical = orientation & 1\n const onClose = options.onClose\n\n const [selectedColor, color] = getColors(backgroundColor)\n const bodyMainStyle = `flex: 2; width: auto; height: 100%; border: 0.1em; border-style: solid; border-color: ${selectedColor}; padding: 1em;`\n const rootElement: TabWidgetElement = dom.createElement('div') // 20200117a\n\n rootElement.setAttribute(\n 'style',\n 'display: flex; height: 100%; width: 100%; flex-direction: ' +\n (vertical ? 'row' : 'column') +\n (flipped ? '-reverse;' : ';')\n )\n\n const navElement = rootElement.appendChild(dom.createElement('nav'))\n navElement.setAttribute('style', 'margin: 0;')\n\n const mainElement = rootElement.appendChild(dom.createElement('main'))\n\n mainElement.setAttribute('style', 'margin: 0; width:100%; height: 100%;') // override tabbedtab.css\n const tabContainer = navElement.appendChild(dom.createElement('ul'))\n tabContainer.setAttribute(\n 'style',\n `\n list-style-type: none;\n display: flex;\n height: 100%;\n width: 100%;\n margin: 0;\n padding: 0;\n flex-direction: ${vertical ? 'column' : 'row'}\n `\n )\n\n const tabElement = 'li'\n\n const bodyContainer = mainElement\n rootElement.tabContainer = tabContainer\n rootElement.bodyContainer = bodyContainer\n\n const corners = ['0.2em', '0.2em', '0', '0'] // top left, TR, BR, BL\n const cornersPrepped = corners.concat(corners).slice(orientation, orientation + 4)\n const cornersStyle = `border-radius: ${cornersPrepped.join(' ')};`\n\n const margins = ['0.3em', '0.3em', '0', '0.3em'] // top, right, bottom, left\n const marginsPrepped = margins.concat(margins).slice(orientation, orientation + 4)\n const marginsStyle = `margin: ${marginsPrepped.join(' ')};`\n\n const paddingStyle = `padding: ${marginsPrepped.join(' ')};`\n\n const tabStyle = cornersStyle + `position: relative; padding: 0.7em; max-width: 20em; color: ${color};`\n const unselectedStyle = `${\n tabStyle + marginsStyle\n } opacity: 50%; background-color: ${backgroundColor};`\n const selectedStyle = `${tabStyle + marginsStyle} background-color: ${selectedColor};`\n const shownStyle = 'height: 100%; width: 100%;'\n const hiddenStyle = shownStyle + 'display: none;'\n rootElement.refresh = orderedSync\n orderedSync()\n\n if (!options.startEmpty && tabContainer.children.length && options.selectedTab) {\n const selectedTab0 = Array.from(tabContainer.children) // Version left for compatability with ??\n .map((tab) => tab.firstChild as HTMLElement)\n .find((tab) => tab.dataset.name === options.selectedTab)\n\n const selectedTabURI = options.selectedTab.uri\n const selectedTab1 = Array.from(tabContainer.children)\n // @ts-ignore\n .find(\n (tab) =>\n (tab as TabElement).subject &&\n // @ts-ignore\n (tab as TabElement).subject.uri &&\n // @ts-ignore\n (tab as TabElement).subject.uri === selectedTabURI\n )\n\n const tab = selectedTab1 || selectedTab0 || (tabContainer.children[0] as HTMLButtonElement)\n const clickMe = tab.firstChild\n // @ts-ignore\n if (clickMe) clickMe.click()\n } else if (!options.startEmpty) {\n (tabContainer.children[0].firstChild as HTMLButtonElement).click() // Open first tab\n }\n return rootElement\n\n function addCancelButton (tabContainer) {\n if (tabContainer.dataset.onCloseSet) {\n // @@ TODO: this is only here to make the browser tests work\n // Discussion at https://github.com/solidos/solid-ui/pull/110#issuecomment-527080663\n const existingCancelButton = tabContainer.querySelector('.unstyled')\n tabContainer.removeChild(existingCancelButton)\n }\n const extraTab = dom.createElement(tabElement)\n extraTab.classList.add('unstyled')\n const tabCancelButton = cancelButton(dom, onClose)\n tabCancelButton.setAttribute('style', tabCancelButton.getAttribute('style') + paddingStyle)\n extraTab.appendChild(tabCancelButton)\n tabContainer.appendChild(extraTab)\n tabContainer.dataset.onCloseSet = 'true'\n }\n\n function getItems (): Array<NamedNode> {\n if (options.items) return options.items\n if (options.ordered !== false) {\n // options.ordered defaults to true\n return (store.the(subject, options.predicate) as any).elements\n } else {\n return store.each(subject, options.predicate) as any\n }\n }\n\n function makeNewSlot (item: NamedNode) {\n const ele = dom.createElement(tabElement) as TabElement\n ele.setAttribute('style', unselectedStyle)\n ele.subject = item\n const div = ele.appendChild(dom.createElement('button'))\n div.setAttribute('style', 'background: none; border: none; font: inherit; cursor: pointer')\n\n div.onclick = function () {\n resetTabStyle()\n resetBodyStyle()\n ele.setAttribute('style', selectedStyle)\n if (!ele.bodyTR) return\n ele.bodyTR.setAttribute('style', shownStyle)\n const bodyMain = getOrCreateContainerElement(ele)\n if (options.renderMain && ele.subject && bodyMain.asSettings !== false) {\n bodyMain.innerHTML = 'loading item ...' + item\n options.renderMain(bodyMain, ele.subject)\n bodyMain.asSettings = false\n }\n }\n\n if (options.renderTabSettings && ele.subject) {\n const ellipsis = dom.createElement('button')\n ellipsis.textContent = '...'\n ellipsis.setAttribute('style', 'position: absolute; right: 0; bottom: 0; width: 20%; background: none; color: inherit; border: none; padding: 0; font: inherit; cursor: pointer; outline: inherit;')\n\n ellipsis.onclick = function () {\n resetTabStyle()\n resetBodyStyle()\n ele.setAttribute('style', selectedStyle)\n if (!ele.bodyTR) return\n ele.bodyTR.setAttribute('style', shownStyle)\n const bodyMain = getOrCreateContainerElement(ele)\n if (options.renderTabSettings && ele.subject && bodyMain.asSettings !== true) {\n bodyMain.innerHTML = 'loading settings ...' + item\n options.renderTabSettings(bodyMain, ele.subject)\n bodyMain.asSettings = true\n }\n }\n ele.appendChild(ellipsis)\n }\n\n if (options.renderTab) {\n options.renderTab(div, item)\n } else {\n div.innerHTML = label(item)\n }\n return ele\n\n function getOrCreateContainerElement (ele: TabElement): ContainerElement {\n const bodyMain = ele.bodyTR?.children[0] as ContainerElement\n if (bodyMain) return bodyMain\n const newBodyMain = ele.bodyTR!.appendChild(dom.createElement('main'))\n newBodyMain.setAttribute('style', bodyMainStyle)\n return newBodyMain\n }\n }\n\n // @@ Use common one from utils?\n function orderedSync () {\n const items = getItems()\n let slot: TabElement, i, j, left, right\n let differ = false\n // Find how many match at each end\n for (left = 0; left < tabContainer.children.length; left++) {\n slot = tabContainer.children[left] as TabElement\n if (left >= items.length || (slot.subject && !slot.subject.sameTerm(items[left]))) {\n differ = true\n break\n }\n }\n if (!differ && items.length === tabContainer.children.length) {\n return // The two just match in order: a case to optimize for\n }\n for (right = tabContainer.children.length - 1; right >= 0; right--) {\n slot = tabContainer.children[right] as TabElement\n j = right - tabContainer.children.length + items.length\n if (slot.subject && !slot.subject.sameTerm(items[j])) {\n break\n }\n }\n // The elements left ... right in tabContainer.children do not match\n const insertables = items.slice(left, right - tabContainer.children.length + items.length + 1)\n while (right >= left) {\n // remove extra\n tabContainer.removeChild(tabContainer.children[left])\n bodyContainer.removeChild(bodyContainer.children[left])\n right -= 1\n }\n for (i = 0; i < insertables.length; i++) {\n const newSlot = makeNewSlot(insertables[i])\n const newBodyDiv = dom.createElement('div')\n newSlot.bodyTR = newBodyDiv\n if (left === tabContainer.children.length) {\n // None left of original on right\n tabContainer.appendChild(newSlot)\n bodyContainer.appendChild(newBodyDiv)\n } else {\n tabContainer.insertBefore(newSlot, tabContainer.children[left + i])\n bodyContainer.insertBefore(newBodyDiv, bodyContainer.children[left + i])\n }\n }\n if (onClose) {\n addCancelButton(tabContainer)\n }\n }\n\n function resetTabStyle () {\n for (let i = 0; i < tabContainer.children.length; i++) {\n const tab = tabContainer.children[i]\n if (tab.classList.contains('unstyled')) {\n continue\n } else {\n tab.setAttribute('style', unselectedStyle)\n }\n }\n }\n\n function resetBodyStyle () {\n for (let i = 0; i < bodyContainer.children.length; i++) {\n bodyContainer.children[i].setAttribute('style', hiddenStyle)\n }\n }\n}\n\n/**\n * @internal\n */\nfunction getColors (backgroundColor: string): [string, string] {\n return isLight(backgroundColor)\n ? [colorBlend(backgroundColor, '#ffffff', 0.3), '#000000']\n : [colorBlend(backgroundColor, '#000000', 0.3), '#ffffff']\n}\n\n/**\n * @internal\n */\nfunction colorBlend (a: string, b: string, mix: number): string {\n let ca, cb, res\n let str = '#'\n const hex = '0123456789abcdef'\n for (let i = 0; i < 3; i++) {\n ca = parseInt(a.slice(i * 2 + 1, i * 2 + 3), 16)\n cb = parseInt(b.slice(i * 2 + 1, i * 2 + 3), 16)\n res = ca * (1.0 - mix) + cb * mix // @@@ rounding\n const res2 = parseInt(('' + res).split('.')[0]) // @@ ugh\n const h = parseInt(('' + res2 / 16).split('.')[0]) // @@ ugh\n const l = parseInt(('' + (res2 % 16)).split('.')[0]) // @@ ugh\n str += hex[h] + hex[l]\n }\n return str\n}\n\n/**\n * @internal\n */\nfunction isLight (x: string): boolean {\n let total = 0\n for (let i = 0; i < 3; i++) {\n total += parseInt(x.slice(i * 2 + 1, i * 2 + 3), 16)\n }\n return total > 128 * 3\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AAEA;;;;;;AAEA;AACA;AACA;IACMA,gB;;;;;;;;;;;;;;;;;;;;kDAAyBC,W;;IAoBlBC,gB;;;;;;;;;;;;;;;;;;;;;;kDAAyBD,W;AAMtC;AACA;AACA;;;;;IACME,U;;;;;;;;;;;;;;;;;;;;;kDAAmBF,W;AAKzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASG,SAAT,CAAoBC,OAApB,EAA+C;EACpD,IAAMC,OAAO,GAAGD,OAAO,CAACC,OAAxB;EACA,IAAMC,GAAG,GAAGF,OAAO,CAACE,GAAR,IAAeC,QAA3B;EACA,IAAMC,WAAW,GAAGC,QAAQ,CAACL,OAAO,CAACI,WAAR,IAAuB,GAAxB,CAA5B;EACA,IAAME,eAAe,GAAGN,OAAO,CAACM,eAAR,IAA2B,SAAnD;EACA,IAAMC,OAAO,GAAGH,WAAW,GAAG,CAA9B;EACA,IAAMI,QAAQ,GAAGJ,WAAW,GAAG,CAA/B;EACA,IAAMK,OAAO,GAAGT,OAAO,CAACS,OAAxB;;EAEA,iBAA+BC,SAAS,CAACJ,eAAD,CAAxC;EAAA;EAAA,IAAOK,aAAP;EAAA,IAAsBC,KAAtB;;EACA,IAAMC,aAAa,mGAA4FF,aAA5F,oBAAnB;EACA,IAAMG,WAA6B,GAAGZ,GAAG,CAACa,aAAJ,CAAkB,KAAlB,CAAtC,CAXoD,CAWW;;EAE/DD,WAAW,CAACE,YAAZ,CACE,OADF,EAEE,gEACGR,QAAQ,GAAG,KAAH,GAAW,QADtB,KAEGD,OAAO,GAAG,W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CAAC,EAAxB,EAA4B;IAC1B0B,KAAK,IAAItH,QAAQ,CAACqH,CAAC,CAAChG,KAAF,CAAQuE,CAAC,GAAG,CAAJ,GAAQ,CAAhB,EAAmBA,CAAC,GAAG,CAAJ,GAAQ,CAA3B,CAAD,EAAgC,EAAhC,CAAjB;EACD;;EACD,OAAO0B,KAAK,GAAG,MAAM,CAArB;AACD"}
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
@@ -13,6 +11,8 @@ exports.getPod = getPod;
|
|
|
13
11
|
exports.getPodOwner = getPodOwner;
|
|
14
12
|
exports.throttle = throttle;
|
|
15
13
|
|
|
14
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
15
|
+
|
|
16
16
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
17
17
|
|
|
18
18
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
@@ -27,7 +27,9 @@ var _styleMap2 = require("../footer/styleMap");
|
|
|
27
27
|
|
|
28
28
|
var _jss = require("../jss");
|
|
29
29
|
|
|
30
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
30
|
+
/*
|
|
31
|
+
Copied from mashlib/src/global/metadata.ts
|
|
32
|
+
*/
|
|
31
33
|
|
|
32
34
|
/**
|
|
33
35
|
* @internal
|
|
@@ -76,9 +78,9 @@ function getPodOwner(_x, _x2) {
|
|
|
76
78
|
|
|
77
79
|
|
|
78
80
|
function _getPodOwner() {
|
|
79
|
-
_getPodOwner = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
81
|
+
_getPodOwner = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(pod, store) {
|
|
80
82
|
var response, containerTurtle, podOwner, guess;
|
|
81
|
-
return
|
|
83
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
82
84
|
while (1) {
|
|
83
85
|
switch (_context.prev = _context.next) {
|
|
84
86
|
case 0:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"headerFooterHelpers.js","names":["getStyle","styleClass","type","footerStyleMap","headerStyleMap","addStyleClassToElement","element","styleClasses","forEach","style","getClasses","document","head","classes","classList","add","getPod","sym","location","origin","site","getPodOwner","pod","store","any","ns","ldp","fetcher","webOperation","uri","initFetchOptions","headers","accept","response","containerTurtle","responseText","parse","console","error","holds","rdf","space","warn","podOwner","solid","load","doc","guess","getName","user","anyValue","vcard","foaf","throttle","func","wait","options","context","args","result","timeout","previous","later","leading","Date","now","apply","remaining","arguments","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;;AACA;;AACA;;AACA;;AACA
|
|
1
|
+
{"version":3,"file":"headerFooterHelpers.js","names":["getStyle","styleClass","type","footerStyleMap","headerStyleMap","addStyleClassToElement","element","styleClasses","forEach","style","getClasses","document","head","classes","classList","add","getPod","sym","location","origin","site","getPodOwner","pod","store","any","ns","ldp","fetcher","webOperation","uri","initFetchOptions","headers","accept","response","containerTurtle","responseText","parse","console","error","holds","rdf","space","warn","podOwner","solid","load","doc","guess","getName","user","anyValue","vcard","foaf","throttle","func","wait","options","context","args","result","timeout","previous","later","leading","Date","now","apply","remaining","arguments","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;;AACA;;AACA;;AACA;;AACA;;AAPA;AACA;AACA;;AAaA;AACA;AACA;AACA,SAASA,QAAT,CAAmBC,UAAnB,EAA+BC,IAA/B,EAAsC;EACpC,IAAIA,IAAI,IAAIA,IAAI,KAAK,QAArB,EAA+B;IAC7B,OAAOC,mBAAA,CAAeF,UAAf,CAAP;EACD,CAFD,MAEO;IACL,OAAOG,kBAAA,CAAeH,UAAf,CAAP;EACD;AACF;AAED;AACA;AACA;;;AACO,SAASI,sBAAT,CAAiCC,OAAjC,EAA+CC,YAA/C,EAAuEL,IAAvE,EAAsF;EAC3FK,YAAY,CAACC,OAAb,CAAqB,UAACP,UAAD,EAAgB;IACnC,IAAMQ,KAAK,GAAGT,QAAQ,CAACC,UAAD,EAAaC,IAAb,CAAtB;;IACA,kBAAoB,IAAAQ,eAAA,EAAWC,QAAQ,CAACC,IAApB,uCAA6BX,UAA7B,EAA0CQ,KAA1C,EAApB;IAAA,IAAQI,OAAR,eAAQA,OAAR;;IACAP,OAAO,CAACQ,SAAR,CAAkBC,GAAlB,CAAsBF,OAAO,CAACZ,UAAD,CAA7B;EACD,CAJD;AA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IU,GAAG,GAAGJ,QAAV,CAAtB,CAHiB,CAIjB;;IACAJ,OAAO,GAAG,IAAV;IACAC,IAAI,GAAGU,SAAP;;IACA,IAAID,SAAS,IAAI,CAAb,IAAkBA,SAAS,GAAGZ,IAAlC,EAAwC;MACtC,IAAIK,OAAJ,EAAa;QACXS,YAAY,CAACT,OAAD,CAAZ;QACAA,OAAO,GAAG,IAAV;MACD;;MACDC,QAAQ,GAAGI,GAAX;MACAN,MAAM,GAAGL,IAAI,CAACY,KAAL,CAAWT,OAAX,EAAoBC,IAApB,CAAT;MACA,IAAI,CAACE,OAAL,EAAcH,OAAO,GAAGC,IAAI,GAAG,IAAjB;IACf,CARD,MAQO,IAAI,CAACE,OAAD,IAAYJ,OAAO,CAACc,QAAR,KAAqB,KAArC,EAA4C;MACjDV,OAAO,GAAGW,UAAU,CAACT,KAAD,EAAQK,SAAR,CAApB;IACD;;IACD,OAAOR,MAAP;EACD,CAnBD;AAoBD"}
|
package/lib/versionInfo.d.ts
CHANGED
|
@@ -4,21 +4,21 @@ export declare const versionInfo: {
|
|
|
4
4
|
npmInfo: {
|
|
5
5
|
'solid-ui': string;
|
|
6
6
|
npm: string;
|
|
7
|
-
|
|
7
|
+
node: string;
|
|
8
|
+
v8: string;
|
|
9
|
+
uv: string;
|
|
10
|
+
zlib: string;
|
|
8
11
|
brotli: string;
|
|
9
|
-
|
|
10
|
-
icu: string;
|
|
11
|
-
llhttp: string;
|
|
12
|
+
ares: string;
|
|
12
13
|
modules: string;
|
|
13
|
-
napi: string;
|
|
14
14
|
nghttp2: string;
|
|
15
|
-
|
|
15
|
+
napi: string;
|
|
16
|
+
llhttp: string;
|
|
16
17
|
openssl: string;
|
|
18
|
+
cldr: string;
|
|
19
|
+
icu: string;
|
|
17
20
|
tz: string;
|
|
18
21
|
unicode: string;
|
|
19
|
-
uv: string;
|
|
20
|
-
v8: string;
|
|
21
|
-
zlib: string;
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
24
|
//# sourceMappingURL=versionInfo.d.ts.map
|
package/lib/versionInfo.js
CHANGED
|
@@ -5,26 +5,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.versionInfo = void 0;
|
|
7
7
|
var versionInfo = {
|
|
8
|
-
buildTime: '2022-08-
|
|
9
|
-
commit: '
|
|
8
|
+
buildTime: '2022-08-23T16:14:00Z',
|
|
9
|
+
commit: 'd6a4e62ea0078f3fc6f46ef81e5f9df451281655',
|
|
10
10
|
npmInfo: {
|
|
11
11
|
'solid-ui': '2.4.22',
|
|
12
|
-
npm: '
|
|
13
|
-
|
|
12
|
+
npm: '8.18.0',
|
|
13
|
+
node: '14.20.0',
|
|
14
|
+
v8: '8.4.371.23-node.87',
|
|
15
|
+
uv: '1.42.0',
|
|
16
|
+
zlib: '1.2.11',
|
|
14
17
|
brotli: '1.0.9',
|
|
15
|
-
|
|
16
|
-
icu: '70.1',
|
|
17
|
-
llhttp: '2.1.5',
|
|
18
|
+
ares: '1.18.1',
|
|
18
19
|
modules: '83',
|
|
19
|
-
napi: '8',
|
|
20
20
|
nghttp2: '1.42.0',
|
|
21
|
-
|
|
21
|
+
napi: '8',
|
|
22
|
+
llhttp: '2.1.5',
|
|
22
23
|
openssl: '1.1.1q',
|
|
24
|
+
cldr: '40.0',
|
|
25
|
+
icu: '70.1',
|
|
23
26
|
tz: '2021a3',
|
|
24
|
-
unicode: '14.0'
|
|
25
|
-
uv: '1.42.0',
|
|
26
|
-
v8: '8.4.371.23-node.87',
|
|
27
|
-
zlib: '1.2.11'
|
|
27
|
+
unicode: '14.0'
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
30
|
exports.versionInfo = versionInfo;
|
package/lib/versionInfo.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versionInfo.js","names":["versionInfo","buildTime","commit","npmInfo","npm","
|
|
1
|
+
{"version":3,"file":"versionInfo.js","names":["versionInfo","buildTime","commit","npmInfo","npm","node","v8","uv","zlib","brotli","ares","modules","nghttp2","napi","llhttp","openssl","cldr","icu","tz","unicode"],"sources":["../src/versionInfo.ts"],"sourcesContent":["export const versionInfo = {\n buildTime: '2022-08-23T16:14:00Z',\n commit: 'd6a4e62ea0078f3fc6f46ef81e5f9df451281655',\n npmInfo:\n{\n 'solid-ui': '2.4.22',\n npm: '8.18.0',\n node: '14.20.0',\n v8: '8.4.371.23-node.87',\n uv: '1.42.0',\n zlib: '1.2.11',\n brotli: '1.0.9',\n ares: '1.18.1',\n modules: '83',\n nghttp2: '1.42.0',\n napi: '8',\n llhttp: '2.1.5',\n openssl: '1.1.1q',\n cldr: '40.0',\n icu: '70.1',\n tz: '2021a3',\n unicode: '14.0'\n}\n}\n"],"mappings":";;;;;;AAAO,IAAMA,WAAW,GAAG;EACzBC,SAAS,EAAE,sBADc;EAEzBC,MAAM,EAAE,0CAFiB;EAGzBC,OAAO,EACT;IACE,YAAY,QADd;IAEEC,GAAG,EAAE,QAFP;IAGEC,IAAI,EAAE,SAHR;IAIEC,EAAE,EAAE,oBAJN;IAKEC,EAAE,EAAE,QALN;IAMEC,IAAI,EAAE,QANR;IAOEC,MAAM,EAAE,OAPV;IAQEC,IAAI,EAAE,QARR;IASEC,OAAO,EAAE,IATX;IAUEC,OAAO,EAAE,QAVX;IAWEC,IAAI,EAAE,GAXR;IAYEC,MAAM,EAAE,OAZV;IAaEC,OAAO,EAAE,QAbX;IAcEC,IAAI,EAAE,MAdR;IAeEC,GAAG,EAAE,MAfP;IAgBEC,EAAE,EAAE,QAhBN;IAiBEC,OAAO,EAAE;EAjBX;AAJ2B,CAApB"}
|
package/lib/widgets/error.d.ts
CHANGED
|
@@ -1,14 +1,2 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Create an error message block
|
|
3
|
-
* @param dom The DOM on which dom.createElement will be called
|
|
4
|
-
* @param err The error message string to display (or an error object)
|
|
5
|
-
* @param backgroundColor Background color. Default: '#fee'
|
|
6
|
-
* @param err2 Is the second param is a string, you can put the original Error in here
|
|
7
|
-
* @returns A div element with the err string
|
|
8
|
-
*
|
|
9
|
-
* This will return a DOM element you can put in the UI as a notice for the user
|
|
10
|
-
* Meanwhile the stack is dumped to the console for the developer, so you actually know
|
|
11
|
-
* where it happened!
|
|
12
|
-
*/
|
|
13
1
|
export declare function errorMessageBlock(dom: HTMLDocument, err: string | Error, backgroundColor?: string, err2?: Error): HTMLDivElement;
|
|
14
2
|
//# sourceMappingURL=error.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/widgets/error.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/widgets/error.ts"],"names":[],"mappings":"AAeA,wBAAgB,iBAAiB,CAAE,GAAG,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,GAAG,KAAK,EAAE,eAAe,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,KAAK,GAAG,cAAc,CAwBjI"}
|
package/lib/widgets/error.js
CHANGED
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.errorMessageBlock = errorMessageBlock;
|
|
7
7
|
|
|
8
|
+
var _widgets = require("../widgets");
|
|
9
|
+
|
|
8
10
|
/**
|
|
9
11
|
* Create an error message block
|
|
10
12
|
* @param dom The DOM on which dom.createElement will be called
|
|
@@ -35,6 +37,9 @@ function errorMessageBlock(dom, err, backgroundColor, err2) {
|
|
|
35
37
|
div.textContent = err;
|
|
36
38
|
}
|
|
37
39
|
|
|
40
|
+
div.appendChild((0, _widgets.cancelButton)(dom, function () {
|
|
41
|
+
if (div.parentNode) div.parentNode.removeChild(div);
|
|
42
|
+
})).style = 'width: 2em; height: 2em; align: right;';
|
|
38
43
|
div.setAttribute('style', 'margin: 0.1em; padding: 0.5em; border: 0.05em solid gray; background-color: ' + (backgroundColor || '#fee') + '; color:black;');
|
|
39
44
|
return div;
|
|
40
45
|
}
|
package/lib/widgets/error.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","names":["errorMessageBlock","dom","err","backgroundColor","err2","div","createElement","errorObject","Error","console","error","stack","textContent","message","setAttribute"],"sources":["../../src/widgets/error.ts"],"sourcesContent":["/**\n * Create an error message block\n * @param dom The DOM on which dom.createElement will be called\n * @param err The error message string to display (or an error object)\n * @param backgroundColor Background color. Default: '#fee'\n * @param err2 Is the second param is a string, you can put the original Error in here\n * @returns A div element with the err string\n *\n * This will return a DOM element you can put in the UI as a notice for the user\n * Meanwhile the stack is dumped to the console for the developer, so you actually know\n * where it happened!\n */\n/* eslint-disable no-console */\n\nexport function errorMessageBlock (dom: HTMLDocument, err: string | Error, backgroundColor?: string, err2?: Error): HTMLDivElement {\n const div = dom.createElement('div')\n\n /* tslint:disable-next-line */ // Too complex for TS?\n // @ts-ignore\n const errorObject:Error = err2 || err instanceof Error ? err : null\n\n if (errorObject) {\n console.error(`errorMessageBlock: ${errorObject} at: ${errorObject.stack || '??'}`, errorObject) // @@ pick one\n div.textContent = errorObject.message\n } else {\n div.textContent = err as string\n }\n div.setAttribute(\n 'style',\n 'margin: 0.1em; padding: 0.5em; border: 0.05em solid gray; background-color: ' +\n (backgroundColor || '#fee') +\n '; color:black;'\n )\n return div\n}\n"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"error.js","names":["errorMessageBlock","dom","err","backgroundColor","err2","div","createElement","errorObject","Error","console","error","stack","textContent","message","appendChild","cancelButton","parentNode","removeChild","style","setAttribute"],"sources":["../../src/widgets/error.ts"],"sourcesContent":["/**\n * Create an error message block\n * @param dom The DOM on which dom.createElement will be called\n * @param err The error message string to display (or an error object)\n * @param backgroundColor Background color. Default: '#fee'\n * @param err2 Is the second param is a string, you can put the original Error in here\n * @returns A div element with the err string\n *\n * This will return a DOM element you can put in the UI as a notice for the user\n * Meanwhile the stack is dumped to the console for the developer, so you actually know\n * where it happened!\n */\n/* eslint-disable no-console */\nimport { cancelButton } from '../widgets'\n\nexport function errorMessageBlock (dom: HTMLDocument, err: string | Error, backgroundColor?: string, err2?: Error): HTMLDivElement {\n const div = dom.createElement('div')\n\n /* tslint:disable-next-line */ // Too complex for TS?\n // @ts-ignore\n const errorObject:Error = err2 || err instanceof Error ? err : null\n\n if (errorObject) {\n console.error(`errorMessageBlock: ${errorObject} at: ${errorObject.stack || '??'}`, errorObject) // @@ pick one\n div.textContent = errorObject.message\n } else {\n div.textContent = err as string\n }\n\n div.appendChild(cancelButton(dom, () => { if (div.parentNode) div.parentNode.removeChild(div) }))\n .style = 'width: 2em; height: 2em; align: right;'\n\n div.setAttribute(\n 'style',\n 'margin: 0.1em; padding: 0.5em; border: 0.05em solid gray; background-color: ' +\n (backgroundColor || '#fee') +\n '; color:black;'\n )\n return div\n}\n"],"mappings":";;;;;;;AAaA;;AAbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AAGO,SAASA,iBAAT,CAA4BC,GAA5B,EAA+CC,GAA/C,EAAoEC,eAApE,EAA8FC,IAA9F,EAA4H;EACjI,IAAMC,GAAG,GAAGJ,GAAG,CAACK,aAAJ,CAAkB,KAAlB,CAAZ;EAEA;EAA+B;EAC/B;;EACA,IAAMC,WAAiB,GAAGH,IAAI,IAAIF,GAAG,YAAYM,KAAvB,GAA+BN,GAA/B,GAAqC,IAA/D;;EAEA,IAAIK,WAAJ,EAAiB;IACfE,OAAO,CAACC,KAAR,8BAAoCH,WAApC,kBAAuDA,WAAW,CAACI,KAAZ,IAAqB,IAA5E,GAAoFJ,WAApF,EADe,CACkF;;IACjGF,GAAG,CAACO,WAAJ,GAAkBL,WAAW,CAACM,OAA9B;EACD,CAHD,MAGO;IACLR,GAAG,CAACO,WAAJ,GAAkBV,GAAlB;EACD;;EAEDG,GAAG,CAACS,WAAJ,CAAgB,IAAAC,qBAAA,EAAad,GAAb,EAAkB,YAAM;IAAE,IAAII,GAAG,CAACW,UAAR,EAAoBX,GAAG,CAACW,UAAJ,CAAeC,WAAf,CAA2BZ,GAA3B;EAAiC,CAA/E,CAAhB,EACGa,KADH,GACW,wCADX;EAGAb,GAAG,CAACc,YAAJ,CACE,OADF,EAEE,kFACGhB,eAAe,IAAI,MADtB,IAEE,gBAJJ;EAMA,OAAOE,GAAP;AACD"}
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
10
|
exports.renderAutocompleteControl = renderAutocompleteControl;
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
13
13
|
|
|
14
14
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
15
15
|
|
|
@@ -27,7 +27,7 @@ var _autocompletePicker = require("./autocompletePicker");
|
|
|
27
27
|
|
|
28
28
|
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); }
|
|
29
29
|
|
|
30
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null ||
|
|
30
|
+
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; }
|
|
31
31
|
|
|
32
32
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
33
33
|
|
|
@@ -35,8 +35,6 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
35
35
|
|
|
36
36
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
37
37
|
|
|
38
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == (0, _typeof2["default"])(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
39
|
-
|
|
40
38
|
var WEBID_NOUN = 'Solid ID';
|
|
41
39
|
var GREEN_PLUS = _iconBase.icons.iconBase + 'noun_34653_green.svg';
|
|
42
40
|
var SEARCH_ICON = _iconBase.icons.iconBase + 'noun_Search_875351.svg';
|
|
@@ -49,10 +47,10 @@ function renderAutocompleteControl(_x, _x2, _x3, _x4, _x5, _x6) {
|
|
|
49
47
|
|
|
50
48
|
|
|
51
49
|
function _renderAutocompleteControl() {
|
|
52
|
-
_renderAutocompleteControl = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
50
|
+
_renderAutocompleteControl = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(dom, person, barOptions, acOptions, addOneIdAndRefresh, deleteOne) {
|
|
53
51
|
var autoCompleteDone, _autoCompleteDone, greenButtonHandler, _greenButtonHandler, removeDecorated, displayAutocomplete, _displayAutocomplete, searchButtonHandler, _searchButtonHandler, droppedURIHandler, _droppedURIHandler, acceptButton, cancelButton, deleteButtonContainer, noun, deleteButton, editButton, editing, syncEditingStatus, decoration, decoratedAutocomplete, creationArea, plus;
|
|
54
52
|
|
|
55
|
-
return
|
|
53
|
+
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
|
56
54
|
while (1) {
|
|
57
55
|
switch (_context6.prev = _context6.next) {
|
|
58
56
|
case 0:
|
|
@@ -70,10 +68,10 @@ function _renderAutocompleteControl() {
|
|
|
70
68
|
};
|
|
71
69
|
|
|
72
70
|
_droppedURIHandler = function _droppedURIHandler3() {
|
|
73
|
-
_droppedURIHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
71
|
+
_droppedURIHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(uris) {
|
|
74
72
|
var _iterator, _step, webid;
|
|
75
73
|
|
|
76
|
-
return
|
|
74
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
|
77
75
|
while (1) {
|
|
78
76
|
switch (_context5.prev = _context5.next) {
|
|
79
77
|
case 0:
|
|
@@ -128,8 +126,8 @@ function _renderAutocompleteControl() {
|
|
|
128
126
|
};
|
|
129
127
|
|
|
130
128
|
_searchButtonHandler = function _searchButtonHandler3() {
|
|
131
|
-
_searchButtonHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
132
|
-
return
|
|
129
|
+
_searchButtonHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(_event) {
|
|
130
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
133
131
|
while (1) {
|
|
134
132
|
switch (_context4.prev = _context4.next) {
|
|
135
133
|
case 0:
|
|
@@ -162,8 +160,8 @@ function _renderAutocompleteControl() {
|
|
|
162
160
|
};
|
|
163
161
|
|
|
164
162
|
_displayAutocomplete = function _displayAutocomplete3() {
|
|
165
|
-
_displayAutocomplete = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
166
|
-
return
|
|
163
|
+
_displayAutocomplete = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {
|
|
164
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
167
165
|
while (1) {
|
|
168
166
|
switch (_context3.prev = _context3.next) {
|
|
169
167
|
case 0:
|
|
@@ -210,9 +208,9 @@ function _renderAutocompleteControl() {
|
|
|
210
208
|
};
|
|
211
209
|
|
|
212
210
|
_greenButtonHandler = function _greenButtonHandler3() {
|
|
213
|
-
_greenButtonHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
211
|
+
_greenButtonHandler = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(_event) {
|
|
214
212
|
var webid;
|
|
215
|
-
return
|
|
213
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
216
214
|
while (1) {
|
|
217
215
|
switch (_context2.prev = _context2.next) {
|
|
218
216
|
case 0:
|
|
@@ -247,8 +245,8 @@ function _renderAutocompleteControl() {
|
|
|
247
245
|
};
|
|
248
246
|
|
|
249
247
|
_autoCompleteDone = function _autoCompleteDone3() {
|
|
250
|
-
_autoCompleteDone = (0, _asyncToGenerator2["default"])( /*#__PURE__*/
|
|
251
|
-
return
|
|
248
|
+
_autoCompleteDone = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(object, name) {
|
|
249
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
252
250
|
while (1) {
|
|
253
251
|
switch (_context.prev = _context.next) {
|
|
254
252
|
case 0:
|