@fluid-topics/ft-reader-internal-link 1.2.65 → 1.2.67
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.
|
@@ -29,12 +29,14 @@ class FtReaderInternalLink extends FtReaderComponent {
|
|
|
29
29
|
`;
|
|
30
30
|
}
|
|
31
31
|
onLinkClick(e) {
|
|
32
|
-
var _a;
|
|
32
|
+
var _a, _b, _c;
|
|
33
33
|
if (!e.ctrlKey && !e.metaKey) {
|
|
34
34
|
e.stopPropagation();
|
|
35
35
|
e.preventDefault();
|
|
36
36
|
performance.mark(`fluid_topics__reader_link_click__${this.tocId}`);
|
|
37
37
|
(_a = this.stateManager) === null || _a === void 0 ? void 0 : _a.navigateToTopic(this.tocId, this.section, this.pageNumber);
|
|
38
|
+
(_b = this.stateManager) === null || _b === void 0 ? void 0 : _b.store.commands.clear(/^focus-topic-/);
|
|
39
|
+
(_c = this.stateManager) === null || _c === void 0 ? void 0 : _c.store.commands.add({ type: `focus-topic-${this.tocId}` });
|
|
38
40
|
this.click();
|
|
39
41
|
}
|
|
40
42
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(()=>{var A=Object.create;var y=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty;var
|
|
1
|
+
"use strict";(()=>{var A=Object.create;var y=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty;var d=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var G=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of B(t))!D.call(e,o)&&o!==r&&y(e,o,{get:()=>t[o],enumerable:!(i=w(t,o))||i.enumerable});return e};var l=(e,t,r)=>(r=e!=null?A(j(e)):{},G(t||!e||!e.__esModule?y(r,"default",{value:e,enumerable:!0}):r,e));var f=d((q,C)=>{C.exports=ftGlobals.wcUtils});var v=d((z,_)=>{_.exports=ftGlobals.lit});var b=d((J,O)=>{O.exports=ftGlobals.litDecorators});var M=d((Q,I)=>{I.exports=ftGlobals.litClassMap});var P=l(f());var E=l(v()),p=l(b()),K=l(M());var T=l(f()),k=l(b());var S;(function(e){e.clusteringHelperCreated="clustering-helper-created",e.mapAttachmentsUpdate="map-attachments-update",e.visibleTopicChange="visible-topic-change"})(S||(S={}));var R;(function(e){e.FEEDBACK="FEEDBACK",e.RATING="RATING",e.PRINT="PRINT",e.BOOKMARK="BOOKMARK",e.COLLECTIONS="COLLECTIONS",e.PERSONAL_BOOKS="PERSONAL_BOOKS"})(R||(R={}));var $=function(e,t,r,i){var o=arguments.length,s=o<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,r):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,i);else for(var c=e.length-1;c>=0;c--)(n=e[c])&&(s=(o<3?n(s):o>3?n(t,r,s):n(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},x=class extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}},g=Symbol("registerInterval");function V(e){var t;class r extends e{constructor(){super(...arguments),this[t]=0}setReaderStateManager(o){this.clearStateManager(),this.stateManager=o,this.addStore(o.store,"reader")}clearStateManager(){this.stateManager&&(this.removeStore("reader"),this.stateManager=void 0)}get service(){var o;return(o=this.stateManager)===null||o===void 0?void 0:o.service}connectedCallback(){super.connectedCallback(),this[g]=window.setInterval(()=>this.tryToRegisterToContext(),50)}tryToRegisterToContext(){this.stateManager!=null?window.clearInterval(this[g]):this.dispatchEvent(new x)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return t=g,$([(0,k.state)()],r.prototype,"stateManager",void 0),r}var m=class extends V(T.FtLitElementRedux){};var u=l(f()),N=l(v()),U={outlineColor:u.FtCssVariableFactory.extend("--ft-reader-internal-link-outline-color","",u.designSystemVariables.colorPrimary)},L=N.css`
|
|
2
2
|
:host {
|
|
3
3
|
display: contents;
|
|
4
4
|
}
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
text-decoration: none;
|
|
12
12
|
color: inherit;
|
|
13
13
|
}
|
|
14
|
-
`;var h=function(t,
|
|
14
|
+
`;var h=function(e,t,r,i){var o=arguments.length,s=o<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,r):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,i);else for(var c=e.length-1;c>=0;c--)(n=e[c])&&(s=(o<3?n(s):o>3?n(t,r,s):n(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},a=class extends m{constructor(){super(...arguments),this.removeStyle=!1}render(){var t;let r=(0,K.classMap)({"ft-reader-link":!0,"ft-reader-link--remove-style":this.removeStyle});return E.html`
|
|
15
15
|
<a class=${r}
|
|
16
|
-
href="${(
|
|
17
|
-
@click=${
|
|
16
|
+
href="${(t=this.service)===null||t===void 0?void 0:t.getLink(this.tocId,this.pageNumber,this.section)}"
|
|
17
|
+
@click=${i=>this.onLinkClick(i)}>
|
|
18
18
|
<slot></slot>
|
|
19
19
|
</a>
|
|
20
|
-
`}onLinkClick(
|
|
20
|
+
`}onLinkClick(t){var r,i,o;!t.ctrlKey&&!t.metaKey&&(t.stopPropagation(),t.preventDefault(),performance.mark(`fluid_topics__reader_link_click__${this.tocId}`),(r=this.stateManager)===null||r===void 0||r.navigateToTopic(this.tocId,this.section,this.pageNumber),(i=this.stateManager)===null||i===void 0||i.store.commands.clear(/^focus-topic-/),(o=this.stateManager)===null||o===void 0||o.store.commands.add({type:`focus-topic-${this.tocId}`}),this.click())}};a.styles=L;h([(0,p.property)()],a.prototype,"tocId",void 0);h([(0,p.property)()],a.prototype,"section",void 0);h([(0,p.property)({type:Number})],a.prototype,"pageNumber",void 0);h([(0,p.property)({type:Boolean})],a.prototype,"removeStyle",void 0);(0,P.customElement)("ft-reader-internal-link")(a);})();
|