From 84f1eb626d96848d17a2b56753ca8b4dd37e47a4 Mon Sep 17 00:00:00 2001 From: Bridget Almas Date: Thu, 18 Jun 2020 16:41:05 -0400 Subject: [PATCH] Build 20200618500 --- dist/alpheios-embedded.js | 2 +- dist/alpheios-embedded.min.js | 2 +- package-lock.json | 6 +++--- package.json | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/alpheios-embedded.js b/dist/alpheios-embedded.js index 5228e25..a7bdb43 100644 --- a/dist/alpheios-embedded.js +++ b/dist/alpheios-embedded.js @@ -94,7 +94,7 @@ window["AlpheiosEmbed"] = /*! exports provided: name, version, description, main, directories, scripts, repository, author, license, bugs, homepage, devDependencies, engines, jest, eslintConfig, eslintIgnore, dependencies, config, default */ /***/ (function(module) { -module.exports = JSON.parse("{\"name\":\"alpheios-embedded\",\"version\":\"3.3.0-20200609524\",\"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\"},\"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\":{\"@babel/core\":\"^7.10.2\",\"@babel/plugin-proposal-object-rest-spread\":\"^7.10.1\",\"@babel/plugin-transform-modules-commonjs\":\"^7.10.1\",\"@babel/plugin-transform-runtime\":\"^7.10.1\",\"@babel/preset-env\":\"^7.10.2\",\"@babel/register\":\"^7.10.1\",\"@babel/runtime\":\"^7.10.2\",\"alpheios-core\":\"git+https://github.com/alpheios-project/alpheios-core.git#production\",\"alpheios-node-build\":\"github:alpheios-project/node-build#semver:^3.2.0\",\"archiver\":\"^4.0.1\",\"babel-eslint\":\"^10.1.0\",\"babel-loader\":\"^8.1.0\",\"babel-plugin-dynamic-import-node\":\"^2.3.3\",\"babel-plugin-module-resolver\":\"^4.0.0\",\"chalk\":\"^4.1.0\",\"command-line-args\":\"^5.1.1\",\"copy-webpack-plugin\":\"^5.1.1\",\"coveralls\":\"^3.0.11\",\"css-loader\":\"^3.5.3\",\"cz-conventional-changelog\":\"^3.1.0\",\"eslint\":\"^7.2.0\",\"eslint-config-standard\":\"^14.1.1\",\"eslint-plugin-import\":\"^2.21.1\",\"eslint-plugin-node\":\"^11.1.0\",\"eslint-plugin-promise\":\"^4.2.1\",\"eslint-plugin-standard\":\"^4.0.1\",\"eslint-plugin-vue\":\"^6.2.2\",\"fibers\":\"^5.0.0\",\"fs-extra\":\"^9.0.1\",\"git-branch\":\"^2.0.1\",\"http-server\":\"^0.12.3\",\"imagemin\":\"^7.0.1\",\"imagemin-jpegtran\":\"^6.0.0\",\"imagemin-optipng\":\"^7.1.0\",\"imagemin-svgo\":\"^7.1.0\",\"inspectpack\":\"^4.5.2\",\"interactjs\":\"^1.9.19\",\"intl-messageformat\":\"^2.2.0\",\"jest\":\"^26.0.1\",\"jest-fetch-mock\":\"^3.0.3\",\"mini-css-extract-plugin\":\"^0.9.0\",\"onchange\":\"^6.1.0\",\"optimize-css-assets-webpack-plugin\":\"^5.0.3\",\"path\":\"^0.12.7\",\"postcss-import\":\"^12.0.1\",\"postcss-loader\":\"^3.0.0\",\"postcss-safe-important\":\"^1.2.0\",\"postcss-scss\":\"^2.1.1\",\"raw-loader\":\"^4.0.0\",\"sass\":\"^1.26.8\",\"sass-loader\":\"^8.0.2\",\"shx\":\"^0.3.2\",\"source-map-loader\":\"^0.2.4\",\"style-loader\":\"^1.1.3\",\"url-loader\":\"^4.1.0\",\"vue-loader\":\"^15.9.2\",\"vue-style-loader\":\"^4.1.2\",\"vue-svg-loader\":\"^0.16.0\",\"vue-template-compiler\":\"^2.6.11\",\"vue-template-loader\":\"^1.1.0\",\"webpack\":\"^4.43.0\",\"webpack-bundle-analyzer\":\"^3.8.0\",\"webpack-cleanup-plugin\":\"^0.5.1\",\"webpack-dev-server\":\"^3.11.0\",\"webpack-merge\":\"^4.2.2\"},\"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.0-20200618500\",\"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\"},\"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\":{\"@babel/core\":\"^7.10.2\",\"@babel/plugin-proposal-object-rest-spread\":\"^7.10.1\",\"@babel/plugin-transform-modules-commonjs\":\"^7.10.1\",\"@babel/plugin-transform-runtime\":\"^7.10.1\",\"@babel/preset-env\":\"^7.10.2\",\"@babel/register\":\"^7.10.1\",\"@babel/runtime\":\"^7.10.2\",\"alpheios-core\":\"git+https://github.com/alpheios-project/alpheios-core.git#production\",\"alpheios-node-build\":\"github:alpheios-project/node-build#semver:^3.2.0\",\"archiver\":\"^4.0.1\",\"babel-eslint\":\"^10.1.0\",\"babel-loader\":\"^8.1.0\",\"babel-plugin-dynamic-import-node\":\"^2.3.3\",\"babel-plugin-module-resolver\":\"^4.0.0\",\"chalk\":\"^4.1.0\",\"command-line-args\":\"^5.1.1\",\"copy-webpack-plugin\":\"^5.1.1\",\"coveralls\":\"^3.0.11\",\"css-loader\":\"^3.5.3\",\"cz-conventional-changelog\":\"^3.1.0\",\"eslint\":\"^7.2.0\",\"eslint-config-standard\":\"^14.1.1\",\"eslint-plugin-import\":\"^2.21.1\",\"eslint-plugin-node\":\"^11.1.0\",\"eslint-plugin-promise\":\"^4.2.1\",\"eslint-plugin-standard\":\"^4.0.1\",\"eslint-plugin-vue\":\"^6.2.2\",\"fibers\":\"^5.0.0\",\"fs-extra\":\"^9.0.1\",\"git-branch\":\"^2.0.1\",\"http-server\":\"^0.12.3\",\"imagemin\":\"^7.0.1\",\"imagemin-jpegtran\":\"^6.0.0\",\"imagemin-optipng\":\"^7.1.0\",\"imagemin-svgo\":\"^7.1.0\",\"inspectpack\":\"^4.5.2\",\"interactjs\":\"^1.9.19\",\"intl-messageformat\":\"^2.2.0\",\"jest\":\"^26.0.1\",\"jest-fetch-mock\":\"^3.0.3\",\"mini-css-extract-plugin\":\"^0.9.0\",\"onchange\":\"^6.1.0\",\"optimize-css-assets-webpack-plugin\":\"^5.0.3\",\"path\":\"^0.12.7\",\"postcss-import\":\"^12.0.1\",\"postcss-loader\":\"^3.0.0\",\"postcss-safe-important\":\"^1.2.0\",\"postcss-scss\":\"^2.1.1\",\"raw-loader\":\"^4.0.0\",\"sass\":\"^1.26.8\",\"sass-loader\":\"^8.0.2\",\"shx\":\"^0.3.2\",\"source-map-loader\":\"^0.2.4\",\"style-loader\":\"^1.1.3\",\"url-loader\":\"^4.1.0\",\"vue-loader\":\"^15.9.2\",\"vue-style-loader\":\"^4.1.2\",\"vue-svg-loader\":\"^0.16.0\",\"vue-template-compiler\":\"^2.6.11\",\"vue-template-loader\":\"^1.1.0\",\"webpack\":\"^4.43.0\",\"webpack-bundle-analyzer\":\"^3.8.0\",\"webpack-cleanup-plugin\":\"^0.5.1\",\"webpack-dev-server\":\"^3.11.0\",\"webpack-merge\":\"^4.2.2\"},\"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\"}}}"); /***/ }), diff --git a/dist/alpheios-embedded.min.js b/dist/alpheios-embedded.min.js index a7ed2ae..48c2a4b 100644 --- a/dist/alpheios-embedded.min.js +++ b/dist/alpheios-embedded.min.js @@ -1 +1 @@ -window.AlpheiosEmbed=function(e){var t={};function __webpack_require__(s){if(t[s])return t[s].exports;var i=t[s]={i:s,l:!1,exports:{}};return e[s].call(i.exports,i,i.exports,__webpack_require__),i.l=!0,i.exports}return __webpack_require__.m=e,__webpack_require__.c=t,__webpack_require__.d=function(e,t,s){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,t){if(1&t&&(e=__webpack_require__(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(__webpack_require__.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)__webpack_require__.d(s,i,function(t){return e[t]}.bind(null,i));return s},__webpack_require__.n=function(e){var t=e&&e.__esModule?function getDefault(){return e.default}:function getModuleExports(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=1)}([function(e){e.exports=JSON.parse('{"b":"3.3.0-20200609524","a":"Alpheios Embedded Library"}')},function(e,t,s){"use strict";s.r(t),s.d(t,"importDependencies",(function(){return importDependencies})),s.d(t,"Embedded",(function(){return embedded_Embedded}));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}}var i=s(0);let a;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(()=>{a=window.AlpheiosComponents});i.push(o),Promise.all(i).then(()=>{e(embedded_Embedded)}).catch(e=>{s(e)})})}class embedded_Embedded{constructor({clientId:e=null,authEnv:t=null,documentObject:s=document,enabledSelector:o=".alpheios-enabled",disabledSelector:r="",enabledClass:l="",disabledClass:n="",mobileTriggerEvent:u=null,desktopTriggerEvent:d=null,triggerPreCallback:h=(e=>!0),enableMouseMoveOverride:c=!1,popupInitialPos:p={},toolbarInitialPos:b={},actionPanelInitialPos:_={},layoutType:m="default",disableTextSelection:f=!1,textLangCode:S=null,overrideHelp:g=!1,simpleMode:v=!1,arethusaTbRefreshRetryCount:A=5,arethusaTbRefreshDelay:E=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=o,this.disabledSelector=r,this.enabledClass=l,this.disabledClass=n,this.desktopTriggerEvent=d,this.mobileTriggerEvent=u,this.triggerPreCallback=h,this.enableMouseMoveOverride=c,this.simpleMode=v,this.state.setPanelClosed(),this.state.tab="info",this.ui=a.UIController.create(this.state,{storageAdapter:a.LocalStorageArea,textQueryTriggerDesktop:this.desktopTriggerEvent,textQueryTriggerMobile:this.mobileTriggerEvent,textQuerySelector:this.enabledSelector,triggerPreCallback:this.triggerPreCallback,enableMouseMoveOverride:this.enableMouseMoveOverride,app:{version:""+i.b,buildBranch:"production",buildNumber:"20200618500",buildName:"20200618500",name:i.a},appType:a.Platform.appTypes.EMBEDDED_LIBRARY,clientId:this.clientId,disableTextSelection:f,textLangCode:S,overrideHelp:g,configServiceUrl:"https://config.alpheios.net/v1/config",arethusaTbRefreshRetryCount:A,arethusaTbRefreshDelay:E}),this.authEnv?t.CLIENT_ID?this.ui.registerModule(a.AuthModule,{auth:new a.AppAuthenticator(t)}):t.LOGIN_URL&&this.ui.registerModule(a.AuthModule,{auth:new a.SessionAuthenticator(t)}):this.ui.registerModule(a.AuthModule,{auth:null});let w={};this.simpleMode&&(w.showNav=!1),this.ui.registerModule(a.PanelModule,w);let P={};p&&Object.values(p).filter(e=>Boolean(e)).length>0&&(P.initialPos=p),this.simpleMode&&(P.showNav=!1),this.ui.registerModule(a.PopupModule,P);let y={};_&&Object.values(_).filter(e=>Boolean(e)).length>0&&(y.initialPos=_),this.simpleMode?y.showNav=!1:y.showNav=!0;let M={};this.simpleMode&&(M.showNav=!1),"default"===m?(b&&Object.values(b).filter(e=>Boolean(e)).length>0&&(M.initialPos=b),this.ui.registerModule(a.ToolbarModule,M),this.ui.registerModule(a.ActionPanelModule,{showNav:y.showNav})):"readingTools"===m&&(this.ui.platform.isDesktop?(b&&Object.values(b).filter(e=>Boolean(e)).length>0&&(M.initialPos=b),this.ui.registerModule(a.ToolbarModule,M)):this.ui.platform.isMobile&&this.ui.registerModule(a.ActionPanelModule,{lookupResultsIn:"panel",initialPos:y.initialPos,showNav:y.showNav}))}get platform(){return this.ui.platform}notifyExtension(){this.doc.body.dispatchEvent(new Event("Alpheios_Embedded_Response"))}async activate(){try{this.notifyExtension(),await this.ui.activate(),this.doc.body.setAttribute("alpheios-embed-lib-status","active"),this.doc.body.addEventListener("Alpheios_Embedded_Check",e=>{this.notifyExtension(e)}),this.ui.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 a.AlignmentSelector(this.doc,{}).activate();a.UIController.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.ui.openToolbar()}openActionPanel(){this.ui.platform.isMobile&&this.ui.closePanel(),this.ui.openActionPanel()}closeActionPanel(){this.ui.closeActionPanel()}openActionPanelLookup(){this.ui.platform.isMobile&&this.ui.closePanel(),this.ui.openActionPanel({showNav:!1})}openActionPanelToolbar(){this.ui.platform.isMobile&&this.ui.closePanel(),this.ui.openActionPanel({showLookup:!1})}}}]); \ No newline at end of file +window.AlpheiosEmbed=function(e){var t={};function __webpack_require__(s){if(t[s])return t[s].exports;var i=t[s]={i:s,l:!1,exports:{}};return e[s].call(i.exports,i,i.exports,__webpack_require__),i.l=!0,i.exports}return __webpack_require__.m=e,__webpack_require__.c=t,__webpack_require__.d=function(e,t,s){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,t){if(1&t&&(e=__webpack_require__(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(__webpack_require__.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)__webpack_require__.d(s,i,function(t){return e[t]}.bind(null,i));return s},__webpack_require__.n=function(e){var t=e&&e.__esModule?function getDefault(){return e.default}:function getModuleExports(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=1)}([function(e){e.exports=JSON.parse('{"b":"3.3.0-20200618500","a":"Alpheios Embedded Library"}')},function(e,t,s){"use strict";s.r(t),s.d(t,"importDependencies",(function(){return importDependencies})),s.d(t,"Embedded",(function(){return embedded_Embedded}));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}}var i=s(0);let a;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(()=>{a=window.AlpheiosComponents});i.push(o),Promise.all(i).then(()=>{e(embedded_Embedded)}).catch(e=>{s(e)})})}class embedded_Embedded{constructor({clientId:e=null,authEnv:t=null,documentObject:s=document,enabledSelector:o=".alpheios-enabled",disabledSelector:r="",enabledClass:l="",disabledClass:n="",mobileTriggerEvent:u=null,desktopTriggerEvent:d=null,triggerPreCallback:h=(e=>!0),enableMouseMoveOverride:c=!1,popupInitialPos:p={},toolbarInitialPos:b={},actionPanelInitialPos:_={},layoutType:m="default",disableTextSelection:f=!1,textLangCode:S=null,overrideHelp:g=!1,simpleMode:v=!1,arethusaTbRefreshRetryCount:A=5,arethusaTbRefreshDelay:E=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=o,this.disabledSelector=r,this.enabledClass=l,this.disabledClass=n,this.desktopTriggerEvent=d,this.mobileTriggerEvent=u,this.triggerPreCallback=h,this.enableMouseMoveOverride=c,this.simpleMode=v,this.state.setPanelClosed(),this.state.tab="info",this.ui=a.UIController.create(this.state,{storageAdapter:a.LocalStorageArea,textQueryTriggerDesktop:this.desktopTriggerEvent,textQueryTriggerMobile:this.mobileTriggerEvent,textQuerySelector:this.enabledSelector,triggerPreCallback:this.triggerPreCallback,enableMouseMoveOverride:this.enableMouseMoveOverride,app:{version:""+i.b,buildBranch:"production",buildNumber:"20200618500",buildName:"20200618500",name:i.a},appType:a.Platform.appTypes.EMBEDDED_LIBRARY,clientId:this.clientId,disableTextSelection:f,textLangCode:S,overrideHelp:g,configServiceUrl:"https://config.alpheios.net/v1/config",arethusaTbRefreshRetryCount:A,arethusaTbRefreshDelay:E}),this.authEnv?t.CLIENT_ID?this.ui.registerModule(a.AuthModule,{auth:new a.AppAuthenticator(t)}):t.LOGIN_URL&&this.ui.registerModule(a.AuthModule,{auth:new a.SessionAuthenticator(t)}):this.ui.registerModule(a.AuthModule,{auth:null});let w={};this.simpleMode&&(w.showNav=!1),this.ui.registerModule(a.PanelModule,w);let P={};p&&Object.values(p).filter(e=>Boolean(e)).length>0&&(P.initialPos=p),this.simpleMode&&(P.showNav=!1),this.ui.registerModule(a.PopupModule,P);let y={};_&&Object.values(_).filter(e=>Boolean(e)).length>0&&(y.initialPos=_),this.simpleMode?y.showNav=!1:y.showNav=!0;let M={};this.simpleMode&&(M.showNav=!1),"default"===m?(b&&Object.values(b).filter(e=>Boolean(e)).length>0&&(M.initialPos=b),this.ui.registerModule(a.ToolbarModule,M),this.ui.registerModule(a.ActionPanelModule,{showNav:y.showNav})):"readingTools"===m&&(this.ui.platform.isDesktop?(b&&Object.values(b).filter(e=>Boolean(e)).length>0&&(M.initialPos=b),this.ui.registerModule(a.ToolbarModule,M)):this.ui.platform.isMobile&&this.ui.registerModule(a.ActionPanelModule,{lookupResultsIn:"panel",initialPos:y.initialPos,showNav:y.showNav}))}get platform(){return this.ui.platform}notifyExtension(){this.doc.body.dispatchEvent(new Event("Alpheios_Embedded_Response"))}async activate(){try{this.notifyExtension(),await this.ui.activate(),this.doc.body.setAttribute("alpheios-embed-lib-status","active"),this.doc.body.addEventListener("Alpheios_Embedded_Check",e=>{this.notifyExtension(e)}),this.ui.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 a.AlignmentSelector(this.doc,{}).activate();a.UIController.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.ui.openToolbar()}openActionPanel(){this.ui.platform.isMobile&&this.ui.closePanel(),this.ui.openActionPanel()}closeActionPanel(){this.ui.closeActionPanel()}openActionPanelLookup(){this.ui.platform.isMobile&&this.ui.closePanel(),this.ui.openActionPanel({showNav:!1})}openActionPanelToolbar(){this.ui.platform.isMobile&&this.ui.closePanel(),this.ui.openActionPanel({showLookup:!1})}}}]); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index cfd0331..cc2e9c6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "alpheios-embedded", - "version": "3.3.0-qa.20200618500", + "version": "3.3.0-20200618500", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -3842,8 +3842,8 @@ "dev": true }, "alpheios-core": { - "version": "git+https://github.com/alpheios-project/alpheios-core.git#a8bc2bdd007977f546d088756470a31bcaa4fdb4", - "from": "git+https://github.com/alpheios-project/alpheios-core.git#qa", + "version": "git+https://github.com/alpheios-project/alpheios-core.git#3fb964664486823e3c581a9aa1b3effcd90c652f", + "from": "git+https://github.com/alpheios-project/alpheios-core.git#production", "dev": true }, "alpheios-node-build": { diff --git a/package.json b/package.json index 469e8a4..d54717e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "alpheios-embedded", - "version": "3.3.0-20200609524", + "version": "3.3.0-20200618500", "description": "Alpheios Embedded Library", "main": "dist/alpheios-embedded.js", "directories": {