@fluid-topics/ft-reader-topic-context 1.4.5 → 2.0.0
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.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/build/define.js
ADDED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";(()=>{var P=Object.create;var I=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var K=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var g=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var D=(e,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of A(t))!B.call(e,r)&&r!==o&&I(e,r,{get:()=>t[r],enumerable:!(i=w(t,r))||i.enumerable});return e};var l=(e,t,o)=>(o=e!=null?P(K(e)):{},D(t||!e||!e.__esModule?I(o,"default",{value:e,enumerable:!0}):o,e));var
|
|
2
|
-
`;var m=l(
|
|
1
|
+
"use strict";(()=>{var P=Object.create;var I=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var K=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var g=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var D=(e,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of A(t))!B.call(e,r)&&r!==o&&I(e,r,{get:()=>t[r],enumerable:!(i=w(t,r))||i.enumerable});return e};var l=(e,t,o)=>(o=e!=null?P(K(e)):{},D(t||!e||!e.__esModule?I(o,"default",{value:e,enumerable:!0}):o,e));var h=g(($,O)=>{O.exports=ftGlobals.wcUtils});var v=g((H,y)=>{y.exports=ftGlobals.lit});var C=g((V,N)=>{N.exports=ftGlobals.litDecorators});var E=l(h());var _=l(v()),p=l(C());var S=l(v());var R=S.css`
|
|
2
|
+
`;var m=l(h()),M=l(C());var T;(function(e){e.clusteringHelperCreated="clustering-helper-created",e.mapAttachmentsUpdate="map-attachments-update",e.visibleTopicChange="visible-topic-change"})(T||(T={}));var L;(function(e){e.FEEDBACK="FEEDBACK",e.RATING="RATING",e.PRINT="PRINT",e.BOOKMARK="BOOKMARK",e.COLLECTIONS="COLLECTIONS",e.PERSONAL_BOOKS="PERSONAL_BOOKS"})(L||(L={}));var j=function(e,t,o,i){var r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,o):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,o,i);else for(var c=e.length-1;c>=0;c--)(a=e[c])&&(s=(r<3?a(s):r>3?a(t,o,s):a(t,o))||s);return r>3&&s&&Object.defineProperty(t,o,s),s},x=class extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}},b=Symbol("registerInterval"),G=(0,m.applyMixinOnce)(Symbol("toFtReaderComponent"),function(e){var t;class o extends e{constructor(){super(...arguments),this[t]=0}setReaderStateManager(r){this.clearStateManager(),this.stateManager=r,this.addStore(r.store,"reader")}clearStateManager(){this.stateManager&&(this.removeStore("reader"),this.stateManager=void 0)}get service(){var r;return(r=this.stateManager)===null||r===void 0?void 0:r.service}connectedCallback(){super.connectedCallback(),this[b]=window.setInterval(()=>this.tryToRegisterToContext(),50)}tryToRegisterToContext(){this.stateManager!=null?window.clearInterval(this[b]):this.dispatchEvent(new x)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return t=b,j([(0,M.state)()],o.prototype,"stateManager",void 0),o}),f=class extends G(m.FtLitElementRedux){};var u=l(h()),d=function(e,t,o,i){var r=arguments.length,s=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,o):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,o,i);else for(var c=e.length-1;c>=0;c--)(a=e[c])&&(s=(r<3?a(s):r>3?a(t,o,s):a(t,o))||s);return r>3&&s&&Object.defineProperty(t,o,s),s},n=class extends f{constructor(){super(...arguments),this.disableContextInteractions=!1,this.headingLevelsShift=0,this.registeredComponents=[]}render(){return _.html`
|
|
3
3
|
<article id=${this.tocId}>
|
|
4
4
|
<slot @register-ft-reader-topic-component=${this.registerComponent}></slot>
|
|
5
5
|
</article>
|
|
6
|
-
`}registerComponent(t){t.stopPropagation();let o=t.composedPath()[0];this.register(o)}register(t){this.registeredComponents.push(t),t.tocNode=this.tocNode,t.disableContextInteractions=this.disableContextInteractions,t.headingLevelsShift=this.headingLevelsShift}update(t){super.update(t),["mapId","tocId","stateManager","translationDestinationLanguage","translationProfileId"].some(o=>t.has(o))&&this.setTocNode(),t.has("tocNode")&&this.registeredComponents.forEach(o=>o.tocNode=this.tocNode)}async setTocNode(){var t;this.tocNode=void 0,this.tocNode=this.mapId&&this.tocId?await((t=this.stateManager)===null||t===void 0?void 0:t.getTocNode(this.tocId)):void 0}disconnectedCallback(){super.disconnectedCallback(),this.registeredComponents=[]}};n.styles=R;
|
|
6
|
+
`}registerComponent(t){t.stopPropagation();let o=t.composedPath()[0];this.register(o)}register(t){this.registeredComponents.push(t),t.tocNode=this.tocNode,t.disableContextInteractions=this.disableContextInteractions,t.headingLevelsShift=this.headingLevelsShift}update(t){super.update(t),["mapId","tocId","stateManager","translationDestinationLanguage","translationProfileId"].some(o=>t.has(o))&&this.setTocNode(),t.has("tocNode")&&this.registeredComponents.forEach(o=>o.tocNode=this.tocNode)}async setTocNode(){var t;this.tocNode=void 0,this.tocNode=this.mapId&&this.tocId?await((t=this.stateManager)===null||t===void 0?void 0:t.getTocNode(this.tocId)):void 0}disconnectedCallback(){super.disconnectedCallback(),this.registeredComponents=[]}};n.styles=R;d([(0,u.redux)({selector:e=>{var t;return(t=e.map)===null||t===void 0?void 0:t.id}})],n.prototype,"mapId",void 0);d([(0,u.redux)({selector:e=>e.translation.profileId})],n.prototype,"translationProfileId",void 0);d([(0,u.redux)({selector:e=>e.translation.destinationLanguage})],n.prototype,"translationDestinationLanguage",void 0);d([(0,p.property)()],n.prototype,"tocId",void 0);d([(0,p.property)({type:Boolean})],n.prototype,"disableContextInteractions",void 0);d([(0,p.property)({type:Number})],n.prototype,"headingLevelsShift",void 0);d([(0,p.state)()],n.prototype,"tocNode",void 0);(0,E.customElement)("ft-reader-topic-context")(n);})();
|
|
@@ -82,7 +82,7 @@ Also for action icons.`,c.colorGray200),contentGlobalSubtle:r.extend("--ftds-con
|
|
|
82
82
|
<li>${this.helperText}</li>
|
|
83
83
|
`)}
|
|
84
84
|
</ul>
|
|
85
|
-
`}resolveStatus(){return this.forceStatus?this.forceStatus:this.errorMessages.length?Ze.error:this.warningMessages.length?Ze.warning:Ze.default}processRules(n){return n.map(a=>a(this.value)).filter(a=>a!==!0).map(a=>a)}}return G([k()],e.prototype,"warningRules",void 0),G([k()],e.prototype,"errorRules",void 0),G([k()],e.prototype,"validateOn",void 0),G([k({type:Boolean})],e.prototype,"validateAtRender",void 0),G([k()],e.prototype,"label",void 0),G([k({type:Boolean})],e.prototype,"hideLabel",void 0),G([k()],e.prototype,"name",void 0),G([k({type:Boolean})],e.prototype,"disabled",void 0),G([k()],e.prototype,"helperText",void 0),G([k()],e.prototype,"forceStatus",void 0),G([k({reflect:!0})],e.prototype,"value",void 0),G([Z()],e.prototype,"errorMessages",void 0),G([Z()],e.prototype,"warningMessages",void 0),G([Z()],e.prototype,"status",void 0),G([Z()],e.prototype,"focused",void 0),G([Z()],e.prototype,"additionalWarningRules",void 0),G([Z()],e.prototype,"additionalErrorRules",void 0),e});var Kt=(t,e)=>{let o=t._$AN;if(o===void 0)return!1;for(let n of o)n._$AO?.(e,!1),Kt(n,e);return!0},Cr=t=>{let e,o;do{if((e=t._$AM)===void 0)break;o=e._$AN,o.delete(t),t=e}while(o?.size===0)},Ps=t=>{for(let e;e=t._$AM;t=e){let o=e._$AN;if(o===void 0)e._$AN=o=new Set;else if(o.has(t))break;o.add(t),jd(e)}};function Wd(t){this._$AN!==void 0?(Cr(this),this._$AM=t,Ps(this)):this._$AM=t}function Gd(t,e=!1,o=0){let n=this._$AH,a=this._$AN;if(a!==void 0&&a.size!==0)if(e)if(Array.isArray(n))for(let i=o;i<n.length;i++)Kt(n[i],!1),Cr(n[i]);else n!=null&&(Kt(n,!1),Cr(n));else Kt(this,t)}var jd=t=>{t.type==le.CHILD&&(t._$AP??=Gd,t._$AQ??=Wd)},wr=class extends Q{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,o,n){super._$AT(e,o,n),Ps(this),this.isConnected=e._$AU}_$AO(e,o=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),o&&(Kt(this,e),Cr(this))}setValue(e){if(Jn(this._$Ct))this._$Ct._$AI(e,this);else{let o=[...this._$Ct._$AH];o[this._$Ci]=e,this._$Ct._$AI(o,this,0)}}disconnected(){}reconnected(){}};var Ns;(function(t){t.sm="sm",t.md="md",t.lg="lg",t.xl="xl"})(Ns||(Ns={}));var Vd={sm:640,md:768,lg:1024,xl:1280},_n=class extends wr{constructor(e){super(e),this.size=0,this.onResize=()=>{let o=window.innerWidth;this.size!==o&&(this.size=o,this.lastArgs&&this.setValue(this.render(...this.lastArgs)))},this.size=window.innerWidth,window.addEventListener("resize",this.onResize)}disconnected(){window.removeEventListener("resize",this.onResize)}reconnected(){window.addEventListener("resize",this.onResize)}update(e,[o,n,a]){return this.lastArgs=[o,n,a],this.render(o,n,a)}render(e,o,n){let a=this.resolveThreshold(e),i=n??(()=>B);return this.size>a?o():i()}resolveThreshold(e){return typeof e=="number"?e:Vd[e]}},Eb=ae(_n);var Tn,Pn,Nn,Ln,Kd=navigator.vendor&&!!navigator.vendor.match(/apple/i)||((Nn=(Pn=(Tn=window.safari)===null||Tn===void 0?void 0:Tn.pushNotification)===null||Pn===void 0?void 0:Pn.toString())!==null&&Nn!==void 0?Nn:"")==="[object SafariRemoteNotification]",Zd="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;window.ftGlobals=(Ln=window.ftGlobals)!==null&&Ln!==void 0?Ln:{lit:Br,litDecorators:$r,litRepeat:Hr,litClassMap:zr,litStyleMap:Wr,litUnsafeHTML:Gr,wcUtils:{...eo,...Vr,...ao,...On,...io,...lo,...ho,...Jr,...Io,...An,...Is,...gn,..._o,...po,...Do,...vn,...Lo,...Rn,...ui,...qr,...Fo,...yo,...Uo,..._s,...pi,...$o,...pn,...Cn,...To,...No,...bn,...ro,isSafari:Kd,isTouchScreen:Zd,setVariable:tt}};var
|
|
85
|
+
`}resolveStatus(){return this.forceStatus?this.forceStatus:this.errorMessages.length?Ze.error:this.warningMessages.length?Ze.warning:Ze.default}processRules(n){return n.map(a=>a(this.value)).filter(a=>a!==!0).map(a=>a)}}return G([k()],e.prototype,"warningRules",void 0),G([k()],e.prototype,"errorRules",void 0),G([k()],e.prototype,"validateOn",void 0),G([k({type:Boolean})],e.prototype,"validateAtRender",void 0),G([k()],e.prototype,"label",void 0),G([k({type:Boolean})],e.prototype,"hideLabel",void 0),G([k()],e.prototype,"name",void 0),G([k({type:Boolean})],e.prototype,"disabled",void 0),G([k()],e.prototype,"helperText",void 0),G([k()],e.prototype,"forceStatus",void 0),G([k({reflect:!0})],e.prototype,"value",void 0),G([Z()],e.prototype,"errorMessages",void 0),G([Z()],e.prototype,"warningMessages",void 0),G([Z()],e.prototype,"status",void 0),G([Z()],e.prototype,"focused",void 0),G([Z()],e.prototype,"additionalWarningRules",void 0),G([Z()],e.prototype,"additionalErrorRules",void 0),e});var Kt=(t,e)=>{let o=t._$AN;if(o===void 0)return!1;for(let n of o)n._$AO?.(e,!1),Kt(n,e);return!0},Cr=t=>{let e,o;do{if((e=t._$AM)===void 0)break;o=e._$AN,o.delete(t),t=e}while(o?.size===0)},Ps=t=>{for(let e;e=t._$AM;t=e){let o=e._$AN;if(o===void 0)e._$AN=o=new Set;else if(o.has(t))break;o.add(t),jd(e)}};function Wd(t){this._$AN!==void 0?(Cr(this),this._$AM=t,Ps(this)):this._$AM=t}function Gd(t,e=!1,o=0){let n=this._$AH,a=this._$AN;if(a!==void 0&&a.size!==0)if(e)if(Array.isArray(n))for(let i=o;i<n.length;i++)Kt(n[i],!1),Cr(n[i]);else n!=null&&(Kt(n,!1),Cr(n));else Kt(this,t)}var jd=t=>{t.type==le.CHILD&&(t._$AP??=Gd,t._$AQ??=Wd)},wr=class extends Q{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,o,n){super._$AT(e,o,n),Ps(this),this.isConnected=e._$AU}_$AO(e,o=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),o&&(Kt(this,e),Cr(this))}setValue(e){if(Jn(this._$Ct))this._$Ct._$AI(e,this);else{let o=[...this._$Ct._$AH];o[this._$Ci]=e,this._$Ct._$AI(o,this,0)}}disconnected(){}reconnected(){}};var Ns;(function(t){t.sm="sm",t.md="md",t.lg="lg",t.xl="xl"})(Ns||(Ns={}));var Vd={sm:640,md:768,lg:1024,xl:1280},_n=class extends wr{constructor(e){super(e),this.size=0,this.onResize=()=>{let o=window.innerWidth;this.size!==o&&(this.size=o,this.lastArgs&&this.setValue(this.render(...this.lastArgs)))},this.size=window.innerWidth,window.addEventListener("resize",this.onResize)}disconnected(){window.removeEventListener("resize",this.onResize)}reconnected(){window.addEventListener("resize",this.onResize)}update(e,[o,n,a]){return this.lastArgs=[o,n,a],this.render(o,n,a)}render(e,o,n){let a=this.resolveThreshold(e),i=n??(()=>B);return this.size>a?o():i()}resolveThreshold(e){return typeof e=="number"?e:Vd[e]}},Eb=ae(_n);var Tn,Pn,Nn,Ln,Kd=navigator.vendor&&!!navigator.vendor.match(/apple/i)||((Nn=(Pn=(Tn=window.safari)===null||Tn===void 0?void 0:Tn.pushNotification)===null||Pn===void 0?void 0:Pn.toString())!==null&&Nn!==void 0?Nn:"")==="[object SafariRemoteNotification]",Zd="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;window.ftGlobals=(Ln=window.ftGlobals)!==null&&Ln!==void 0?Ln:{lit:Br,litDecorators:$r,litRepeat:Hr,litClassMap:zr,litStyleMap:Wr,litUnsafeHTML:Gr,wcUtils:{...eo,...Vr,...ao,...On,...io,...lo,...ho,...Jr,...Io,...An,...Is,...gn,..._o,...po,...Do,...vn,...Lo,...Rn,...ui,...qr,...Fo,...yo,...Uo,..._s,...pi,...$o,...pn,...Cn,...To,...No,...bn,...ro,isSafari:Kd,isTouchScreen:Zd,setVariable:tt}};var Ls=H`
|
|
86
86
|
`;var ks;(function(t){t.clusteringHelperCreated="clustering-helper-created",t.mapAttachmentsUpdate="map-attachments-update",t.visibleTopicChange="visible-topic-change"})(ks||(ks={}));var Ds;(function(t){t.FEEDBACK="FEEDBACK",t.RATING="RATING",t.PRINT="PRINT",t.BOOKMARK="BOOKMARK",t.COLLECTIONS="COLLECTIONS",t.PERSONAL_BOOKS="PERSONAL_BOOKS"})(Ds||(Ds={}));var qd=function(t,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(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[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},Dn=class extends Event{constructor(){super("register-ft-reader-component",{bubbles:!0,composed:!0})}},kn=Symbol("registerInterval"),Yd=K(Symbol("toFtReaderComponent"),function(t){var e;class o extends t{constructor(){super(...arguments),this[e]=0}setReaderStateManager(a){this.clearStateManager(),this.stateManager=a,this.addStore(a.store,"reader")}clearStateManager(){this.stateManager&&(this.removeStore("reader"),this.stateManager=void 0)}get service(){var a;return(a=this.stateManager)===null||a===void 0?void 0:a.service}connectedCallback(){super.connectedCallback(),this[kn]=window.setInterval(()=>this.tryToRegisterToContext(),50)}tryToRegisterToContext(){this.stateManager!=null?window.clearInterval(this[kn]):this.dispatchEvent(new Dn)}disconnectedCallback(){super.disconnectedCallback(),this.clearStateManager()}}return e=kn,qd([Z()],o.prototype,"stateManager",void 0),o}),Ar=class extends Yd(Wt){};var qe=function(t,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(t,e,o,n);else for(var l=t.length-1;l>=0;l--)(s=t[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},oe=class extends Ar{constructor(){super(...arguments),this.disableContextInteractions=!1,this.headingLevelsShift=0,this.registeredComponents=[]}render(){return be`
|
|
87
87
|
<article id=${this.tocId}>
|
|
88
88
|
<slot @register-ft-reader-topic-component=${this.registerComponent}></slot>
|
package/build/index.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { customElement } from "@fluid-topics/ft-wc-utils";
|
|
2
|
-
import { FtReaderTopicContext } from "./ft-reader-topic-context";
|
|
3
1
|
export * from "./ft-reader-topic-context.styles";
|
|
4
2
|
export * from "./ft-reader-topic-context.properties";
|
|
5
3
|
export * from "./ft-reader-topic-context";
|
|
6
|
-
customElement("ft-reader-topic-context")(FtReaderTopicContext);
|
package/package.json
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
2
|
+
"name": "@fluid-topics/ft-reader-topic-context",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "Context block for integrated reader topic components.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"Lit"
|
|
7
|
+
],
|
|
8
|
+
"author": "Fluid Topics <devtopics@antidot.net>",
|
|
9
|
+
"license": "ISC",
|
|
10
|
+
"main": "build/index.js",
|
|
11
|
+
"web": "build/ft-reader-topic-context.min.js",
|
|
12
|
+
"typings": "build/index",
|
|
13
|
+
"files": [
|
|
14
|
+
"build/**/*.js",
|
|
15
|
+
"build/**/*.ts"
|
|
16
|
+
],
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@fluid-topics/ft-wc-utils": "2.0.0",
|
|
23
|
+
"lit": "3.1.0"
|
|
24
|
+
},
|
|
25
|
+
"gitHead": "139801842483cdd25e6c0d850431dfb2b930f394"
|
|
26
26
|
}
|