@fluid-topics/ft-reader-internal-link 0.3.12 → 0.3.13
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/build/ft-reader-internal-link.css.d.ts +5 -0
- package/build/ft-reader-internal-link.css.js +17 -0
- package/build/ft-reader-internal-link.d.ts +1 -5
- package/build/ft-reader-internal-link.js +3 -15
- package/build/ft-reader-internal-link.light.js +11 -11
- package/build/ft-reader-internal-link.min.js +11 -11
- package/build/ft-reader-internal-link.properties.d.ts +7 -0
- package/build/ft-reader-internal-link.properties.js +2 -0
- package/build/index.d.ts +2 -0
- package/build/index.js +2 -0
- package/package.json +3 -3
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { designSystemVariables, FtCssVariableFactory } from "@fluid-topics/ft-wc-utils";
|
|
2
|
+
import { css } from "lit";
|
|
3
|
+
export const FtReaderInternalLinkCssVariables = {
|
|
4
|
+
outlineColor: FtCssVariableFactory.extend("--ft-reader-internal-link-outline-color", designSystemVariables.colorPrimary),
|
|
5
|
+
};
|
|
6
|
+
// language=CSS
|
|
7
|
+
export const styles = css `
|
|
8
|
+
a:focus {
|
|
9
|
+
outline-color: ${FtReaderInternalLinkCssVariables.outlineColor};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.ft-reader-link--remove-style {
|
|
13
|
+
text-decoration: none;
|
|
14
|
+
color: inherit;
|
|
15
|
+
}
|
|
16
|
+
`;
|
|
17
|
+
//# sourceMappingURL=ft-reader-internal-link.css.js.map
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { FtReaderComponent } from "@fluid-topics/ft-reader-context/build/registration";
|
|
2
|
-
|
|
3
|
-
}
|
|
4
|
-
export declare const FtReaderInternalLinkCssVariables: {
|
|
5
|
-
outlineColor: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
6
|
-
};
|
|
2
|
+
import { FtReaderInternalLinkProperties } from "./ft-reader-internal-link.properties";
|
|
7
3
|
export declare class FtReaderInternalLink extends FtReaderComponent implements FtReaderInternalLinkProperties {
|
|
8
4
|
static styles: import("lit").CSSResult;
|
|
9
5
|
tocId?: string;
|
|
@@ -4,14 +4,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import {
|
|
7
|
+
import { html } from "lit";
|
|
8
8
|
import { property } from "lit/decorators.js";
|
|
9
9
|
import { classMap } from "lit/directives/class-map.js";
|
|
10
10
|
import { FtReaderComponent } from "@fluid-topics/ft-reader-context/build/registration";
|
|
11
|
-
import {
|
|
12
|
-
export const FtReaderInternalLinkCssVariables = {
|
|
13
|
-
outlineColor: FtCssVariableFactory.extend("--ft-reader-internal-link-outline-color", designSystemVariables.colorPrimary),
|
|
14
|
-
};
|
|
11
|
+
import { styles } from "./ft-reader-internal-link.css";
|
|
15
12
|
export class FtReaderInternalLink extends FtReaderComponent {
|
|
16
13
|
constructor() {
|
|
17
14
|
super(...arguments);
|
|
@@ -43,16 +40,7 @@ export class FtReaderInternalLink extends FtReaderComponent {
|
|
|
43
40
|
}
|
|
44
41
|
}
|
|
45
42
|
// language=CSS
|
|
46
|
-
FtReaderInternalLink.styles =
|
|
47
|
-
a:focus {
|
|
48
|
-
outline-color: ${FtReaderInternalLinkCssVariables.outlineColor};
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.ft-reader-link--remove-style {
|
|
52
|
-
text-decoration: none;
|
|
53
|
-
color: inherit;
|
|
54
|
-
}
|
|
55
|
-
`;
|
|
43
|
+
FtReaderInternalLink.styles = styles;
|
|
56
44
|
__decorate([
|
|
57
45
|
property()
|
|
58
46
|
], FtReaderInternalLink.prototype, "tocId", void 0);
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
!function(e,t,o,r,s){var i=function(e,t,o,r){for(var s,i=arguments.length,l=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r,n=e.length-1;n>=0;n--)(s=e[n])&&(l=(i<3?s(l):i>3?s(t,o,l):s(t,o))||l);return i>3&&l&&Object.defineProperty(t,o,l),l};class l extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}}class n extends t.FtLitElementRedux{setReaderStateManager(e){this.stateManager=e,this.store=e.store}get service(){var e;return null===(e=this.stateManager)||void 0===e?void 0:e.service}connectedCallback(){super.connectedCallback(),setTimeout((()=>this.dispatchEvent(new l)),10)}disconnectedCallback(){super.disconnectedCallback(),this.store=void 0,this.stateManager=void 0}}i([r.state()],n.prototype,"stateManager",void 0);
|
|
1
|
+
!function(e,t,o,r,s){var i=function(e,t,o,r){for(var s,i=arguments.length,l=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r,n=e.length-1;n>=0;n--)(s=e[n])&&(l=(i<3?s(l):i>3?s(t,o,l):s(t,o))||l);return i>3&&l&&Object.defineProperty(t,o,l),l};class l extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}}class n extends t.FtLitElementRedux{setReaderStateManager(e){this.stateManager=e,this.store=e.store}get service(){var e;return null===(e=this.stateManager)||void 0===e?void 0:e.service}connectedCallback(){super.connectedCallback(),setTimeout((()=>this.dispatchEvent(new l)),10)}disconnectedCallback(){super.disconnectedCallback(),this.store=void 0,this.stateManager=void 0}}i([r.state()],n.prototype,"stateManager",void 0);const a={outlineColor:t.FtCssVariableFactory.extend("--ft-reader-internal-link-outline-color",t.designSystemVariables.colorPrimary)},c=o.css`
|
|
2
|
+
a:focus {
|
|
3
|
+
outline-color: ${a.outlineColor};
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.ft-reader-link--remove-style {
|
|
7
|
+
text-decoration: none;
|
|
8
|
+
color: inherit;
|
|
9
|
+
}
|
|
10
|
+
`;var d=function(e,t,o,r){for(var s,i=arguments.length,l=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r,n=e.length-1;n>=0;n--)(s=e[n])&&(l=(i<3?s(l):i>3?s(t,o,l):s(t,o))||l);return i>3&&l&&Object.defineProperty(t,o,l),l};class u extends n{constructor(){super(...arguments),this.removeStyle=!1}render(){var e;let t=s.classMap({"ft-reader-link":!0,"ft-reader-link--remove-style":this.removeStyle});return o.html`
|
|
2
11
|
<a class=${t}
|
|
3
12
|
href="${null===(e=this.service)||void 0===e?void 0:e.getLink(this.tocId,this.pageNumber,this.section)}"
|
|
4
13
|
@click=${e=>this.onClick(e)}>
|
|
5
14
|
<slot></slot>
|
|
6
15
|
</a>
|
|
7
|
-
`}onClick(e){var t;e.ctrlKey||e.metaKey||(e.stopPropagation(),e.preventDefault(),this.tocId&&(null===(t=this.stateManager)||void 0===t||t.navigateToTopic(this.tocId,this.section,this.pageNumber)))}}d.styles=
|
|
8
|
-
a:focus {
|
|
9
|
-
outline-color: ${c.outlineColor};
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.ft-reader-link--remove-style {
|
|
13
|
-
text-decoration: none;
|
|
14
|
-
color: inherit;
|
|
15
|
-
}
|
|
16
|
-
`,a([r.property()],d.prototype,"tocId",void 0),a([r.property()],d.prototype,"section",void 0),a([r.property({type:Number})],d.prototype,"pageNumber",void 0),a([r.property({type:Boolean})],d.prototype,"removeStyle",void 0),t.customElement("ft-reader-internal-link")(d),e.FtReaderInternalLink=d,e.FtReaderInternalLinkCssVariables=c,Object.defineProperty(e,"t",{value:!0})}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litClassMap);
|
|
16
|
+
`}onClick(e){var t;e.ctrlKey||e.metaKey||(e.stopPropagation(),e.preventDefault(),this.tocId&&(null===(t=this.stateManager)||void 0===t||t.navigateToTopic(this.tocId,this.section,this.pageNumber)))}}u.styles=c,d([r.property()],u.prototype,"tocId",void 0),d([r.property()],u.prototype,"section",void 0),d([r.property({type:Number})],u.prototype,"pageNumber",void 0),d([r.property({type:Boolean})],u.prototype,"removeStyle",void 0),t.customElement("ft-reader-internal-link")(u),e.FtReaderInternalLink=u,e.FtReaderInternalLinkCssVariables=a,e.styles=c,Object.defineProperty(e,"t",{value:!0})}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litClassMap);
|
|
@@ -84,19 +84,19 @@ const ut=1;
|
|
|
84
84
|
* Copyright 2018 Google LLC
|
|
85
85
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
86
86
|
*/
|
|
87
|
-
const dt=(t=>(...e)=>({_$litDirective$:t,values:e}))(class extends class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}{constructor(t){var e;if(super(t),t.type!==ut||"class"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){var i,s;if(void 0===this.nt){this.nt=new Set,void 0!==t.strings&&(this.st=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!(null===(i=this.st)||void 0===i?void 0:i.has(t))&&this.nt.add(t);return this.render(e)}const o=t.element.classList;this.nt.forEach((t=>{t in e||(o.remove(t),this.nt.delete(t))}));for(const t in e){const i=!!e[t];i===this.nt.has(t)||(null===(s=this.st)||void 0===s?void 0:s.has(t))||(i?(o.add(t),this.nt.add(t)):(o.remove(t),this.nt.delete(t)))}return _}});var pt=function(t,e,i,s){for(var o,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,a=t.length-1;a>=0;a--)(o=t[a])&&(r=(n<3?o(r):n>3?o(e,i,r):o(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class ft extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}}class vt extends ht{setReaderStateManager(t){this.stateManager=t,this.store=t.store}get service(){var t;return null===(t=this.stateManager)||void 0===t?void 0:t.service}connectedCallback(){super.connectedCallback(),setTimeout((()=>this.dispatchEvent(new ft)),10)}disconnectedCallback(){super.disconnectedCallback(),this.store=void 0,this.stateManager=void 0}}pt([function(t){return i({...t,state:!0})}()],vt.prototype,"stateManager",void 0);
|
|
87
|
+
const dt=(t=>(...e)=>({_$litDirective$:t,values:e}))(class extends class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}{constructor(t){var e;if(super(t),t.type!==ut||"class"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){var i,s;if(void 0===this.nt){this.nt=new Set,void 0!==t.strings&&(this.st=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!(null===(i=this.st)||void 0===i?void 0:i.has(t))&&this.nt.add(t);return this.render(e)}const o=t.element.classList;this.nt.forEach((t=>{t in e||(o.remove(t),this.nt.delete(t))}));for(const t in e){const i=!!e[t];i===this.nt.has(t)||(null===(s=this.st)||void 0===s?void 0:s.has(t))||(i?(o.add(t),this.nt.add(t)):(o.remove(t),this.nt.delete(t)))}return _}});var pt=function(t,e,i,s){for(var o,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,a=t.length-1;a>=0;a--)(o=t[a])&&(r=(n<3?o(r):n>3?o(e,i,r):o(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class ft extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}}class vt extends ht{setReaderStateManager(t){this.stateManager=t,this.store=t.store}get service(){var t;return null===(t=this.stateManager)||void 0===t?void 0:t.service}connectedCallback(){super.connectedCallback(),setTimeout((()=>this.dispatchEvent(new ft)),10)}disconnectedCallback(){super.disconnectedCallback(),this.store=void 0,this.stateManager=void 0}}pt([function(t){return i({...t,state:!0})}()],vt.prototype,"stateManager",void 0);const yt={outlineColor:ot.extend("--ft-reader-internal-link-outline-color",nt.colorPrimary)},bt=c`
|
|
88
|
+
a:focus {
|
|
89
|
+
outline-color: ${yt.outlineColor};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.ft-reader-link--remove-style {
|
|
93
|
+
text-decoration: none;
|
|
94
|
+
color: inherit;
|
|
95
|
+
}
|
|
96
|
+
`;var mt,xt=function(t,e,i,s){for(var o,n=arguments.length,r=n<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,a=t.length-1;a>=0;a--)(o=t[a])&&(r=(n<3?o(r):n>3?o(e,i,r):o(e,i))||r);return n>3&&r&&Object.defineProperty(e,i,r),r};class gt extends vt{constructor(){super(...arguments),this.removeStyle=!1}render(){var t;let e=dt({"ft-reader-link":!0,"ft-reader-link--remove-style":this.removeStyle});return j`
|
|
88
97
|
<a class=${e}
|
|
89
98
|
href="${null===(t=this.service)||void 0===t?void 0:t.getLink(this.tocId,this.pageNumber,this.section)}"
|
|
90
99
|
@click=${t=>this.onClick(t)}>
|
|
91
100
|
<slot></slot>
|
|
92
101
|
</a>
|
|
93
|
-
`}onClick(t){var e;t.ctrlKey||t.metaKey||(t.stopPropagation(),t.preventDefault(),this.tocId&&(null===(e=this.stateManager)||void 0===e||e.navigateToTopic(this.tocId,this.section,this.pageNumber)))}}
|
|
94
|
-
a:focus {
|
|
95
|
-
outline-color: ${bt.outlineColor};
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.ft-reader-link--remove-style {
|
|
99
|
-
text-decoration: none;
|
|
100
|
-
color: inherit;
|
|
101
|
-
}
|
|
102
|
-
`,yt([i()],mt.prototype,"tocId",void 0),yt([i()],mt.prototype,"section",void 0),yt([i({type:Number})],mt.prototype,"pageNumber",void 0),yt([i({type:Boolean})],mt.prototype,"removeStyle",void 0),(xt="ft-reader-internal-link",t=>{window.customElements.get(xt)||window.customElements.define(xt,t)})(mt),t.FtReaderInternalLink=mt,t.FtReaderInternalLinkCssVariables=bt,Object.defineProperty(t,"i",{value:!0})}({});
|
|
102
|
+
`}onClick(t){var e;t.ctrlKey||t.metaKey||(t.stopPropagation(),t.preventDefault(),this.tocId&&(null===(e=this.stateManager)||void 0===e||e.navigateToTopic(this.tocId,this.section,this.pageNumber)))}}gt.styles=bt,xt([i()],gt.prototype,"tocId",void 0),xt([i()],gt.prototype,"section",void 0),xt([i({type:Number})],gt.prototype,"pageNumber",void 0),xt([i({type:Boolean})],gt.prototype,"removeStyle",void 0),(mt="ft-reader-internal-link",t=>{window.customElements.get(mt)||window.customElements.define(mt,t)})(gt),t.FtReaderInternalLink=gt,t.FtReaderInternalLinkCssVariables=yt,t.styles=bt,Object.defineProperty(t,"i",{value:!0})}({});
|
package/build/index.d.ts
CHANGED
package/build/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { customElement } from "@fluid-topics/ft-wc-utils";
|
|
2
2
|
import { FtReaderInternalLink } from "./ft-reader-internal-link";
|
|
3
|
+
export * from "./ft-reader-internal-link.css";
|
|
4
|
+
export * from "./ft-reader-internal-link.properties";
|
|
3
5
|
export * from "./ft-reader-internal-link";
|
|
4
6
|
customElement("ft-reader-internal-link")(FtReaderInternalLink);
|
|
5
7
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-reader-internal-link",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.13",
|
|
4
4
|
"description": "Reader internal link for integrated reader",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Lit"
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@fluid-topics/ft-wc-utils": "0.3.
|
|
22
|
+
"@fluid-topics/ft-wc-utils": "0.3.13",
|
|
23
23
|
"lit": "2.2.8"
|
|
24
24
|
},
|
|
25
|
-
"gitHead": "
|
|
25
|
+
"gitHead": "84b5fc920bc5d2bdb646b5da8815ad51caaf228e"
|
|
26
26
|
}
|