diff --git a/dist/alpheios-embedded.js b/dist/alpheios-embedded.js index e892ba1..560fa4e 100644 --- a/dist/alpheios-embedded.js +++ b/dist/alpheios-embedded.js @@ -169,7 +169,7 @@ class State { \***********************/ /***/ ((module) => { -module.exports = JSON.parse('{"name":"alpheios-embedded","version":"3.3.1","description":"Alpheios Embedded Library","main":"dist/alpheios-embedded.js","directories":{"doc":"doc"},"scripts":{"set-node-build-deps":"npx install-peerdeps alpheios-node-build --dev --only-peers","test":"jest","build":"npm run build-dev && npm run build-prod","build-prod":"npm run lint && node --experimental-modules ./node_modules/alpheios-node-build/dist/build.mjs -m all -M production -p app -c config.mjs","build-dev":"npm run lint && node --experimental-modules ./node_modules/alpheios-node-build/dist/build.mjs -m all -M development -p app -c config.mjs","auth0-env-update":"node --experimental-modules ./node_modules/alpheios-node-build/dist/files.mjs replace --s=../protected-config/auth0/prod --t=dist/auth0 --f=env-embed.js","auth0-env-dev-update":"node --experimental-modules ./node_modules/alpheios-node-build/dist/files.mjs replace --s=../protected-config/auth0/dev --t=dist/auth0 --f=env-embed.js","lint":"eslint --fix src/**/*.js","update-dependencies":"node --experimental-modules ./node_modules/alpheios-node-build/dist/files.mjs replace --s=./node_modules/alpheios-core/packages/components/dist/ --t=dist/lib && node --experimental-modules ./node_modules/alpheios-node-build/dist/files.mjs replace --s=./node_modules/alpheios-core/packages/components/dist/style --t=dist/style","build-experimental":"node --experimental-modules ./node_modules/alpheios-node-build/dist/build.mjs -m webpack -M development -p app -c config.mjs","dev":"npm run build-experimental && http-server -c-1 -p 8888 & onchange src -- npm run build-experimental","conventional-commit":"npx git-cz","version-set-major":"npm version major","version-set-minor":"npm version minor","version-set-patch":"npm version patch","tagged-commit":"node --experimental-modules --experimental-json-modules ./tagged-commit.mjs","github-build":"node --experimental-modules --experimental-json-modules ./github-build.mjs"},"repository":{"type":"git","url":"git+https://github.com/alpheios-project/wordsvc.git"},"author":"The Alpheios Project, Ltd.","license":"ISC","bugs":{"url":"https://github.com/alpheios-project/wordsvc/issues"},"homepage":"https://github.com/alpheios-project/wordsvc#readme","devDependencies":{"@actions/core":"^1.2.6","@babel/core":"^7.13.10","@babel/plugin-proposal-object-rest-spread":"^7.13.8","@babel/plugin-transform-modules-commonjs":"^7.13.8","@babel/plugin-transform-runtime":"^7.13.10","@babel/preset-env":"^7.13.12","@babel/register":"^7.13.8","@babel/runtime":"^7.13.10","alpheios-core":"git+https://github.com/alpheios-project/alpheios-core.git#incr-3.3.x","alpheios-node-build":"github:alpheios-project/node-build#v4","archiver":"^4.0.2","babel-eslint":"^10.1.0","babel-loader":"^8.2.2","babel-plugin-dynamic-import-node":"^2.3.3","babel-plugin-module-resolver":"^4.1.0","chalk":"^4.1.0","command-line-args":"^5.1.1","copy-webpack-plugin":"^6.4.1","coveralls":"^3.0.11","css-loader":"^5.2.0","cz-conventional-changelog":"^3.3.0","eslint":"^7.22.0","eslint-config-standard":"^16.0.2","eslint-plugin-import":"^2.22.1","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^4.3.1","eslint-plugin-standard":"^4.1.0","eslint-plugin-vue":"^7.8.0","fibers":"^5.0.0","fs-extra":"^9.1.0","git-branch":"^2.0.1","http-server":"^0.12.3","imagemin":"^7.0.1","imagemin-jpegtran":"^7.0.0","imagemin-optipng":"^8.0.0","imagemin-svgo":"^8.0.0","inspectpack":"^4.7.1","interactjs":"^1.10.8","jest":"^26.6.3","jest-fetch-mock":"^3.0.3","mini-css-extract-plugin":"^1.3.9","onchange":"^7.1.0","optimize-css-assets-webpack-plugin":"^5.0.4","path":"^0.12.7","postcss-import":"^13.0.0","postcss-loader":"^4.2.0","postcss-safe-important":"^1.2.1","postcss-scss":"^3.0.5","raw-loader":"^4.0.2","sass":"^1.32.8","sass-loader":"^10.1.1","shx":"^0.3.3","source-map-loader":"^1.1.3","style-loader":"^2.0.0","url-loader":"^4.1.1","vue-loader":"^15.9.6","vue-style-loader":"^4.1.3","vue-svg-loader":"^0.16.0","vue-template-compiler":"^2.6.12","vue-template-loader":"^1.1.0","webpack":"^5.28.0","webpack-bundle-analyzer":"^4.4.0","webpack-cleanup-plugin":"^0.5.1","webpack-dev-server":"^3.11.2","webpack-merge":"^5.7.3"},"engines":{"node":">= 14.1.0","npm":">= 6.13.0"},"jest":{"verbose":true,"transform":{"^.+\\\\.jsx?$":"babel-jest"},"transformIgnorePatterns":["node_modules/alpheios-core/packages/components/"]},"eslintConfig":{"env":{"browser":true,"node":true},"parser":"babel-eslint","parserOptions":{"sourceType":"module","ecmaVersion":2019,"allowImportExportEverywhere":true}},"eslintIgnore":["**/dist"],"dependencies":{},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}}}'); +module.exports = JSON.parse('{"name":"alpheios-embedded","version":"3.3.1-incr-3.3.x.20210326324","description":"Alpheios Embedded Library","main":"dist/alpheios-embedded.js","directories":{"doc":"doc"},"scripts":{"set-node-build-deps":"npx install-peerdeps alpheios-node-build --dev --only-peers","test":"jest","build":"npm run build-dev && npm run build-prod","build-prod":"npm run lint && node --experimental-modules ./node_modules/alpheios-node-build/dist/build.mjs -m all -M production -p app -c config.mjs","build-dev":"npm run lint && node --experimental-modules ./node_modules/alpheios-node-build/dist/build.mjs -m all -M development -p app -c config.mjs","auth0-env-update":"node --experimental-modules ./node_modules/alpheios-node-build/dist/files.mjs replace --s=../protected-config/auth0/prod --t=dist/auth0 --f=env-embed.js","auth0-env-dev-update":"node --experimental-modules ./node_modules/alpheios-node-build/dist/files.mjs replace --s=../protected-config/auth0/dev --t=dist/auth0 --f=env-embed.js","lint":"eslint --fix src/**/*.js","update-dependencies":"node --experimental-modules ./node_modules/alpheios-node-build/dist/files.mjs replace --s=./node_modules/alpheios-core/packages/components/dist/ --t=dist/lib && node --experimental-modules ./node_modules/alpheios-node-build/dist/files.mjs replace --s=./node_modules/alpheios-core/packages/components/dist/style --t=dist/style","build-experimental":"node --experimental-modules ./node_modules/alpheios-node-build/dist/build.mjs -m webpack -M development -p app -c config.mjs","dev":"npm run build-experimental && http-server -c-1 -p 8888 & onchange src -- npm run build-experimental","conventional-commit":"npx git-cz","version-set-major":"npm version major","version-set-minor":"npm version minor","version-set-patch":"npm version patch","tagged-commit":"node --experimental-modules --experimental-json-modules ./tagged-commit.mjs","github-build":"node --experimental-modules --experimental-json-modules ./github-build.mjs"},"repository":{"type":"git","url":"git+https://github.com/alpheios-project/wordsvc.git"},"author":"The Alpheios Project, Ltd.","license":"ISC","bugs":{"url":"https://github.com/alpheios-project/wordsvc/issues"},"homepage":"https://github.com/alpheios-project/wordsvc#readme","devDependencies":{"@actions/core":"^1.2.6","@babel/core":"^7.13.10","@babel/plugin-proposal-object-rest-spread":"^7.13.8","@babel/plugin-transform-modules-commonjs":"^7.13.8","@babel/plugin-transform-runtime":"^7.13.10","@babel/preset-env":"^7.13.12","@babel/register":"^7.13.8","@babel/runtime":"^7.13.10","alpheios-core":"git+https://github.com/alpheios-project/alpheios-core.git#incr-3.3.x","alpheios-node-build":"github:alpheios-project/node-build#v4","archiver":"^4.0.2","babel-eslint":"^10.1.0","babel-loader":"^8.2.2","babel-plugin-dynamic-import-node":"^2.3.3","babel-plugin-module-resolver":"^4.1.0","chalk":"^4.1.0","command-line-args":"^5.1.1","copy-webpack-plugin":"^6.4.1","coveralls":"^3.0.11","css-loader":"^5.2.0","cz-conventional-changelog":"^3.3.0","eslint":"^7.22.0","eslint-config-standard":"^16.0.2","eslint-plugin-import":"^2.22.1","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^4.3.1","eslint-plugin-standard":"^4.1.0","eslint-plugin-vue":"^7.8.0","fibers":"^5.0.0","fs-extra":"^9.1.0","git-branch":"^2.0.1","http-server":"^0.12.3","imagemin":"^7.0.1","imagemin-jpegtran":"^7.0.0","imagemin-optipng":"^8.0.0","imagemin-svgo":"^8.0.0","inspectpack":"^4.7.1","interactjs":"^1.10.8","jest":"^26.6.3","jest-fetch-mock":"^3.0.3","mini-css-extract-plugin":"^1.3.9","onchange":"^7.1.0","optimize-css-assets-webpack-plugin":"^5.0.4","path":"^0.12.7","postcss-import":"^13.0.0","postcss-loader":"^4.2.0","postcss-safe-important":"^1.2.1","postcss-scss":"^3.0.5","raw-loader":"^4.0.2","sass":"^1.32.8","sass-loader":"^10.1.1","shx":"^0.3.3","source-map-loader":"^1.1.3","style-loader":"^2.0.0","url-loader":"^4.1.1","vue-loader":"^15.9.6","vue-style-loader":"^4.1.3","vue-svg-loader":"^0.16.0","vue-template-compiler":"^2.6.12","vue-template-loader":"^1.1.0","webpack":"^5.28.0","webpack-bundle-analyzer":"^4.4.0","webpack-cleanup-plugin":"^0.5.1","webpack-dev-server":"^3.11.2","webpack-merge":"^5.7.3"},"engines":{"node":">= 14.1.0","npm":">= 6.13.0"},"jest":{"verbose":true,"transform":{"^.+\\\\.jsx?$":"babel-jest"},"transformIgnorePatterns":["node_modules/alpheios-core/packages/components/"]},"eslintConfig":{"env":{"browser":true,"node":true},"parser":"babel-eslint","parserOptions":{"sourceType":"module","ecmaVersion":2019,"allowImportExportEverywhere":true}},"eslintIgnore":["**/dist"],"dependencies":{},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}}}'); /***/ }) @@ -406,7 +406,7 @@ class Embedded { textQuerySelector: this.enabledSelector, triggerPreCallback: this.triggerPreCallback, enableMouseMoveOverride: this.enableMouseMoveOverride, - app: { version:`${packageVersion}`, buildBranch: "incr-3.3.x", buildNumber: "20210326622", buildName: "incr-3.3.x.20210326622", name: packageDescription }, + app: { version:`${packageVersion}`, buildBranch: "incr-3.3.x", buildNumber: "20210326324", buildName: "incr-3.3.x.20210326324", name: packageDescription }, appType: components.Platform.appTypes.EMBEDDED_LIBRARY, clientId: this.clientId, // Disable text selection on mobile devices diff --git a/dist/alpheios-embedded.min.js b/dist/alpheios-embedded.min.js index 3147b5f..bc2f6e0 100644 --- a/dist/alpheios-embedded.min.js +++ b/dist/alpheios-embedded.min.js @@ -1 +1 @@ -(()=>{"use strict";var __webpack_modules___48=(e,t,s)=>{s.r(t),s.d(t,{Embedded:()=>Embedded,importDependencies:()=>importDependencies});class State{constructor(e){this.panelStatus=void 0,this.tab=void 0,this.watchers=new Map}static create(e){let t=new State;for(let s of Object.keys(e))t[s]=e[s];return t}static get defaults(){return{panelStatus:State.statuses.panel.OPEN}}static get statuses(){return{embedLib:{PENDING:Symbol.for("Alpheios_Status_Pending"),ACTIVE:Symbol.for("Alpheios_Status_Active"),DEACTIVATED:Symbol.for("Alpheios_Status_Deactivated"),DISABLED:Symbol.for("Alpheios_Status_Disabled")},panel:{OPEN:Symbol.for("Alpheios_Status_PanelOpen"),CLOSED:Symbol.for("Alpheios_Status_PanelClosed"),DEFAULT:Symbol.for("Alpheios_Status_PanelDefault")},tab:{DEFAULT:"default"}}}setWatcher(e,t){return this.watchers.set(e,t),this}setItem(e,t){return this[e]=t,this.watchers&&this.watchers.has(e)&&this.watchers.get(e)(e,this),this}isPanelOpen(){return this.panelStatus===State.statuses.panel.OPEN}isPanelClosed(){return this.panelStatus===State.statuses.panel.CLOSED}isPanelStateDefault(){return this.panelStatus===State.statuses.panel.DEFAULT}isPanelStateValid(){return this.panelStatus===State.statuses.panel.OPEN||this.panelStatus===State.statuses.panel.CLOSED}setPanelOpen(){return this.setItem("panelStatus",State.statuses.panel.OPEN),this}setPanelClosed(){return this.setItem("panelStatus",State.statuses.panel.CLOSED),this}changeTab(e){return this.setItem("tab",e),this}activateUI(){return this.setItem("uiActive",!0),this}isActive(){return this.status===State.statuses.embedLib.ACTIVE}isDeactivated(){return this.status===State.statuses.embedLib.DEACTIVATED}isDisabled(){return this.status===State.statuses.embedLib.DISABLED}isTabStateDefault(){return this.tab===State.statuses.tab.DEFAULT}uiIsActive(){return this.uiActive}activate(){return this.status=State.statuses.embedLib.ACTIVE,this}deactivate(){return this.status=State.statuses.embedLib.DEACTIVATED,this}disable(){return this.status=State.statuses.embedLib.DISABLED,this}}const i=JSON.parse('{"name":"alpheios-embedded","version":"3.3.1","description":"Alpheios Embedded Library","main":"dist/alpheios-embedded.js","directories":{"doc":"doc"},"scripts":{"set-node-build-deps":"npx install-peerdeps alpheios-node-build --dev --only-peers","test":"jest","build":"npm run build-dev && npm run build-prod","build-prod":"npm run lint && node --experimental-modules ./node_modules/alpheios-node-build/dist/build.mjs -m all -M production -p app -c config.mjs","build-dev":"npm run lint && node --experimental-modules ./node_modules/alpheios-node-build/dist/build.mjs -m all -M development -p app -c config.mjs","auth0-env-update":"node --experimental-modules ./node_modules/alpheios-node-build/dist/files.mjs replace --s=../protected-config/auth0/prod --t=dist/auth0 --f=env-embed.js","auth0-env-dev-update":"node --experimental-modules ./node_modules/alpheios-node-build/dist/files.mjs replace --s=../protected-config/auth0/dev --t=dist/auth0 --f=env-embed.js","lint":"eslint --fix src/**/*.js","update-dependencies":"node --experimental-modules ./node_modules/alpheios-node-build/dist/files.mjs replace --s=./node_modules/alpheios-core/packages/components/dist/ --t=dist/lib && node --experimental-modules ./node_modules/alpheios-node-build/dist/files.mjs replace --s=./node_modules/alpheios-core/packages/components/dist/style --t=dist/style","build-experimental":"node --experimental-modules ./node_modules/alpheios-node-build/dist/build.mjs -m webpack -M development -p app -c config.mjs","dev":"npm run build-experimental && http-server -c-1 -p 8888 & onchange src -- npm run build-experimental","conventional-commit":"npx git-cz","version-set-major":"npm version major","version-set-minor":"npm version minor","version-set-patch":"npm version patch","tagged-commit":"node --experimental-modules --experimental-json-modules ./tagged-commit.mjs","github-build":"node --experimental-modules --experimental-json-modules ./github-build.mjs"},"repository":{"type":"git","url":"git+https://github.com/alpheios-project/wordsvc.git"},"author":"The Alpheios Project, Ltd.","license":"ISC","bugs":{"url":"https://github.com/alpheios-project/wordsvc/issues"},"homepage":"https://github.com/alpheios-project/wordsvc#readme","devDependencies":{"@actions/core":"^1.2.6","@babel/core":"^7.13.10","@babel/plugin-proposal-object-rest-spread":"^7.13.8","@babel/plugin-transform-modules-commonjs":"^7.13.8","@babel/plugin-transform-runtime":"^7.13.10","@babel/preset-env":"^7.13.12","@babel/register":"^7.13.8","@babel/runtime":"^7.13.10","alpheios-core":"git+https://github.com/alpheios-project/alpheios-core.git#incr-3.3.x","alpheios-node-build":"github:alpheios-project/node-build#v4","archiver":"^4.0.2","babel-eslint":"^10.1.0","babel-loader":"^8.2.2","babel-plugin-dynamic-import-node":"^2.3.3","babel-plugin-module-resolver":"^4.1.0","chalk":"^4.1.0","command-line-args":"^5.1.1","copy-webpack-plugin":"^6.4.1","coveralls":"^3.0.11","css-loader":"^5.2.0","cz-conventional-changelog":"^3.3.0","eslint":"^7.22.0","eslint-config-standard":"^16.0.2","eslint-plugin-import":"^2.22.1","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^4.3.1","eslint-plugin-standard":"^4.1.0","eslint-plugin-vue":"^7.8.0","fibers":"^5.0.0","fs-extra":"^9.1.0","git-branch":"^2.0.1","http-server":"^0.12.3","imagemin":"^7.0.1","imagemin-jpegtran":"^7.0.0","imagemin-optipng":"^8.0.0","imagemin-svgo":"^8.0.0","inspectpack":"^4.7.1","interactjs":"^1.10.8","jest":"^26.6.3","jest-fetch-mock":"^3.0.3","mini-css-extract-plugin":"^1.3.9","onchange":"^7.1.0","optimize-css-assets-webpack-plugin":"^5.0.4","path":"^0.12.7","postcss-import":"^13.0.0","postcss-loader":"^4.2.0","postcss-safe-important":"^1.2.1","postcss-scss":"^3.0.5","raw-loader":"^4.0.2","sass":"^1.32.8","sass-loader":"^10.1.1","shx":"^0.3.3","source-map-loader":"^1.1.3","style-loader":"^2.0.0","url-loader":"^4.1.1","vue-loader":"^15.9.6","vue-style-loader":"^4.1.3","vue-svg-loader":"^0.16.0","vue-template-compiler":"^2.6.12","vue-template-loader":"^1.1.0","webpack":"^5.28.0","webpack-bundle-analyzer":"^4.4.0","webpack-cleanup-plugin":"^0.5.1","webpack-dev-server":"^3.11.2","webpack-merge":"^5.7.3"},"engines":{"node":">= 14.1.0","npm":">= 6.13.0"},"jest":{"verbose":true,"transform":{"^.+\\\\.jsx?$":"babel-jest"},"transformIgnorePatterns":["node_modules/alpheios-core/packages/components/"]},"eslintConfig":{"env":{"browser":true,"node":true},"parser":"babel-eslint","parserOptions":{"sourceType":"module","ecmaVersion":2019,"allowImportExportEverywhere":true}},"eslintIgnore":["**/dist"],"dependencies":{},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}}}'),{version:o,description:a}=i;let l;function importDependencies(e){let t={};switch(e.mode){case"production":t.components="./lib/alpheios-components.min.js";break;case"development":t.components="./lib/alpheios-components.js";break;case"custom":t=e.libs;break;case"cdn":default:t.components="https://cdn.jsdelivr.net/npm/alpheios-components@latest/dist/alpheios-components.min.js"}return new Promise(((e,s)=>{let i=[],o=import(t.components).then((()=>{l=window.AlpheiosComponents}));i.push(o),Promise.all(i).then((()=>{e(Embedded)})).catch((e=>{s(e)}))}))}class Embedded{constructor({clientId:e=null,authEnv:t=null,documentObject:s=document,enabledSelector:i=".alpheios-enabled",disabledSelector:n="",enabledClass:r="",disabledClass:p="",mobileTriggerEvent:d=null,desktopTriggerEvent:u=null,triggerPreCallback:c=(e=>!0),enableMouseMoveOverride:h=!1,popupInitialPos:m={},toolbarInitialPos:b={},actionPanelInitialPos:g={},layoutType:v="default",disableTextSelection:f=!1,textLangCode:S=null,overrideHelp:A=!1,simpleMode:E=!1,arethusaTbRefreshRetryCount:y=5,arethusaTbRefreshDelay:P=200}={}){if(this.clientId=e,null===this.clientId)throw new Error("Please identify the site.");this.doc=s,this.authEnv=t,this.state=new State,this.enabledSelector=i,this.disabledSelector=n,this.enabledClass=r,this.disabledClass=p,this.desktopTriggerEvent=u,this.mobileTriggerEvent=d,this.triggerPreCallback=c,this.enableMouseMoveOverride=h,this.simpleMode=E,this.state.setPanelClosed(),this.state.tab="info",this._platform=new l.Platform({appType:l.Platform.appTypes.EMBEDDED_LIBRARY}),this.app=l.AppController.create(this.state,{storageAdapter:l.LocalStorageArea,textQueryTriggerDesktop:this.desktopTriggerEvent,textQueryTriggerMobile:this.mobileTriggerEvent,textQuerySelector:this.enabledSelector,triggerPreCallback:this.triggerPreCallback,enableMouseMoveOverride:this.enableMouseMoveOverride,app:{version:`${o}`,buildBranch:"incr-3.3.x",buildNumber:"20210326622",buildName:"incr-3.3.x.20210326622",name:a},appType:l.Platform.appTypes.EMBEDDED_LIBRARY,clientId:this.clientId,disableTextSelection:f,textLangCode:S,overrideHelp:A,configServiceUrl:"https://config.alpheios.net/v1/config",arethusaTbRefreshRetryCount:y,arethusaTbRefreshDelay:P}),this.authEnv?t.CLIENT_ID?this.app.registerModule(l.AuthModule,{auth:new l.AppAuthenticator(t)}):t.LOGIN_URL&&this.app.registerModule(l.AuthModule,{auth:new l.SessionAuthenticator(t)}):this.app.registerModule(l.AuthModule,{auth:null});let w={};this.simpleMode&&(w.showNav=!1),this.app.registerModule(l.PanelModule,w);let j={};m&&Object.values(m).filter((e=>Boolean(e))).length>0&&(j.initialPos=m),this.simpleMode&&(j.showNav=!1),this.app.registerModule(l.PopupModule,j);let T={};g&&Object.values(g).filter((e=>Boolean(e))).length>0&&(T.initialPos=g),this.simpleMode?T.showNav=!1:T.showNav=!0;let M={};this.simpleMode&&(M.showNav=!1),"default"===v?(b&&Object.values(b).filter((e=>Boolean(e))).length>0&&(M.initialPos=b),this.app.registerModule(l.ToolbarModule,M),this.app.registerModule(l.ActionPanelModule,{showNav:T.showNav})):"readingTools"===v&&(this._platform.isDesktop?(b&&Object.values(b).filter((e=>Boolean(e))).length>0&&(M.initialPos=b),this.app.registerModule(l.ToolbarModule,M)):this._platform.isMobile&&this.app.registerModule(l.ActionPanelModule,{lookupResultsIn:"panel",initialPos:T.initialPos,showNav:T.showNav}))}get platform(){return this._platform}notifyExtension(){this.doc.body.dispatchEvent(new Event("Alpheios_Embedded_Response"))}async activate(){try{this.notifyExtension(),await this.app.activate(),this.doc.body.setAttribute("alpheios-embed-lib-status","active"),this.doc.body.addEventListener("Alpheios_Embedded_Check",(e=>{this.notifyExtension(e)})),this.app.setEmbedLibActive(!0)}catch(e){return void console.error(`Unexpected error activating Alpheios: ${e}`)}let e=this.enabledSelector;if(!e)throw new Error("Configuration must define selector");let t=this.doc.querySelectorAll(e);if(0===t.length&&console.warn(`Alpheios was activated for the page but not any content (no elements matching ${t}).`),this.enabledClass)for(let e of t)e.classList.add(this.enabledClass);if(this.disabledSelector){let e=this.doc.querySelectorAll(this.disabledSelector);for(let t of e)t.setAttribute("data-alpheios-ignore","all"),this.disabledClass&&t.classList.add(this.disabledClass)}new l.AlignmentSelector(this.doc,{}).activate();l.AppController.initAlignedTranslation(this.doc,".aligned-translation",{edges:{left:!0,right:!0,bottom:!1,top:!1},restrictSize:{min:{width:200}},restrictEdges:{outer:this.doc.body,endOnly:!0},inertia:!0},(e=>{e.target.style.width=`${e.rect.width}px`}));return this}openToolbar(){this.app.api.ui.openToolbar()}openActionPanel(){this._platform.isMobile&&this.app.api.ui.closePanel(),this.app.api.ui.openActionPanel()}closeActionPanel(){this.app.api.ui.closeActionPanel()}openActionPanelLookup(){this._platform.isMobile&&this.app.api.ui.closePanel(),this.app.api.ui.openActionPanel({showNav:!1})}openActionPanelToolbar(){this._platform.isMobile&&this.app.api.ui.closePanel(),this.app.api.ui.openActionPanel({showLookup:!1})}}},e={d:(t,s)=>{for(var i in s)e.o(s,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:s[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};__webpack_modules___48(0,t,e),window.AlpheiosEmbed=t})(); \ No newline at end of file +(()=>{"use strict";var __webpack_modules___48=(e,t,s)=>{s.r(t),s.d(t,{Embedded:()=>Embedded,importDependencies:()=>importDependencies});class State{constructor(e){this.panelStatus=void 0,this.tab=void 0,this.watchers=new Map}static create(e){let t=new State;for(let s of Object.keys(e))t[s]=e[s];return t}static get defaults(){return{panelStatus:State.statuses.panel.OPEN}}static get statuses(){return{embedLib:{PENDING:Symbol.for("Alpheios_Status_Pending"),ACTIVE:Symbol.for("Alpheios_Status_Active"),DEACTIVATED:Symbol.for("Alpheios_Status_Deactivated"),DISABLED:Symbol.for("Alpheios_Status_Disabled")},panel:{OPEN:Symbol.for("Alpheios_Status_PanelOpen"),CLOSED:Symbol.for("Alpheios_Status_PanelClosed"),DEFAULT:Symbol.for("Alpheios_Status_PanelDefault")},tab:{DEFAULT:"default"}}}setWatcher(e,t){return this.watchers.set(e,t),this}setItem(e,t){return this[e]=t,this.watchers&&this.watchers.has(e)&&this.watchers.get(e)(e,this),this}isPanelOpen(){return this.panelStatus===State.statuses.panel.OPEN}isPanelClosed(){return this.panelStatus===State.statuses.panel.CLOSED}isPanelStateDefault(){return this.panelStatus===State.statuses.panel.DEFAULT}isPanelStateValid(){return this.panelStatus===State.statuses.panel.OPEN||this.panelStatus===State.statuses.panel.CLOSED}setPanelOpen(){return this.setItem("panelStatus",State.statuses.panel.OPEN),this}setPanelClosed(){return this.setItem("panelStatus",State.statuses.panel.CLOSED),this}changeTab(e){return this.setItem("tab",e),this}activateUI(){return this.setItem("uiActive",!0),this}isActive(){return this.status===State.statuses.embedLib.ACTIVE}isDeactivated(){return this.status===State.statuses.embedLib.DEACTIVATED}isDisabled(){return this.status===State.statuses.embedLib.DISABLED}isTabStateDefault(){return this.tab===State.statuses.tab.DEFAULT}uiIsActive(){return this.uiActive}activate(){return this.status=State.statuses.embedLib.ACTIVE,this}deactivate(){return this.status=State.statuses.embedLib.DEACTIVATED,this}disable(){return this.status=State.statuses.embedLib.DISABLED,this}}const i=JSON.parse('{"name":"alpheios-embedded","version":"3.3.1-incr-3.3.x.20210326324","description":"Alpheios Embedded Library","main":"dist/alpheios-embedded.js","directories":{"doc":"doc"},"scripts":{"set-node-build-deps":"npx install-peerdeps alpheios-node-build --dev --only-peers","test":"jest","build":"npm run build-dev && npm run build-prod","build-prod":"npm run lint && node --experimental-modules ./node_modules/alpheios-node-build/dist/build.mjs -m all -M production -p app -c config.mjs","build-dev":"npm run lint && node --experimental-modules ./node_modules/alpheios-node-build/dist/build.mjs -m all -M development -p app -c config.mjs","auth0-env-update":"node --experimental-modules ./node_modules/alpheios-node-build/dist/files.mjs replace --s=../protected-config/auth0/prod --t=dist/auth0 --f=env-embed.js","auth0-env-dev-update":"node --experimental-modules ./node_modules/alpheios-node-build/dist/files.mjs replace --s=../protected-config/auth0/dev --t=dist/auth0 --f=env-embed.js","lint":"eslint --fix src/**/*.js","update-dependencies":"node --experimental-modules ./node_modules/alpheios-node-build/dist/files.mjs replace --s=./node_modules/alpheios-core/packages/components/dist/ --t=dist/lib && node --experimental-modules ./node_modules/alpheios-node-build/dist/files.mjs replace --s=./node_modules/alpheios-core/packages/components/dist/style --t=dist/style","build-experimental":"node --experimental-modules ./node_modules/alpheios-node-build/dist/build.mjs -m webpack -M development -p app -c config.mjs","dev":"npm run build-experimental && http-server -c-1 -p 8888 & onchange src -- npm run build-experimental","conventional-commit":"npx git-cz","version-set-major":"npm version major","version-set-minor":"npm version minor","version-set-patch":"npm version patch","tagged-commit":"node --experimental-modules --experimental-json-modules ./tagged-commit.mjs","github-build":"node --experimental-modules --experimental-json-modules ./github-build.mjs"},"repository":{"type":"git","url":"git+https://github.com/alpheios-project/wordsvc.git"},"author":"The Alpheios Project, Ltd.","license":"ISC","bugs":{"url":"https://github.com/alpheios-project/wordsvc/issues"},"homepage":"https://github.com/alpheios-project/wordsvc#readme","devDependencies":{"@actions/core":"^1.2.6","@babel/core":"^7.13.10","@babel/plugin-proposal-object-rest-spread":"^7.13.8","@babel/plugin-transform-modules-commonjs":"^7.13.8","@babel/plugin-transform-runtime":"^7.13.10","@babel/preset-env":"^7.13.12","@babel/register":"^7.13.8","@babel/runtime":"^7.13.10","alpheios-core":"git+https://github.com/alpheios-project/alpheios-core.git#incr-3.3.x","alpheios-node-build":"github:alpheios-project/node-build#v4","archiver":"^4.0.2","babel-eslint":"^10.1.0","babel-loader":"^8.2.2","babel-plugin-dynamic-import-node":"^2.3.3","babel-plugin-module-resolver":"^4.1.0","chalk":"^4.1.0","command-line-args":"^5.1.1","copy-webpack-plugin":"^6.4.1","coveralls":"^3.0.11","css-loader":"^5.2.0","cz-conventional-changelog":"^3.3.0","eslint":"^7.22.0","eslint-config-standard":"^16.0.2","eslint-plugin-import":"^2.22.1","eslint-plugin-node":"^11.1.0","eslint-plugin-promise":"^4.3.1","eslint-plugin-standard":"^4.1.0","eslint-plugin-vue":"^7.8.0","fibers":"^5.0.0","fs-extra":"^9.1.0","git-branch":"^2.0.1","http-server":"^0.12.3","imagemin":"^7.0.1","imagemin-jpegtran":"^7.0.0","imagemin-optipng":"^8.0.0","imagemin-svgo":"^8.0.0","inspectpack":"^4.7.1","interactjs":"^1.10.8","jest":"^26.6.3","jest-fetch-mock":"^3.0.3","mini-css-extract-plugin":"^1.3.9","onchange":"^7.1.0","optimize-css-assets-webpack-plugin":"^5.0.4","path":"^0.12.7","postcss-import":"^13.0.0","postcss-loader":"^4.2.0","postcss-safe-important":"^1.2.1","postcss-scss":"^3.0.5","raw-loader":"^4.0.2","sass":"^1.32.8","sass-loader":"^10.1.1","shx":"^0.3.3","source-map-loader":"^1.1.3","style-loader":"^2.0.0","url-loader":"^4.1.1","vue-loader":"^15.9.6","vue-style-loader":"^4.1.3","vue-svg-loader":"^0.16.0","vue-template-compiler":"^2.6.12","vue-template-loader":"^1.1.0","webpack":"^5.28.0","webpack-bundle-analyzer":"^4.4.0","webpack-cleanup-plugin":"^0.5.1","webpack-dev-server":"^3.11.2","webpack-merge":"^5.7.3"},"engines":{"node":">= 14.1.0","npm":">= 6.13.0"},"jest":{"verbose":true,"transform":{"^.+\\\\.jsx?$":"babel-jest"},"transformIgnorePatterns":["node_modules/alpheios-core/packages/components/"]},"eslintConfig":{"env":{"browser":true,"node":true},"parser":"babel-eslint","parserOptions":{"sourceType":"module","ecmaVersion":2019,"allowImportExportEverywhere":true}},"eslintIgnore":["**/dist"],"dependencies":{},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}}}'),{version:o,description:a}=i;let l;function importDependencies(e){let t={};switch(e.mode){case"production":t.components="./lib/alpheios-components.min.js";break;case"development":t.components="./lib/alpheios-components.js";break;case"custom":t=e.libs;break;case"cdn":default:t.components="https://cdn.jsdelivr.net/npm/alpheios-components@latest/dist/alpheios-components.min.js"}return new Promise(((e,s)=>{let i=[],o=import(t.components).then((()=>{l=window.AlpheiosComponents}));i.push(o),Promise.all(i).then((()=>{e(Embedded)})).catch((e=>{s(e)}))}))}class Embedded{constructor({clientId:e=null,authEnv:t=null,documentObject:s=document,enabledSelector:i=".alpheios-enabled",disabledSelector:n="",enabledClass:r="",disabledClass:p="",mobileTriggerEvent:d=null,desktopTriggerEvent:u=null,triggerPreCallback:c=(e=>!0),enableMouseMoveOverride:h=!1,popupInitialPos:m={},toolbarInitialPos:b={},actionPanelInitialPos:g={},layoutType:v="default",disableTextSelection:f=!1,textLangCode:S=null,overrideHelp:A=!1,simpleMode:E=!1,arethusaTbRefreshRetryCount:y=5,arethusaTbRefreshDelay:P=200}={}){if(this.clientId=e,null===this.clientId)throw new Error("Please identify the site.");this.doc=s,this.authEnv=t,this.state=new State,this.enabledSelector=i,this.disabledSelector=n,this.enabledClass=r,this.disabledClass=p,this.desktopTriggerEvent=u,this.mobileTriggerEvent=d,this.triggerPreCallback=c,this.enableMouseMoveOverride=h,this.simpleMode=E,this.state.setPanelClosed(),this.state.tab="info",this._platform=new l.Platform({appType:l.Platform.appTypes.EMBEDDED_LIBRARY}),this.app=l.AppController.create(this.state,{storageAdapter:l.LocalStorageArea,textQueryTriggerDesktop:this.desktopTriggerEvent,textQueryTriggerMobile:this.mobileTriggerEvent,textQuerySelector:this.enabledSelector,triggerPreCallback:this.triggerPreCallback,enableMouseMoveOverride:this.enableMouseMoveOverride,app:{version:`${o}`,buildBranch:"incr-3.3.x",buildNumber:"20210326324",buildName:"incr-3.3.x.20210326324",name:a},appType:l.Platform.appTypes.EMBEDDED_LIBRARY,clientId:this.clientId,disableTextSelection:f,textLangCode:S,overrideHelp:A,configServiceUrl:"https://config.alpheios.net/v1/config",arethusaTbRefreshRetryCount:y,arethusaTbRefreshDelay:P}),this.authEnv?t.CLIENT_ID?this.app.registerModule(l.AuthModule,{auth:new l.AppAuthenticator(t)}):t.LOGIN_URL&&this.app.registerModule(l.AuthModule,{auth:new l.SessionAuthenticator(t)}):this.app.registerModule(l.AuthModule,{auth:null});let w={};this.simpleMode&&(w.showNav=!1),this.app.registerModule(l.PanelModule,w);let j={};m&&Object.values(m).filter((e=>Boolean(e))).length>0&&(j.initialPos=m),this.simpleMode&&(j.showNav=!1),this.app.registerModule(l.PopupModule,j);let T={};g&&Object.values(g).filter((e=>Boolean(e))).length>0&&(T.initialPos=g),this.simpleMode?T.showNav=!1:T.showNav=!0;let M={};this.simpleMode&&(M.showNav=!1),"default"===v?(b&&Object.values(b).filter((e=>Boolean(e))).length>0&&(M.initialPos=b),this.app.registerModule(l.ToolbarModule,M),this.app.registerModule(l.ActionPanelModule,{showNav:T.showNav})):"readingTools"===v&&(this._platform.isDesktop?(b&&Object.values(b).filter((e=>Boolean(e))).length>0&&(M.initialPos=b),this.app.registerModule(l.ToolbarModule,M)):this._platform.isMobile&&this.app.registerModule(l.ActionPanelModule,{lookupResultsIn:"panel",initialPos:T.initialPos,showNav:T.showNav}))}get platform(){return this._platform}notifyExtension(){this.doc.body.dispatchEvent(new Event("Alpheios_Embedded_Response"))}async activate(){try{this.notifyExtension(),await this.app.activate(),this.doc.body.setAttribute("alpheios-embed-lib-status","active"),this.doc.body.addEventListener("Alpheios_Embedded_Check",(e=>{this.notifyExtension(e)})),this.app.setEmbedLibActive(!0)}catch(e){return void console.error(`Unexpected error activating Alpheios: ${e}`)}let e=this.enabledSelector;if(!e)throw new Error("Configuration must define selector");let t=this.doc.querySelectorAll(e);if(0===t.length&&console.warn(`Alpheios was activated for the page but not any content (no elements matching ${t}).`),this.enabledClass)for(let e of t)e.classList.add(this.enabledClass);if(this.disabledSelector){let e=this.doc.querySelectorAll(this.disabledSelector);for(let t of e)t.setAttribute("data-alpheios-ignore","all"),this.disabledClass&&t.classList.add(this.disabledClass)}new l.AlignmentSelector(this.doc,{}).activate();l.AppController.initAlignedTranslation(this.doc,".aligned-translation",{edges:{left:!0,right:!0,bottom:!1,top:!1},restrictSize:{min:{width:200}},restrictEdges:{outer:this.doc.body,endOnly:!0},inertia:!0},(e=>{e.target.style.width=`${e.rect.width}px`}));return this}openToolbar(){this.app.api.ui.openToolbar()}openActionPanel(){this._platform.isMobile&&this.app.api.ui.closePanel(),this.app.api.ui.openActionPanel()}closeActionPanel(){this.app.api.ui.closeActionPanel()}openActionPanelLookup(){this._platform.isMobile&&this.app.api.ui.closePanel(),this.app.api.ui.openActionPanel({showNav:!1})}openActionPanelToolbar(){this._platform.isMobile&&this.app.api.ui.closePanel(),this.app.api.ui.openActionPanel({showLookup:!1})}}},e={d:(t,s)=>{for(var i in s)e.o(s,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:s[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};__webpack_modules___48(0,t,e),window.AlpheiosEmbed=t})(); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index d3136f2..04d12cd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "alpheios-embedded", - "version": "3.3.1", + "version": "3.3.1-incr-3.3.x.20210326324", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 9a4f08b..faed808 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "alpheios-embedded", - "version": "3.3.1", + "version": "3.3.1-incr-3.3.x.20210326324", "description": "Alpheios Embedded Library", "main": "dist/alpheios-embedded.js", "directories": {