@fluid-topics/ft-search-results 1.2.51 → 1.2.52
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.
|
@@ -146,11 +146,12 @@ Also for action icons.`,a.colorGray200),contentGlobalSubtle:e.extend("--ft-conte
|
|
|
146
146
|
`}};ee.styles=[Va,Za,qa,Ya,Qa,Xa,Ja,ei,ti,ri,oi,...ni];ai([(0,co.property)()],ee.prototype,"element",void 0);ai([(0,co.property)()],ee.prototype,"variant",void 0);(0,si.customElement)("ft-typography")(ee);var hi=O(lo());var li=r=>r??U;function di(r){var t,o,n,i,s;return((i=(o=(t=r.map)===null||t===void 0?void 0:t.openMode)!==null&&o!==void 0?o:(n=r.topic)===null||n===void 0?void 0:n.openMode)!==null&&i!==void 0?i:(s=r.document)===null||s===void 0?void 0:s.openMode)===Ct.EXTERNAL}function ui(r){var t,o,n,i,s;if(di(r))return(i=(o=(t=r.map)===null||t===void 0?void 0:t.originUrl)!==null&&o!==void 0?o:(n=r.topic)===null||n===void 0?void 0:n.originUrl)!==null&&i!==void 0?i:(s=r.document)===null||s===void 0?void 0:s.originUrl;switch(r.type){case Le.MAP:return r.map.readerUrl;case Le.DOCUMENT:return r.document.viewerUrl;case Le.TOPIC:return r.topic.readerUrl}return""}function pi(r,t){return li(t&&di(r)?"_blank":void 0)}var Xt=class extends CustomEvent{constructor(t,o){super("ft-search-result-click",{detail:{result:t,rank:o},bubbles:!0,composed:!0})}};var zs=function(r,t,o,n){var i=arguments.length,s=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,o):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,t,o,n);else for(var d=r.length-1;d>=0;d--)(l=r[d])&&(s=(i<3?l(s):i>3?l(t,o,s):l(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s},Ne=class extends Ge{constructor(){super(...arguments),this.withoutLink=!1}render(){var t;return this.result?this.withoutLink?this.renderTitle():mt.html`
|
|
147
147
|
<a href="${ui(this.result)}"
|
|
148
148
|
@click=${this.onResultClick}
|
|
149
|
+
@auxclick=${o=>this.onAuxClick(o)}
|
|
149
150
|
target="${pi(this.result,(t=this.stateManager)===null||t===void 0?void 0:t.openExternalDocumentInNewTab)}"
|
|
150
151
|
part="link">
|
|
151
152
|
${this.renderTitle()}
|
|
152
153
|
</a>
|
|
153
|
-
`:mt.nothing}renderTitle(){return mt.html`
|
|
154
|
+
`:mt.nothing}onAuxClick(t){t.button==1&&this.onResultClick()}renderTitle(){return mt.html`
|
|
154
155
|
<ft-typography variant="title" part="text">${(0,hi.unsafeHTML)(this.selectTitle(this.result))}</ft-typography>
|
|
155
156
|
`}onResultClick(){this.dispatchEvent(new Xt(this.result,this.rank))}selectTitle(t){switch(t.type){case"MAP":return t.map.htmlTitle;case"DOCUMENT":return t.document.htmlTitle;case"TOPIC":return t.topic.htmlTitle}return""}contentAvailableCallback(t){var o;super.contentAvailableCallback(t),this.shadowRoot.querySelectorAll(".kwicmatch").forEach(n=>n.setAttribute("part","kwicmatch")),!this.withoutLink&&t.has("rank")&&this.rank!=null&&(!((o=this.stateManager)===null||o===void 0)&&o.store.commands.consume(`focus-result-${this.rank}`))&&(this.elementToFocus={selector:"a"})}};Ne.elementDefinitions={"ft-typography":ee};Ne.styles=ra;zs([(0,fi.property)({type:Boolean})],Ne.prototype,"withoutLink",void 0);(0,yi.customElement)("ft-search-result-title")(Ne);var vi=O(T());var uo=O(W());var gi=O(W()),mi=O(T()),Hs={highlightBackgroundColor:mi.FtCssVariableFactory.create("--ft-sra-highlight-background-color","","COLOR","transparent")},bi=gi.css`
|
|
156
157
|
.kwicmatch {
|
|
@@ -189,11 +189,12 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:t.extend("--ft-conte
|
|
|
189
189
|
`}};le.styles=[vc,Sc,Oc,Cc,Ec,wc,Ac,Rc,Nc,Ic,Tc,..._c];Pc([T()],le.prototype,"element",void 0);Pc([T()],le.prototype,"variant",void 0);J("ft-typography")(le);var Lc=r=>r??W;function kc(r){var e,o,n,a,i;return((a=(o=(e=r.map)===null||e===void 0?void 0:e.openMode)!==null&&o!==void 0?o:(n=r.topic)===null||n===void 0?void 0:n.openMode)!==null&&a!==void 0?a:(i=r.document)===null||i===void 0?void 0:i.openMode)===eo.EXTERNAL}function Fc(r){var e,o,n,a,i;if(kc(r))return(a=(o=(e=r.map)===null||e===void 0?void 0:e.originUrl)!==null&&o!==void 0?o:(n=r.topic)===null||n===void 0?void 0:n.originUrl)!==null&&a!==void 0?a:(i=r.document)===null||i===void 0?void 0:i.originUrl;switch(r.type){case It.MAP:return r.map.readerUrl;case It.DOCUMENT:return r.document.viewerUrl;case It.TOPIC:return r.topic.readerUrl}return""}function Dc(r,e){return Lc(e&&kc(r)?"_blank":void 0)}var lo=class extends CustomEvent{constructor(e,o){super("ft-search-result-click",{detail:{result:e,rank:o},bubbles:!0,composed:!0})}};var $u=function(r,e,o,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,o):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(r,e,o,n);else for(var l=r.length-1;l>=0;l--)(s=r[l])&&(i=(a<3?s(i):a>3?s(e,o,i):s(e,o))||i);return a>3&&i&&Object.defineProperty(e,o,i),i},st=class extends Ft{constructor(){super(...arguments),this.withoutLink=!1}render(){var e;return this.result?this.withoutLink?this.renderTitle():V`
|
|
190
190
|
<a href="${Fc(this.result)}"
|
|
191
191
|
@click=${this.onResultClick}
|
|
192
|
+
@auxclick=${o=>this.onAuxClick(o)}
|
|
192
193
|
target="${Dc(this.result,(e=this.stateManager)===null||e===void 0?void 0:e.openExternalDocumentInNewTab)}"
|
|
193
194
|
part="link">
|
|
194
195
|
${this.renderTitle()}
|
|
195
196
|
</a>
|
|
196
|
-
`:W}renderTitle(){return V`
|
|
197
|
+
`:W}onAuxClick(e){e.button==1&&this.onResultClick()}renderTitle(){return V`
|
|
197
198
|
<ft-typography variant="title" part="text">${tr(this.selectTitle(this.result))}</ft-typography>
|
|
198
199
|
`}onResultClick(){this.dispatchEvent(new lo(this.result,this.rank))}selectTitle(e){switch(e.type){case"MAP":return e.map.htmlTitle;case"DOCUMENT":return e.document.htmlTitle;case"TOPIC":return e.topic.htmlTitle}return""}contentAvailableCallback(e){var o;super.contentAvailableCallback(e),this.shadowRoot.querySelectorAll(".kwicmatch").forEach(n=>n.setAttribute("part","kwicmatch")),!this.withoutLink&&e.has("rank")&&this.rank!=null&&(!((o=this.stateManager)===null||o===void 0)&&o.store.commands.consume(`focus-result-${this.rank}`))&&(this.elementToFocus={selector:"a"})}};st.elementDefinitions={"ft-typography":le};st.styles=yc;$u([T({type:Boolean})],st.prototype,"withoutLink",void 0);J("ft-search-result-title")(st);var Hu={highlightBackgroundColor:t.create("--ft-sra-highlight-background-color","","COLOR","transparent")},Mc=P`
|
|
199
200
|
.kwicmatch {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-search-results",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.52",
|
|
4
4
|
"description": "Search result list for integrated search component",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-search-result-context": "1.2.
|
|
23
|
-
"@fluid-topics/ft-wc-utils": "1.2.
|
|
22
|
+
"@fluid-topics/ft-search-result-context": "1.2.52",
|
|
23
|
+
"@fluid-topics/ft-wc-utils": "1.2.52",
|
|
24
24
|
"lit": "3.1.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@fluid-topics/public-api": "1.0.90"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "5bdea3806bc9a17448a0533c5c3ecfee0cfa8bac"
|
|
30
30
|
}
|