graphdb-workbench 3.5.0-TR3 → 3.5.0-TR5
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/dist/{23654.28f7b5a1f2cbac46b505.bundle.js → 23654.2f4c56eca267fda60261.bundle.js} +2 -2
- package/dist/{23654.28f7b5a1f2cbac46b505.bundle.js.map → 23654.2f4c56eca267fda60261.bundle.js.map} +1 -1
- package/dist/40808.78f81786cadf334f8531.bundle.js +2 -0
- package/dist/40808.78f81786cadf334f8531.bundle.js.map +1 -0
- package/dist/43239.71707ff04a220130d250.bundle.js +2 -0
- package/dist/43239.71707ff04a220130d250.bundle.js.map +1 -0
- package/dist/44906.3d40209be900c399a67d.bundle.js +2 -0
- package/dist/44906.3d40209be900c399a67d.bundle.js.map +1 -0
- package/dist/{45501.b57c0da09b0c710a2ae4.bundle.js → 45501.9eb529ce40a22951f417.bundle.js} +2 -2
- package/dist/{45501.b57c0da09b0c710a2ae4.bundle.js.map → 45501.9eb529ce40a22951f417.bundle.js.map} +1 -1
- package/dist/54774.474357fa8720f682dad5.bundle.js +2 -0
- package/dist/54774.474357fa8720f682dad5.bundle.js.map +1 -0
- package/dist/{58328.b15114d6bec21972df60.bundle.js → 58328.ae47dca9b6fd21785b2d.bundle.js} +3 -3
- package/dist/{58328.b15114d6bec21972df60.bundle.js.map → 58328.ae47dca9b6fd21785b2d.bundle.js.map} +1 -1
- package/dist/{60447.675082fab71ca7e25db4.bundle.js → 60447.57a1b7f57a11d7eb7186.bundle.js} +2 -2
- package/dist/{60447.675082fab71ca7e25db4.bundle.js.map → 60447.57a1b7f57a11d7eb7186.bundle.js.map} +1 -1
- package/dist/{64709.c88c51016f076cbabc90.bundle.js → 64709.3c6ab6dd64342d260265.bundle.js} +2 -2
- package/dist/{64709.c88c51016f076cbabc90.bundle.js.map → 64709.3c6ab6dd64342d260265.bundle.js.map} +1 -1
- package/dist/{65677.17f5dcabfc485f1e12eb.bundle.js → 65677.3601a1447e8c705ebe9d.bundle.js} +2 -2
- package/dist/{65677.17f5dcabfc485f1e12eb.bundle.js.map → 65677.3601a1447e8c705ebe9d.bundle.js.map} +1 -1
- package/dist/{7257.44d40b3d795bb5b63224.bundle.js → 7257.a29aff1ae95e47e808e4.bundle.js} +2 -2
- package/dist/{7257.44d40b3d795bb5b63224.bundle.js.map → 7257.a29aff1ae95e47e808e4.bundle.js.map} +1 -1
- package/dist/{79146.2855e9b7348cd38dd4e0.bundle.js → 79146.69cc6c97fd6c137bd081.bundle.js} +2 -2
- package/dist/{79146.2855e9b7348cd38dd4e0.bundle.js.map → 79146.69cc6c97fd6c137bd081.bundle.js.map} +1 -1
- package/dist/80099.6e992ddb259c9c8dd389.bundle.js +2 -0
- package/dist/80099.6e992ddb259c9c8dd389.bundle.js.map +1 -0
- package/dist/{80933.f525c8a525c14438dd9c.bundle.js → 80933.11ccdbd4e85cb0b0da6e.bundle.js} +2 -2
- package/dist/{80933.f525c8a525c14438dd9c.bundle.js.map → 80933.11ccdbd4e85cb0b0da6e.bundle.js.map} +1 -1
- package/dist/{82917.b24600c57a3e4a08374e.bundle.js → 82917.0e44aebbb0f0b307a336.bundle.js} +2 -2
- package/dist/{82917.b24600c57a3e4a08374e.bundle.js.map → 82917.0e44aebbb0f0b307a336.bundle.js.map} +1 -1
- package/dist/{85064.b385fae12f19d1ccaeaa.bundle.js → 85064.86e04d3f61bf9f5c07fe.bundle.js} +2 -2
- package/dist/{85064.b385fae12f19d1ccaeaa.bundle.js.map → 85064.86e04d3f61bf9f5c07fe.bundle.js.map} +1 -1
- package/dist/{86099.7261b39d7cff80da2a41.bundle.js → 86099.bac9f4c14deeb019ec32.bundle.js} +2 -2
- package/dist/{86099.7261b39d7cff80da2a41.bundle.js.map → 86099.bac9f4c14deeb019ec32.bundle.js.map} +1 -1
- package/dist/96827.9c566428b7ccbd367b04.bundle.js +2 -0
- package/dist/96827.9c566428b7ccbd367b04.bundle.js.map +1 -0
- package/dist/assets/i18n/en.json +1 -2
- package/dist/assets/i18n/fr.json +1 -2
- package/dist/index.html +9 -9
- package/dist/js/angular/clustermanagement/templates/cluster-nodes-configuration.html +1 -1
- package/dist/js/angular/core/directives/autocomplete/templates/autocomplete.html +1 -1
- package/dist/js/angular/core/directives/dynamic-form/templates/dynamic-form.html +1 -1
- package/dist/js/angular/core/directives/operations-statuses-monitor/templates/operations-statuses-monitor.html +1 -1
- package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
- package/dist/js/angular/core/directives/shuttle-multiselect/templates/shuttle-multiselect.html +1 -1
- package/dist/js/angular/core/directives/yasgui-component/templates/yasgui-component.html +2 -2
- package/dist/js/angular/core/templates/cookie-policy/cookie-consent.html +1 -1
- package/dist/js/angular/core/templates/cookie-policy/cookie-policy.html +1 -1
- package/dist/js/angular/core/templates/editable-content/editable-content.html +1 -1
- package/dist/js/angular/core/templates/markdown-content/markdown-content.html +1 -1
- package/dist/js/angular/core/templates/search-resource-input.html +1 -1
- package/dist/js/angular/graphql/templates/create-graphql-endpoint.html +2 -2
- package/dist/js/angular/graphql/templates/graphql-endpoint-management.html +1 -1
- package/dist/js/angular/graphql/templates/graphql-playground.html +2 -2
- package/dist/js/angular/graphql/templates/modal/endpoint-configuration-modal.html +1 -1
- package/dist/js/angular/graphql/templates/modal/endpoint-generation-failure-result-modal.html +1 -1
- package/dist/js/angular/graphql/templates/modal/import-endpoint-definition-modal.html +1 -1
- package/dist/js/angular/security/templates/user.html +2 -2
- package/dist/js/angular/ttyg/templates/agent-list.html +1 -1
- package/dist/js/angular/ttyg/templates/agent-select-menu.html +1 -1
- package/dist/js/angular/ttyg/templates/chat-item-detail.html +1 -1
- package/dist/js/angular/ttyg/templates/chat-list.html +1 -1
- package/dist/js/angular/ttyg/templates/chat-panel.html +1 -1
- package/dist/js/angular/ttyg/templates/modal/agent-instructions-explain-modal.html +1 -1
- package/dist/js/angular/ttyg/templates/modal/agent-settings-modal.html +3 -3
- package/dist/js/angular/ttyg/templates/modal/external-integration-configuration-modal.html +1 -1
- package/dist/js/angular/ttyg/templates/no-agents-view.html +1 -1
- package/dist/js/angular/ttyg/templates/ttyg.html +1 -1
- package/dist/{legacyWorkbench.d59df54d7b195790cc81.js → legacyWorkbench.4afca6618ece256d15c7.js} +3 -3
- package/dist/{legacyWorkbench.d59df54d7b195790cc81.js.map → legacyWorkbench.4afca6618ece256d15c7.js.map} +1 -1
- package/dist/{main.c10b01e0b09d1bc233ba.js → main.aa40457f706547a8ab62.js} +3 -3
- package/dist/{main.c10b01e0b09d1bc233ba.js.map → main.aa40457f706547a8ab62.js.map} +1 -1
- package/dist/pages/aclmanagement.html +1 -1
- package/dist/pages/autocomplete.html +1 -1
- package/dist/pages/choose-repository-type.html +1 -1
- package/dist/pages/cluster-management/clusterInfo.html +3 -3
- package/dist/pages/create-index.html +1 -1
- package/dist/pages/dependencies.html +1 -1
- package/dist/pages/domainRangeInfo.html +2 -2
- package/dist/pages/edit.html +1 -1
- package/dist/pages/explore.html +1 -1
- package/dist/pages/export.html +1 -1
- package/dist/pages/find.html +1 -1
- package/dist/pages/graph-config/saveGraphConfig.html +8 -8
- package/dist/pages/graphs-visualizations.html +7 -7
- package/dist/pages/guides.html +1 -1
- package/dist/pages/home.html +1 -1
- package/dist/pages/import.html +2 -2
- package/dist/pages/jdbc-create.html +1 -1
- package/dist/pages/jdbc.html +1 -1
- package/dist/pages/monitor/backup-and-restore.html +1 -1
- package/dist/pages/monitor/queries.html +1 -1
- package/dist/pages/monitor/resources.html +1 -1
- package/dist/pages/namespaces.html +2 -2
- package/dist/pages/plugins.html +1 -1
- package/dist/pages/rdfClassHierarchyInfo.html +7 -7
- package/dist/pages/rdfrank.html +2 -2
- package/dist/pages/repositories.html +2 -2
- package/dist/pages/repository.html +1 -1
- package/dist/pages/similarity-indexes.html +1 -1
- package/dist/pages/sparql-editor.html +1 -1
- package/dist/pages/sparql-template-create.html +1 -1
- package/dist/pages/sparql-templates.html +1 -1
- package/dist/pages/ux-test1.html +2 -2
- package/dist/pages/webapi.html +2 -2
- package/dist/plugins.js +1 -1
- package/dist/res/swagger5/index.html +11 -11
- package/dist/shared-components/cjs/onto-deprecation-banner_5.cjs.entry.js +1 -1
- package/dist/shared-components/cjs/onto-dialog_2.cjs.entry.js +1 -1
- package/dist/shared-components/cjs/onto-dropdown.cjs.entry.js +1 -1
- package/dist/shared-components/cjs/onto-graph-explore-split-button.cjs.entry.js +1 -1
- package/dist/shared-components/cjs/onto-language-selector_9.cjs.entry.js +1 -1
- package/dist/shared-components/cjs/onto-layout.cjs.entry.js +1 -1
- package/dist/shared-components/cjs/onto-permission-banner.cjs.entry.js +1 -1
- package/dist/shared-components/cjs/onto-test-context.cjs.entry.js +1 -1
- package/dist/shared-components/cjs/onto-toastr.cjs.entry.js +1 -1
- package/dist/shared-components/cjs/onto-tooltip.cjs.entry.js +1 -1
- package/dist/shared-components/cjs/translate-label.cjs.entry.js +1 -1
- package/dist/shared-components/collection/components/onto-deprecation-banner/onto-deprecation-banner.css +1 -1
- package/dist/shared-components/collection/components/onto-deprecation-banner/onto-deprecation-banner.js +1 -1
- package/dist/shared-components/collection/components/onto-dropdown/onto-dropdown.js +1 -1
- package/dist/shared-components/collection/components/onto-footer/onto-footer.js +1 -1
- package/dist/shared-components/collection/components/onto-graph-explore-split-button/onto-graph-explore-split-button.js +1 -1
- package/dist/shared-components/collection/components/onto-header/onto-header.js +1 -1
- package/dist/shared-components/collection/components/onto-language-selector/onto-language-selector.js +1 -1
- package/dist/shared-components/collection/components/onto-layout/onto-layout.js +1 -1
- package/dist/shared-components/collection/components/onto-license-alert/onto-license-alert.js +1 -1
- package/dist/shared-components/collection/components/onto-loader/onto-loader.js +1 -1
- package/dist/shared-components/collection/components/onto-operations-notification/onto-operations-notification.js +1 -1
- package/dist/shared-components/collection/components/onto-permission-banner/onto-permission-banner.js +1 -1
- package/dist/shared-components/collection/components/onto-rdf-search/onto-rdf-search.js +1 -1
- package/dist/shared-components/collection/components/onto-repository-selector/onto-repository-selector.js +1 -1
- package/dist/shared-components/collection/components/onto-search-icon/onto-search-icon.js +1 -1
- package/dist/shared-components/collection/components/onto-search-resource-input/onto-search-resource-input.js +1 -1
- package/dist/shared-components/collection/components/onto-toastr/onto-toastr.js +1 -1
- package/dist/shared-components/collection/components/onto-toggle-switch/onto-toggle-switch.js +1 -1
- package/dist/shared-components/collection/components/onto-tooltip/onto-tooltip.js +1 -1
- package/dist/shared-components/collection/components/onto-user-login/onto-user-login.js +1 -1
- package/dist/shared-components/collection/components/onto-user-menu/onto-user-menu.js +1 -1
- package/dist/shared-components/collection/components/translate-label/translate-label.js +1 -1
- package/dist/shared-components/esm/onto-deprecation-banner_5.entry.js +1 -1
- package/dist/shared-components/esm/onto-dialog_2.entry.js +1 -1
- package/dist/shared-components/esm/onto-dropdown.entry.js +1 -1
- package/dist/shared-components/esm/onto-graph-explore-split-button.entry.js +1 -1
- package/dist/shared-components/esm/onto-language-selector_9.entry.js +1 -1
- package/dist/shared-components/esm/onto-layout.entry.js +1 -1
- package/dist/shared-components/esm/onto-permission-banner.entry.js +1 -1
- package/dist/shared-components/esm/onto-test-context.entry.js +1 -1
- package/dist/shared-components/esm/onto-toastr.entry.js +1 -1
- package/dist/shared-components/esm/onto-tooltip.entry.js +1 -1
- package/dist/shared-components/esm/translate-label.entry.js +1 -1
- package/dist/shared-components/shared-components/p-23d30101.entry.js +1 -0
- package/dist/shared-components/shared-components/{p-5a0c473d.entry.js → p-34ade607.entry.js} +1 -1
- package/dist/shared-components/shared-components/{p-20b1637d.entry.js → p-6541a02d.entry.js} +1 -1
- package/dist/shared-components/shared-components/{p-6ce0c1c9.entry.js → p-707656f3.entry.js} +1 -1
- package/dist/shared-components/shared-components/{p-fb9651cd.entry.js → p-7d074106.entry.js} +1 -1
- package/dist/shared-components/shared-components/p-86d0a2ee.entry.js +1 -0
- package/dist/shared-components/shared-components/p-8fb56abc.entry.js +1 -0
- package/dist/shared-components/shared-components/{p-ab06eb4f.entry.js → p-98e91ae6.entry.js} +1 -1
- package/dist/shared-components/shared-components/{p-eda1cb77.entry.js → p-9ba83beb.entry.js} +2 -2
- package/dist/shared-components/shared-components/p-9f2fb166.entry.js +1 -0
- package/dist/shared-components/shared-components/p-b46ea034.entry.js +1 -0
- package/dist/shared-components/shared-components/shared-components.esm.js +1 -1
- package/dist/shared-components/types/components/onto-footer/onto-footer.d.ts +1 -0
- package/dist/shared-components/types/components/translate-label/translate-label.d.ts +2 -2
- package/dist/shared-components/types/components.d.ts +4 -4
- package/package.json +1 -1
- package/dist/40808.39a22bb87bfc33dafad7.bundle.js +0 -2
- package/dist/40808.39a22bb87bfc33dafad7.bundle.js.map +0 -1
- package/dist/43239.1cd1b4be623593e3de58.bundle.js +0 -2
- package/dist/43239.1cd1b4be623593e3de58.bundle.js.map +0 -1
- package/dist/44906.add6bedebb53f0cc1aaa.bundle.js +0 -2
- package/dist/44906.add6bedebb53f0cc1aaa.bundle.js.map +0 -1
- package/dist/54774.f5bbd2466f8584d019ff.bundle.js +0 -2
- package/dist/54774.f5bbd2466f8584d019ff.bundle.js.map +0 -1
- package/dist/80099.a881e961bc3214bf8e18.bundle.js +0 -2
- package/dist/80099.a881e961bc3214bf8e18.bundle.js.map +0 -1
- package/dist/96827.775ca12817b0a81b610a.bundle.js +0 -2
- package/dist/96827.775ca12817b0a81b610a.bundle.js.map +0 -1
- package/dist/shared-components/shared-components/p-114ea8c4.entry.js +0 -1
- package/dist/shared-components/shared-components/p-79ea666b.entry.js +0 -1
- package/dist/shared-components/shared-components/p-7aea3f88.entry.js +0 -1
- package/dist/shared-components/shared-components/p-a0b19580.entry.js +0 -1
- package/dist/shared-components/shared-components/p-cec2c15d.entry.js +0 -1
- /package/dist/{58328.b15114d6bec21972df60.bundle.js.LICENSE.txt → 58328.ae47dca9b6fd21785b2d.bundle.js.LICENSE.txt} +0 -0
- /package/dist/{legacyWorkbench.d59df54d7b195790cc81.js.LICENSE.txt → legacyWorkbench.4afca6618ece256d15c7.js.LICENSE.txt} +0 -0
- /package/dist/{main.c10b01e0b09d1bc233ba.js.LICENSE.txt → main.aa40457f706547a8ab62.js.LICENSE.txt} +0 -0
- /package/dist/shared-components/shared-components/{p-eda1cb77.entry.js.LICENSE.txt → p-9ba83beb.entry.js.LICENSE.txt} +0 -0
package/dist/{79146.2855e9b7348cd38dd4e0.bundle.js.map → 79146.69cc6c97fd6c137bd081.bundle.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"79146.2855e9b7348cd38dd4e0.bundle.js","mappings":"yMAIA,MAEMA,EAAqB,CACvB,CAACC,EAAAA,UAAUC,MAAO,wBAClB,CAACD,EAAAA,UAAUE,SAAU,0BACrB,CAACF,EAAAA,UAAUG,SAAU,kBACrB,CAACH,EAAAA,UAAUI,OAAQ,iBAEjBC,EAAa,MACfC,WAAAA,CAAYC,IACRC,EAAAA,EAAAA,GAAiBC,KAAMF,GAIvBE,KAAKC,OAAS,IAAIC,EAAAA,iBAAiB,IAInCF,KAAKG,eAAiB,IAAIC,IAE1BJ,KAAKK,OAASC,EAAAA,aAAaC,mBAC3BP,KAAKQ,kBAAqBC,GAAU,KAChCT,KAAKU,kBAAkBD,IAE3BT,KAAKW,kBAAqBF,GAAU,KAChCT,KAAKY,mBAAmBH,GAEhC,CAQAI,iBAAAA,CAAkBC,GACdd,KAAKe,SAASD,EAAME,OACxB,CACAC,MAAAA,GACI,IAAIC,EACJ,OAAQC,EAAAA,EAAAA,GAAE,UAAW,CAAEC,IAAK,2CAA4CC,MAAO,CAAEC,QAAStB,KAAKC,OAAOsB,UAAY,OAAS,QAAUC,MAAO,yBAAyBxB,KAAKK,OAAOoB,YAAqC,QAAtBP,EAAKlB,KAAKC,cAAgC,IAAZiB,OAAqB,EAAIA,EAAGQ,WAAWC,IAAKlB,IACtQ,IAAIS,EAAIU,EAAIC,EACZ,OAAQV,EAAAA,EAAAA,GAAE,MAAO,CAAEK,MAAO,oBAAoBf,EAAMqB,OAAQV,IAA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C,KACjC5G,KAAKuE,4BAA4BqC,IAAc,IACvDD,QAAS5B,GAAaA,EAASE,SAASjF,KAAK0C,UAAUkE,EAAW7B,EAASC,eAE7F,CACAN,uBAAAA,GACI1E,KAAK6G,2BAA6B7G,KAAKoE,uBAAuB0C,wBAAyBlB,IAC/EA,IACA5F,KAAKyF,cAAgBG,EACrB5F,KAAKwG,8BAGjB,CACAO,OAAAA,GACQ/G,KAAK6G,4BACL7G,KAAK6G,4BAEb,EAEJ,MAAMpE,EAAqB,IAAI0B,C","sources":["webpack://root-config/./packages/shared-components/dist/esm/onto-toastr.entry.js","webpack://root-config/./packages/shared-components/dist/esm/translation.service-CyWR_ReZ.js"],"sourcesContent":["import { r as registerInstance, h } from './index-BntG-4Sv.js';\nimport { ToastMessageList, ToastrConfig, WindowService, ToastType } from '@ontotext/workbench-api';\nimport { s as sanitizeHTML, T as TranslationService } from './translation.service-CyWR_ReZ.js';\n\nconst ontoToastrCss = \".onto-toastr-container{position:fixed;z-index:9999999;pointer-events:auto;flex-direction:column}.onto-toastr-container.bottom-right{bottom:12px;right:12px}.onto-toastr-container.bottom-left{bottom:12px;left:12px}.onto-toastr-container .onto-toast{display:flex;align-items:center;border-radius:0;box-shadow:0 0 12px rgba(0, 0, 0, 0.3);position:relative;width:400px;padding:25px 0;color:white;margin-bottom:5px;overflow-wrap:break-word}.onto-toastr-container .onto-toast:hover{box-shadow:0 0 12px #000;opacity:1;cursor:pointer}.onto-toastr-container .onto-toast.warning{color:var(--gw-toast-warn-color);background-color:var(--gw-toast-warn-background);border-color:var(--gw-toast-warn-border-color)}.onto-toastr-container .onto-toast.success{background-color:var(--gw-toast-success-background);border-color:var(--gw-toast-success-border-color);color:var(--gw-toast-success-color)}.onto-toastr-container .onto-toast.error{background-color:var(--gw-toast-error-background);border-color:var(--gw-toast-error-border-color);color:var(--gw-toast-error-color)}.onto-toastr-container .onto-toast.info{background-color:var(--gw-toast-info-background);border-color:var(--gw-toast-info-border-color);color:var(--gw-toast-info-color)}.onto-toastr-container .onto-toast i{font-size:1.8rem;padding:0 20px;color:inherit}.onto-toastr-container .onto-toast i:hover{transform:none}.onto-toastr-container .onto-toast .toast-message{font-size:1.2rem;opacity:1;max-width:370px}\";\n\nconst toastTypeToIconMap = {\n [ToastType.INFO]: 'ri-information-2-fill',\n [ToastType.SUCCESS]: 'ri-checkbox-circle-line',\n [ToastType.WARNING]: 'ri-message-line',\n [ToastType.ERROR]: 'ri-alert-line',\n};\nconst OntoToastr = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n /**\n * State containing the list of active toast messages\n */\n this.toasts = new ToastMessageList([]);\n /**\n * Map to track timeout IDs for each toast message\n */\n this.toastToTimeout = new Map();\n /** Configuration options, such as toast timeout */\n this.config = ToastrConfig.getDefaultConfig();\n this.onToastMouseEnter = (toast) => () => {\n this.clearToastTimeout(toast);\n };\n this.onToastMouseLeave = (toast) => () => {\n this.setTimeoutForToast(toast);\n };\n }\n /**\n * Listen for toast creation events\n *\n * @param event - Custom event containing the toast message to be displayed\n */\n // TODO Fix jest tests are failing- usage variables in stencil decorators is enabled since 4.3.0\n // see https://github.com/stenciljs/core/issues/2924\n handleToastCreate(event) {\n this.addToast(event.detail);\n }\n render() {\n var _a;\n return (h(\"section\", { key: 'eb676f66aea307c84cc8b85cf026172e51c892fc', style: { display: this.toasts.isEmpty() ? 'none' : 'flex' }, class: `onto-toastr-container ${this.config.position}` }, (_a = this.toasts) === null || _a === void 0 ? void 0 : _a.getItems().map((toast) => {\n var _a, _b, _c;\n return (h(\"div\", { class: `onto-toast toast ${toast.type}`, key: toast.id, onMouseEnter: this.onToastMouseEnter(toast), onMouseLeave: this.onToastMouseLeave(toast), onClick: this.handleToastClick(toast), onKeyUp: this.handleKeyUp(toast) }, h(\"i\", { class: `${toastTypeToIconMap[toast.type]}` }), h(\"span\", null, ((_a = toast.config) === null || _a === void 0 ? void 0 : _a.title) ?\n h(\"div\", { class: \"toast-title\", innerHTML: sanitizeHTML(TranslationService.translate(toast.config.title, (_b = toast.config) === null || _b === void 0 ? void 0 : _b.translationParams)) }) : '', h(\"div\", { class: \"toast-message\", innerHTML: sanitizeHTML(TranslationService.translate(toast.message, (_c = toast.config) === null || _c === void 0 ? void 0 : _c.translationParams)) }))));\n })));\n }\n /**\n * Adds a new toast message.\n * The message is added to the start of the list, so new toasts appear on top.\n * The toast is also set to automatically be removed after the specified timeout.\n *\n * @param toast - The toast message to be added\n */\n addToast(toast) {\n this.toasts.addToStart(toast);\n this.setTimeoutForToast(toast);\n this.updateToastrReference();\n }\n /**\n * Sets a timeout for automatic removal of a toast message.\n * The value of the timeout is determined by the toast's configuration, or the default timeout, if\n * the toast hasn't provided a value\n *\n * @param toast - The toast message to set timeout for\n */\n setTimeoutForToast(toast) {\n var _a;\n const timeout = WindowService.getWindow().setTimeout(() => {\n this.toasts.remove(toast);\n this.clearToastTimeout(toast);\n }, ((_a = toast.config) === null || _a === void 0 ? void 0 : _a.timeout) || this.config.timeout);\n this.toastToTimeout.set(toast, timeout);\n }\n /**\n * Updates the toast list reference to trigger re-rendering\n */\n updateToastrReference() {\n this.toasts = new ToastMessageList(this.toasts.getItems());\n }\n /**\n * Clears the timeout for a toast message and removes it from the tracking map\n * When a user hovers over a toast message, the timeout is cleared, since the toast should\n * remain visible until the user stops hovering.\n *\n * @param toast - The toast message whose timeout should be cleared\n */\n clearToastTimeout(toast) {\n const timeoutId = this.toastToTimeout.get(toast);\n clearTimeout(timeoutId);\n this.toastToTimeout.delete(toast);\n this.updateToastrReference();\n }\n /**\n * Handle click events on toast messages.\n * Executes the configured onClick callback for the toast message, if provided.\n * Removes the toast message, if the removeOnClick configuration is enabled.\n *\n * @param toast - The clicked toast message\n * @returns An event handler function that processes click events on the toast\n */\n handleToastClick(toast) {\n return (event) => {\n var _a, _b;\n if ((_a = toast.config) === null || _a === void 0 ? void 0 : _a.onClick) {\n toast.config.onClick(event);\n }\n if ((_b = toast.config) === null || _b === void 0 ? void 0 : _b.removeOnClick) {\n this.toasts.remove(toast);\n this.clearToastTimeout(toast);\n }\n };\n }\n handleKeyUp(toast) {\n return (event) => {\n if (event.key === 'Enter') {\n this.handleToastClick(toast);\n }\n };\n }\n};\nOntoToastr.style = ontoToastrCss;\n\nexport { OntoToastr as onto_toastr };\n","import { Loggers, ServiceProvider, LanguageContextService } from '@ontotext/workbench-api';\n\nfunction sanitizeHTML(html) {\n const element = document.createElement('textarea');\n element.innerHTML = html;\n return element.value;\n}\n\nconst MODULE_NAME = 'SharedComponents';\n/**\n * Logger for the Shared Components module.\n */\nclass LoggerProvider {\n /**\n * Gets the logger instance for the Shared Components module.\n *\n * @returns LoggerService instance for the Shared Components module\n */\n static get logger() {\n return Loggers.getLoggerInstance(MODULE_NAME);\n }\n}\n\n/**\n * Service responsible for translation operations in the component.\n */\nclass TranslationServiceClassDefinition {\n constructor() {\n this.languageContextService = ServiceProvider.get(LanguageContextService);\n this.translationChangedObservers = {};\n this.logger = LoggerProvider.logger;\n // log with background color\n this.defaultBundle = this.languageContextService.getDefaultBundle();\n this.subscribeToBundleChange();\n }\n /**\n * Translates the <code>messageLabelKey</code> with <code>translationParameter</code> and call <code>translationCallback</code> with translation of current language.\n * The <code>translationCallback</code> is called upon subscription and whenever the selected language is changed.\n *\n * @param messageLabelKey - The label key for the translation.\n * @param translationParameter - Parameters, if needed, for translation.\n * @param translationCallback - A function to be called when translating the `messageLabelKey`.\n * @returns A function that, when called, unsubscribes the provided callback from further translation updates.\n */\n onTranslate(messageLabelKey, translationParameter = [], translationCallback = () => { }) {\n this.translationChangedObservers[messageLabelKey] = this.translationChangedObservers[messageLabelKey] || [];\n const observer = { parameters: translationParameter, callback: translationCallback };\n this.translationChangedObservers[messageLabelKey].push(observer);\n translationCallback(this.translate(messageLabelKey, translationParameter));\n return () => {\n const index = this.translationChangedObservers[messageLabelKey].indexOf(observer);\n if (index !== -1) {\n this.translationChangedObservers[messageLabelKey].splice(index, 1);\n }\n };\n }\n /**\n * Translates the provided key using the currently selected language by applying the parameters if\n * provided.\n * @param key The key for the label which needs to be translated.\n * @param parameters Optional parameters which to be applied during the translation.\n */\n translate(key, parameters) {\n return this.translateInLocale(key, parameters);\n }\n /**\n * Translates a given key into the specified locale. If parameters are provided,\n * they will be applied to the translation.\n *\n * @param key - The translation key, which can be dot-separated for nested translations.\n * @param parameters - Optional parameters to be substituted into the translation string.\n * @returns The translated string with parameters applied if available, or the key itself if not found.\n */\n translateInLocale(key, parameters) {\n // Attempt to retrieve the translation from the specified locale's bundle.\n let translation = this.translateFromBundle(this.currentBundle, key);\n // If not found, fall back to the default language bundle.\n if (!translation) {\n translation = this.translateFromBundle(this.defaultBundle, key);\n }\n // If translation was found, apply any parameters provided and return the result.\n if (translation) {\n translation = this.applyParameters(translation, parameters);\n return sanitizeHTML(translation);\n }\n this.logger.warn(`Missing translation for key: [${key}]`);\n return key;\n }\n /**\n * Retrieves a translation from a specified translation bundle using the given key.\n * If the key represents a nested JSON path, it attempts to resolve the key as such.\n *\n * @param bundle - The translation bundle for the specified locale.\n * @param key - The key to translate, which may be a simple key or dot-separated for nested keys.\n * @returns The translation string if found, or `undefined` if not available.\n */\n translateFromBundle(bundle, key) {\n if (!bundle) {\n return undefined;\n }\n // Try to retrieve the translation directly if it is defined as a whole string,\n // for instance as \"some_function.btn.label\".\n let translation = bundle[key];\n // If not found, attempt to retrieve the translation if it is defined as a JSON object.\n if (typeof translation !== 'string') {\n translation = this.translateAsJsonObject(bundle, key);\n }\n return translation;\n }\n /**\n * Resolves a nested translation key by treating it as a path in a JSON object.\n * For example, if the key is \"some.key.path\", this method will navigate through\n * the JSON object structure to retrieve the value at that path.\n *\n * @param bundle - The translation bundle containing nested keys.\n * @param key - The dot-separated key representing the path to the translation.\n * @returns The translation string if found, or `undefined` if the path does not exist.\n */\n translateAsJsonObject(bundle, key) {\n if (!key) {\n return;\n }\n let path = key.split('.');\n return this.getTranslation(bundle, path);\n }\n /**\n * Recursively navigates through a JSON object based on a path array to retrieve\n * a translation string. Each element in the path array represents a nested key.\n *\n * @param jsonObject - The current JSON object or nested object being searched.\n * @param path - An array representing the path to the translation, where each element is a key.\n * @returns The translation string if found, or `undefined` if the path does not exist.\n */\n getTranslation(jsonObject, path) {\n // Stop the recursion if path or reach the inner element\n if (!path || !jsonObject) {\n return undefined;\n }\n const jsonOrTranslation = jsonObject[path.splice(0, 1)[0]];\n if (path.length === 0) {\n return jsonOrTranslation;\n }\n if (typeof jsonOrTranslation !== 'string') {\n // continue if the inner element is not reached.\n if (path.length > 0) {\n return this.getTranslation(jsonOrTranslation, path);\n }\n return jsonOrTranslation;\n }\n return undefined;\n }\n applyParameters(translation, parameters) {\n if (parameters) {\n return parameters.reduce(\n // replace all occurrence of parameter key with parameter value.\n (translation, parameter) => TranslationServiceClassDefinition.replaceAll(translation, parameter), translation);\n }\n return translation;\n }\n static replaceAll(translation, parameter) {\n return parameter ? translation.split(`{{${parameter.key}}}`).join(parameter.value) : translation;\n }\n notifyTranslationsChanged() {\n Object.keys(this.translationChangedObservers).forEach((eventName) => {\n const observers = this.translationChangedObservers[eventName] || [];\n observers.forEach((observer) => observer.callback(this.translate(eventName, observer.parameters)));\n });\n }\n subscribeToBundleChange() {\n this.languageChangeSubscription = this.languageContextService.onLanguageBundleChanged((bundle) => {\n if (bundle) {\n this.currentBundle = bundle;\n this.notifyTranslationsChanged();\n }\n });\n }\n destroy() {\n if (this.languageChangeSubscription) {\n this.languageChangeSubscription();\n }\n }\n}\nconst TranslationService = new TranslationServiceClassDefinition();\n\nexport { LoggerProvider as L, TranslationService as T, sanitizeHTML as s };\n"],"names":["toastTypeToIconMap","ToastType","INFO","SUCCESS","WARNING","ERROR","OntoToastr","constructor","hostRef","registerInstance","this","toasts","ToastMessageList","toastToTimeout","Map","config","ToastrConfig","getDefaultConfig","onToastMouseEnter","toast","clearToastTimeout","onToastMouseLeave","setTimeoutForToast","handleToastCreate","event","addToast","detail","render","_a","h","key","style","display","isEmpty","class","position","getItems","map","_b","_c","type","id","onMouseEnter","onMouseLeave","onClick","handleToastClick","onKeyUp","handleKeyUp","title","innerHTML","sanitizeHTML","TranslationService","translate","translationParams","message","addToStart","updateToastrReference","timeout","WindowService","getWindow","setTimeout","remove","set","timeoutId","get","clearTimeout","delete","removeOnClick","html","element","document","createElement","value","LoggerProvider","logger","Loggers","getLoggerInstance","TranslationServiceClassDefinition","languageContextService","ServiceProvider","LanguageContextService","translationChangedObservers","defaultBundle","getDefaultBundle","subscribeToBundleChange","onTranslate","messageLabelKey","translationParameter","translationCallback","observer","parameters","callback","push","index","indexOf","splice","translateInLocale","translation","translateFromBundle","currentBundle","applyParameters","warn","bundle","translateAsJsonObject","path","split","getTranslation","jsonObject","jsonOrTranslation","length","reduce","parameter","replaceAll","join","notifyTranslationsChanged","Object","keys","forEach","eventName","languageChangeSubscription","onLanguageBundleChanged","destroy"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"79146.69cc6c97fd6c137bd081.bundle.js","mappings":"yMAIA,MAEMA,EAAqB,CACvB,CAACC,EAAAA,UAAUC,MAAO,wBAClB,CAACD,EAAAA,UAAUE,SAAU,0BACrB,CAACF,EAAAA,UAAUG,SAAU,kBACrB,CAACH,EAAAA,UAAUI,OAAQ,iBAEjBC,EAAa,MACfC,WAAAA,CAAYC,IACRC,EAAAA,EAAAA,GAAiBC,KAAMF,GAIvBE,KAAKC,OAAS,IAAIC,EAAAA,iBAAiB,IAInCF,KAAKG,eAAiB,IAAIC,IAE1BJ,KAAKK,OAASC,EAAAA,aAAaC,mBAC3BP,KAAKQ,kBAAqBC,GAAU,KAChCT,KAAKU,kBAAkBD,IAE3BT,KAAKW,kBAAqBF,GAAU,KAChCT,KAAKY,mBAAmBH,GAEhC,CAQAI,iBAAAA,CAAkBC,GACdd,KAAKe,SAASD,EAAME,OACxB,CACAC,MAAAA,GACI,IAAIC,EACJ,OAAQC,EAAAA,EAAAA,GAAE,UAAW,CAAEC,IAAK,2CAA4CC,MAAO,CAAEC,QAAStB,KAAKC,OAAOsB,UAAY,OAAS,Q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ACb,EAAac,IAAclC,EAAkCmC,WAAWf,EAAac,GAAYd,GAE/FA,CACX,CACA,iBAAOe,CAAWf,EAAac,GAC3B,OAAOA,EAAYd,EAAYQ,MAAM,KAAKM,EAAUjF,SAASmF,KAAKF,EAAUvC,OAASyB,CACzF,CACAiB,yBAAAA,GACIC,OAAOC,KAAK1G,KAAKuE,6BAA6BoC,QAASC,KACjC5G,KAAKuE,4BAA4BqC,IAAc,IACvDD,QAAS5B,GAAaA,EAASE,SAASjF,KAAK0C,UAAUkE,EAAW7B,EAASC,eAE7F,CACAN,uBAAAA,GACI1E,KAAK6G,2BAA6B7G,KAAKoE,uBAAuB0C,wBAAyBlB,IAC/EA,IACA5F,KAAKyF,cAAgBG,EACrB5F,KAAKwG,8BAGjB,CACAO,OAAAA,GACQ/G,KAAK6G,4BACL7G,KAAK6G,4BAEb,EAEJ,MAAMpE,EAAqB,IAAI0B,C","sources":["webpack://root-config/./packages/shared-components/dist/esm/onto-toastr.entry.js","webpack://root-config/./packages/shared-components/dist/esm/translation.service-CyWR_ReZ.js"],"sourcesContent":["import { r as registerInstance, h } from './index-BntG-4Sv.js';\nimport { ToastMessageList, ToastrConfig, WindowService, ToastType } from '@ontotext/workbench-api';\nimport { s as sanitizeHTML, T as TranslationService } from './translation.service-CyWR_ReZ.js';\n\nconst ontoToastrCss = \".onto-toastr-container{position:fixed;z-index:9999999;pointer-events:auto;flex-direction:column}.onto-toastr-container.bottom-right{bottom:12px;right:12px}.onto-toastr-container.bottom-left{bottom:12px;left:12px}.onto-toastr-container .onto-toast{display:flex;align-items:center;border-radius:0;box-shadow:0 0 12px rgba(0, 0, 0, 0.3);position:relative;width:400px;padding:25px 0;color:white;margin-bottom:5px;overflow-wrap:break-word}.onto-toastr-container .onto-toast:hover{box-shadow:0 0 12px #000;opacity:1;cursor:pointer}.onto-toastr-container .onto-toast.warning{color:var(--gw-toast-warn-color);background-color:var(--gw-toast-warn-background);border-color:var(--gw-toast-warn-border-color)}.onto-toastr-container .onto-toast.success{background-color:var(--gw-toast-success-background);border-color:var(--gw-toast-success-border-color);color:var(--gw-toast-success-color)}.onto-toastr-container .onto-toast.error{background-color:var(--gw-toast-error-background);border-color:var(--gw-toast-error-border-color);color:var(--gw-toast-error-color)}.onto-toastr-container .onto-toast.info{background-color:var(--gw-toast-info-background);border-color:var(--gw-toast-info-border-color);color:var(--gw-toast-info-color)}.onto-toastr-container .onto-toast i{font-size:1.8rem;padding:0 20px;color:inherit}.onto-toastr-container .onto-toast i:hover{transform:none}.onto-toastr-container .onto-toast .toast-message{font-size:1.2rem;opacity:1;max-width:370px}\";\n\nconst toastTypeToIconMap = {\n [ToastType.INFO]: 'ri-information-2-fill',\n [ToastType.SUCCESS]: 'ri-checkbox-circle-line',\n [ToastType.WARNING]: 'ri-message-line',\n [ToastType.ERROR]: 'ri-alert-line',\n};\nconst OntoToastr = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n /**\n * State containing the list of active toast messages\n */\n this.toasts = new ToastMessageList([]);\n /**\n * Map to track timeout IDs for each toast message\n */\n this.toastToTimeout = new Map();\n /** Configuration options, such as toast timeout */\n this.config = ToastrConfig.getDefaultConfig();\n this.onToastMouseEnter = (toast) => () => {\n this.clearToastTimeout(toast);\n };\n this.onToastMouseLeave = (toast) => () => {\n this.setTimeoutForToast(toast);\n };\n }\n /**\n * Listen for toast creation events\n *\n * @param event - Custom event containing the toast message to be displayed\n */\n // TODO Fix jest tests are failing- usage variables in stencil decorators is enabled since 4.3.0\n // see https://github.com/stenciljs/core/issues/2924\n handleToastCreate(event) {\n this.addToast(event.detail);\n }\n render() {\n var _a;\n return (h(\"section\", { key: '2f3737e15c27137b0d39ca4f158683f7412c31da', style: { display: this.toasts.isEmpty() ? 'none' : 'flex' }, class: `onto-toastr-container ${this.config.position}` }, (_a = this.toasts) === null || _a === void 0 ? void 0 : _a.getItems().map((toast) => {\n var _a, _b, _c;\n return (h(\"div\", { class: `onto-toast toast ${toast.type}`, key: toast.id, onMouseEnter: this.onToastMouseEnter(toast), onMouseLeave: this.onToastMouseLeave(toast), onClick: this.handleToastClick(toast), onKeyUp: this.handleKeyUp(toast) }, h(\"i\", { class: `${toastTypeToIconMap[toast.type]}` }), h(\"span\", null, ((_a = toast.config) === null || _a === void 0 ? void 0 : _a.title) ?\n h(\"div\", { class: \"toast-title\", innerHTML: sanitizeHTML(TranslationService.translate(toast.config.title, (_b = toast.config) === null || _b === void 0 ? void 0 : _b.translationParams)) }) : '', h(\"div\", { class: \"toast-message\", innerHTML: sanitizeHTML(TranslationService.translate(toast.message, (_c = toast.config) === null || _c === void 0 ? void 0 : _c.translationParams)) }))));\n })));\n }\n /**\n * Adds a new toast message.\n * The message is added to the start of the list, so new toasts appear on top.\n * The toast is also set to automatically be removed after the specified timeout.\n *\n * @param toast - The toast message to be added\n */\n addToast(toast) {\n this.toasts.addToStart(toast);\n this.setTimeoutForToast(toast);\n this.updateToastrReference();\n }\n /**\n * Sets a timeout for automatic removal of a toast message.\n * The value of the timeout is determined by the toast's configuration, or the default timeout, if\n * the toast hasn't provided a value\n *\n * @param toast - The toast message to set timeout for\n */\n setTimeoutForToast(toast) {\n var _a;\n const timeout = WindowService.getWindow().setTimeout(() => {\n this.toasts.remove(toast);\n this.clearToastTimeout(toast);\n }, ((_a = toast.config) === null || _a === void 0 ? void 0 : _a.timeout) || this.config.timeout);\n this.toastToTimeout.set(toast, timeout);\n }\n /**\n * Updates the toast list reference to trigger re-rendering\n */\n updateToastrReference() {\n this.toasts = new ToastMessageList(this.toasts.getItems());\n }\n /**\n * Clears the timeout for a toast message and removes it from the tracking map\n * When a user hovers over a toast message, the timeout is cleared, since the toast should\n * remain visible until the user stops hovering.\n *\n * @param toast - The toast message whose timeout should be cleared\n */\n clearToastTimeout(toast) {\n const timeoutId = this.toastToTimeout.get(toast);\n clearTimeout(timeoutId);\n this.toastToTimeout.delete(toast);\n this.updateToastrReference();\n }\n /**\n * Handle click events on toast messages.\n * Executes the configured onClick callback for the toast message, if provided.\n * Removes the toast message, if the removeOnClick configuration is enabled.\n *\n * @param toast - The clicked toast message\n * @returns An event handler function that processes click events on the toast\n */\n handleToastClick(toast) {\n return (event) => {\n var _a, _b;\n if ((_a = toast.config) === null || _a === void 0 ? void 0 : _a.onClick) {\n toast.config.onClick(event);\n }\n if ((_b = toast.config) === null || _b === void 0 ? void 0 : _b.removeOnClick) {\n this.toasts.remove(toast);\n this.clearToastTimeout(toast);\n }\n };\n }\n handleKeyUp(toast) {\n return (event) => {\n if (event.key === 'Enter') {\n this.handleToastClick(toast);\n }\n };\n }\n};\nOntoToastr.style = ontoToastrCss;\n\nexport { OntoToastr as onto_toastr };\n","import { Loggers, ServiceProvider, LanguageContextService } from '@ontotext/workbench-api';\n\nfunction sanitizeHTML(html) {\n const element = document.createElement('textarea');\n element.innerHTML = html;\n return element.value;\n}\n\nconst MODULE_NAME = 'SharedComponents';\n/**\n * Logger for the Shared Components module.\n */\nclass LoggerProvider {\n /**\n * Gets the logger instance for the Shared Components module.\n *\n * @returns LoggerService instance for the Shared Components module\n */\n static get logger() {\n return Loggers.getLoggerInstance(MODULE_NAME);\n }\n}\n\n/**\n * Service responsible for translation operations in the component.\n */\nclass TranslationServiceClassDefinition {\n constructor() {\n this.languageContextService = ServiceProvider.get(LanguageContextService);\n this.translationChangedObservers = {};\n this.logger = LoggerProvider.logger;\n // log with background color\n this.defaultBundle = this.languageContextService.getDefaultBundle();\n this.subscribeToBundleChange();\n }\n /**\n * Translates the <code>messageLabelKey</code> with <code>translationParameter</code> and call <code>translationCallback</code> with translation of current language.\n * The <code>translationCallback</code> is called upon subscription and whenever the selected language is changed.\n *\n * @param messageLabelKey - The label key for the translation.\n * @param translationParameter - Parameters, if needed, for translation.\n * @param translationCallback - A function to be called when translating the `messageLabelKey`.\n * @returns A function that, when called, unsubscribes the provided callback from further translation updates.\n */\n onTranslate(messageLabelKey, translationParameter = [], translationCallback = () => { }) {\n this.translationChangedObservers[messageLabelKey] = this.translationChangedObservers[messageLabelKey] || [];\n const observer = { parameters: translationParameter, callback: translationCallback };\n this.translationChangedObservers[messageLabelKey].push(observer);\n translationCallback(this.translate(messageLabelKey, translationParameter));\n return () => {\n const index = this.translationChangedObservers[messageLabelKey].indexOf(observer);\n if (index !== -1) {\n this.translationChangedObservers[messageLabelKey].splice(index, 1);\n }\n };\n }\n /**\n * Translates the provided key using the currently selected language by applying the parameters if\n * provided.\n * @param key The key for the label which needs to be translated.\n * @param parameters Optional parameters which to be applied during the translation.\n */\n translate(key, parameters) {\n return this.translateInLocale(key, parameters);\n }\n /**\n * Translates a given key into the specified locale. If parameters are provided,\n * they will be applied to the translation.\n *\n * @param key - The translation key, which can be dot-separated for nested translations.\n * @param parameters - Optional parameters to be substituted into the translation string.\n * @returns The translated string with parameters applied if available, or the key itself if not found.\n */\n translateInLocale(key, parameters) {\n // Attempt to retrieve the translation from the specified locale's bundle.\n let translation = this.translateFromBundle(this.currentBundle, key);\n // If not found, fall back to the default language bundle.\n if (!translation) {\n translation = this.translateFromBundle(this.defaultBundle, key);\n }\n // If translation was found, apply any parameters provided and return the result.\n if (translation) {\n translation = this.applyParameters(translation, parameters);\n return sanitizeHTML(translation);\n }\n this.logger.warn(`Missing translation for key: [${key}]`);\n return key;\n }\n /**\n * Retrieves a translation from a specified translation bundle using the given key.\n * If the key represents a nested JSON path, it attempts to resolve the key as such.\n *\n * @param bundle - The translation bundle for the specified locale.\n * @param key - The key to translate, which may be a simple key or dot-separated for nested keys.\n * @returns The translation string if found, or `undefined` if not available.\n */\n translateFromBundle(bundle, key) {\n if (!bundle) {\n return undefined;\n }\n // Try to retrieve the translation directly if it is defined as a whole string,\n // for instance as \"some_function.btn.label\".\n let translation = bundle[key];\n // If not found, attempt to retrieve the translation if it is defined as a JSON object.\n if (typeof translation !== 'string') {\n translation = this.translateAsJsonObject(bundle, key);\n }\n return translation;\n }\n /**\n * Resolves a nested translation key by treating it as a path in a JSON object.\n * For example, if the key is \"some.key.path\", this method will navigate through\n * the JSON object structure to retrieve the value at that path.\n *\n * @param bundle - The translation bundle containing nested keys.\n * @param key - The dot-separated key representing the path to the translation.\n * @returns The translation string if found, or `undefined` if the path does not exist.\n */\n translateAsJsonObject(bundle, key) {\n if (!key) {\n return;\n }\n let path = key.split('.');\n return this.getTranslation(bundle, path);\n }\n /**\n * Recursively navigates through a JSON object based on a path array to retrieve\n * a translation string. Each element in the path array represents a nested key.\n *\n * @param jsonObject - The current JSON object or nested object being searched.\n * @param path - An array representing the path to the translation, where each element is a key.\n * @returns The translation string if found, or `undefined` if the path does not exist.\n */\n getTranslation(jsonObject, path) {\n // Stop the recursion if path or reach the inner element\n if (!path || !jsonObject) {\n return undefined;\n }\n const jsonOrTranslation = jsonObject[path.splice(0, 1)[0]];\n if (path.length === 0) {\n return jsonOrTranslation;\n }\n if (typeof jsonOrTranslation !== 'string') {\n // continue if the inner element is not reached.\n if (path.length > 0) {\n return this.getTranslation(jsonOrTranslation, path);\n }\n return jsonOrTranslation;\n }\n return undefined;\n }\n applyParameters(translation, parameters) {\n if (parameters) {\n return parameters.reduce(\n // replace all occurrence of parameter key with parameter value.\n (translation, parameter) => TranslationServiceClassDefinition.replaceAll(translation, parameter), translation);\n }\n return translation;\n }\n static replaceAll(translation, parameter) {\n return parameter ? translation.split(`{{${parameter.key}}}`).join(parameter.value) : translation;\n }\n notifyTranslationsChanged() {\n Object.keys(this.translationChangedObservers).forEach((eventName) => {\n const observers = this.translationChangedObservers[eventName] || [];\n observers.forEach((observer) => observer.callback(this.translate(eventName, observer.parameters)));\n });\n }\n subscribeToBundleChange() {\n this.languageChangeSubscription = this.languageContextService.onLanguageBundleChanged((bundle) => {\n if (bundle) {\n this.currentBundle = bundle;\n this.notifyTranslationsChanged();\n }\n });\n }\n destroy() {\n if (this.languageChangeSubscription) {\n this.languageChangeSubscription();\n }\n }\n}\nconst TranslationService = new TranslationServiceClassDefinition();\n\nexport { LoggerProvider as L, TranslationService as T, sanitizeHTML as s };\n"],"names":["toastTypeToIconMap","ToastType","INFO","SUCCESS","WARNING","ERROR","OntoToastr","constructor","hostRef","registerInstance","this","toasts","ToastMessageList","toastToTimeout","Map","config","ToastrConfig","getDefaultConfig","onToastMouseEnter","toast","clearToastTimeout","onToastMouseLeave","setTimeoutForToast","handleToastCreate","event","addToast","detail","render","_a","h","key","style","display","isEmpty","class","position","getItems","map","_b","_c","type","id","onMouseEnter","onMouseLeave","onClick","handleToastClick","onKeyUp","handleKeyUp","title","innerHTML","sanitizeHTML","TranslationService","translate","translationParams","message","addToStart","updateToastrReference","timeout","WindowService","getWindow","setTimeout","remove","set","timeoutId","get","clearTimeout","delete","removeOnClick","html","element","document","createElement","value","LoggerProvider","logger","Loggers","getLoggerInstance","TranslationServiceClassDefinition","languageContextService","ServiceProvider","LanguageContextService","translationChangedObservers","defaultBundle","getDefaultBundle","subscribeToBundleChange","onTranslate","messageLabelKey","translationParameter","translationCallback","observer","parameters","callback","push","index","indexOf","splice","translateInLocale","translation","translateFromBundle","currentBundle","applyParameters","warn","bundle","translateAsJsonObject","path","split","getTranslation","jsonObject","jsonOrTranslation","length","reduce","parameter","replaceAll","join","notifyTranslationsChanged","Object","keys","forEach","eventName","languageChangeSubscription","onLanguageBundleChanged","destroy"],"sourceRoot":""}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export const __webpack_esm_id__=80099;export const __webpack_esm_ids__=[80099];export const __webpack_esm_modules__={80099(e,t,n){n.r(t),n.d(t,{translate_label:()=>i});var a=n(18072),s=n(57154),r=n(54096);const i=class{constructor(e){(0,a.r)(this,e),this.unsubscribeTranslationChanged=null,this.translationParameters=[]}connectedCallback(){this.unsubscribeTranslationChanged=r.T.onTranslate(this.labelKey,this.translationParameters,e=>{this.translatedLabel=s.HtmlUtil.sanitize(e)})}disconnectedCallback(){this.unsubscribeTranslationChanged&&(this.unsubscribeTranslationChanged(),this.unsubscribeTranslationChanged=null)}render(){return(0,a.h)(a.a,{key:"8a07d975cbf8baf4d96f8d6db8940f95d3bc7e8a",innerHTML:this.translatedLabel})}};i.style=":host{display:inline}"},54096(e,t,n){n.d(t,{L:()=>r,T:()=>l,s:()=>s});var a=n(57154);function s(e){const t=document.createElement("textarea");return t.innerHTML=e,t.value}class r{static get logger(){return a.Loggers.getLoggerInstance("SharedComponents")}}class i{constructor(){this.languageContextService=a.ServiceProvider.get(a.LanguageContextService),this.translationChangedObservers={},this.logger=r.logger,this.defaultBundle=this.languageContextService.getDefaultBundle(),this.subscribeToBundleChange()}onTranslate(e,t=[],n=()=>{}){this.translationChangedObservers[e]=this.translationChangedObservers[e]||[];const a={parameters:t,callback:n};return this.translationChangedObservers[e].push(a),n(this.translate(e,t)),()=>{const t=this.translationChangedObservers[e].indexOf(a);-1!==t&&this.translationChangedObservers[e].splice(t,1)}}translate(e,t){return this.translateInLocale(e,t)}translateInLocale(e,t){let n=this.translateFromBundle(this.currentBundle,e);return n||(n=this.translateFromBundle(this.defaultBundle,e)),n?(n=this.applyParameters(n,t),s(n)):(this.logger.warn(`Missing translation for key: [${e}]`),e)}translateFromBundle(e,t){if(!e)return;let n=e[t];return"string"!=typeof n&&(n=this.translateAsJsonObject(e,t)),n}translateAsJsonObject(e,t){if(!t)return;let n=t.split(".");return this.getTranslation(e,n)}getTranslation(e,t){if(!t||!e)return;const n=e[t.splice(0,1)[0]];return 0===t.length?n:"string"!=typeof n?t.length>0?this.getTranslation(n,t):n:void 0}applyParameters(e,t){return t?t.reduce((e,t)=>i.replaceAll(e,t),e):e}static replaceAll(e,t){return t?e.split(`{{${t.key}}}`).join(t.value):e}notifyTranslationsChanged(){Object.keys(this.translationChangedObservers).forEach(e=>{(this.translationChangedObservers[e]||[]).forEach(t=>t.callback(this.translate(e,t.parameters)))})}subscribeToBundleChange(){this.languageChangeSubscription=this.languageContextService.onLanguageBundleChanged(e=>{e&&(this.currentBundle=e,this.notifyTranslationsChanged())})}destroy(){this.languageChangeSubscription&&this.languageChangeSubscription()}}const l=new i}};
|
|
2
|
+
//# sourceMappingURL=80099.6e992ddb259c9c8dd389.bundle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F,CACAiB,yBAAAA,GACIC,OAAOC,KAAKnE,KAAKgC,6BAA6BoC,QAASC,KACjCrE,KAAKgC,4BAA4BqC,IAAc,IACvDD,QAAS7B,GAAaA,EAASE,SAASzC,KAAK2C,UAAU0B,EAAW9B,EAASC,eAE7F,CACAL,uBAAAA,GACInC,KAAKsE,2BAA6BtE,KAAK4B,uBAAuB2C,wBAAyBlB,IAC/EA,IACArD,KAAKkD,cAAgBG,EACrBrD,KAAKiE,8BAGjB,CACAO,OAAAA,GACQxE,KAAKsE,4BACLtE,KAAKsE,4BAEb,EAEJ,MAAMlE,EAAqB,IAAIuB,C","sources":["webpack://root-config/./packages/shared-components/dist/esm/translate-label.entry.js","webpack://root-config/./packages/shared-components/dist/esm/translation.service-CyWR_ReZ.js"],"sourcesContent":["import { r as registerInstance, h, a as Host } from './index-BntG-4Sv.js';\nimport { HtmlUtil } from '@ontotext/workbench-api';\nimport { T as TranslationService } from './translation.service-CyWR_ReZ.js';\n\nconst translateLabelCss = \":host{display:inline}\";\n\nconst TranslateLabel = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n this.unsubscribeTranslationChanged = null;\n /**\n * The parameters passed to the translation.\n */\n this.translationParameters = [];\n }\n connectedCallback() {\n this.unsubscribeTranslationChanged = TranslationService.onTranslate(this.labelKey, this.translationParameters, (translatedLabel) => {\n this.translatedLabel = HtmlUtil.sanitize(translatedLabel);\n });\n }\n disconnectedCallback() {\n if (this.unsubscribeTranslationChanged) {\n this.unsubscribeTranslationChanged();\n this.unsubscribeTranslationChanged = null;\n }\n }\n render() {\n return h(Host, { key: '8a07d975cbf8baf4d96f8d6db8940f95d3bc7e8a', innerHTML: this.translatedLabel });\n }\n};\nTranslateLabel.style = translateLabelCss;\n\nexport { TranslateLabel as translate_label };\n","import { Loggers, ServiceProvider, LanguageContextService } from '@ontotext/workbench-api';\n\nfunction sanitizeHTML(html) {\n const element = document.createElement('textarea');\n element.innerHTML = html;\n return element.value;\n}\n\nconst MODULE_NAME = 'SharedComponents';\n/**\n * Logger for the Shared Components module.\n */\nclass LoggerProvider {\n /**\n * Gets the logger instance for the Shared Components module.\n *\n * @returns LoggerService instance for the Shared Components module\n */\n static get logger() {\n return Loggers.getLoggerInstance(MODULE_NAME);\n }\n}\n\n/**\n * Service responsible for translation operations in the component.\n */\nclass TranslationServiceClassDefinition {\n constructor() {\n this.languageContextService = ServiceProvider.get(LanguageContextService);\n this.translationChangedObservers = {};\n this.logger = LoggerProvider.logger;\n // log with background color\n this.defaultBundle = this.languageContextService.getDefaultBundle();\n this.subscribeToBundleChange();\n }\n /**\n * Translates the <code>messageLabelKey</code> with <code>translationParameter</code> and call <code>translationCallback</code> with translation of current language.\n * The <code>translationCallback</code> is called upon subscription and whenever the selected language is changed.\n *\n * @param messageLabelKey - The label key for the translation.\n * @param translationParameter - Parameters, if needed, for translation.\n * @param translationCallback - A function to be called when translating the `messageLabelKey`.\n * @returns A function that, when called, unsubscribes the provided callback from further translation updates.\n */\n onTranslate(messageLabelKey, translationParameter = [], translationCallback = () => { }) {\n this.translationChangedObservers[messageLabelKey] = this.translationChangedObservers[messageLabelKey] || [];\n const observer = { parameters: translationParameter, callback: translationCallback };\n this.translationChangedObservers[messageLabelKey].push(observer);\n translationCallback(this.translate(messageLabelKey, translationParameter));\n return () => {\n const index = this.translationChangedObservers[messageLabelKey].indexOf(observer);\n if (index !== -1) {\n this.translationChangedObservers[messageLabelKey].splice(index, 1);\n }\n };\n }\n /**\n * Translates the provided key using the currently selected language by applying the parameters if\n * provided.\n * @param key The key for the label which needs to be translated.\n * @param parameters Optional parameters which to be applied during the translation.\n */\n translate(key, parameters) {\n return this.translateInLocale(key, parameters);\n }\n /**\n * Translates a given key into the specified locale. If parameters are provided,\n * they will be applied to the translation.\n *\n * @param key - The translation key, which can be dot-separated for nested translations.\n * @param parameters - Optional parameters to be substituted into the translation string.\n * @returns The translated string with parameters applied if available, or the key itself if not found.\n */\n translateInLocale(key, parameters) {\n // Attempt to retrieve the translation from the specified locale's bundle.\n let translation = this.translateFromBundle(this.currentBundle, key);\n // If not found, fall back to the default language bundle.\n if (!translation) {\n translation = this.translateFromBundle(this.defaultBundle, key);\n }\n // If translation was found, apply any parameters provided and return the result.\n if (translation) {\n translation = this.applyParameters(translation, parameters);\n return sanitizeHTML(translation);\n }\n this.logger.warn(`Missing translation for key: [${key}]`);\n return key;\n }\n /**\n * Retrieves a translation from a specified translation bundle using the given key.\n * If the key represents a nested JSON path, it attempts to resolve the key as such.\n *\n * @param bundle - The translation bundle for the specified locale.\n * @param key - The key to translate, which may be a simple key or dot-separated for nested keys.\n * @returns The translation string if found, or `undefined` if not available.\n */\n translateFromBundle(bundle, key) {\n if (!bundle) {\n return undefined;\n }\n // Try to retrieve the translation directly if it is defined as a whole string,\n // for instance as \"some_function.btn.label\".\n let translation = bundle[key];\n // If not found, attempt to retrieve the translation if it is defined as a JSON object.\n if (typeof translation !== 'string') {\n translation = this.translateAsJsonObject(bundle, key);\n }\n return translation;\n }\n /**\n * Resolves a nested translation key by treating it as a path in a JSON object.\n * For example, if the key is \"some.key.path\", this method will navigate through\n * the JSON object structure to retrieve the value at that path.\n *\n * @param bundle - The translation bundle containing nested keys.\n * @param key - The dot-separated key representing the path to the translation.\n * @returns The translation string if found, or `undefined` if the path does not exist.\n */\n translateAsJsonObject(bundle, key) {\n if (!key) {\n return;\n }\n let path = key.split('.');\n return this.getTranslation(bundle, path);\n }\n /**\n * Recursively navigates through a JSON object based on a path array to retrieve\n * a translation string. Each element in the path array represents a nested key.\n *\n * @param jsonObject - The current JSON object or nested object being searched.\n * @param path - An array representing the path to the translation, where each element is a key.\n * @returns The translation string if found, or `undefined` if the path does not exist.\n */\n getTranslation(jsonObject, path) {\n // Stop the recursion if path or reach the inner element\n if (!path || !jsonObject) {\n return undefined;\n }\n const jsonOrTranslation = jsonObject[path.splice(0, 1)[0]];\n if (path.length === 0) {\n return jsonOrTranslation;\n }\n if (typeof jsonOrTranslation !== 'string') {\n // continue if the inner element is not reached.\n if (path.length > 0) {\n return this.getTranslation(jsonOrTranslation, path);\n }\n return jsonOrTranslation;\n }\n return undefined;\n }\n applyParameters(translation, parameters) {\n if (parameters) {\n return parameters.reduce(\n // replace all occurrence of parameter key with parameter value.\n (translation, parameter) => TranslationServiceClassDefinition.replaceAll(translation, parameter), translation);\n }\n return translation;\n }\n static replaceAll(translation, parameter) {\n return parameter ? translation.split(`{{${parameter.key}}}`).join(parameter.value) : translation;\n }\n notifyTranslationsChanged() {\n Object.keys(this.translationChangedObservers).forEach((eventName) => {\n const observers = this.translationChangedObservers[eventName] || [];\n observers.forEach((observer) => observer.callback(this.translate(eventName, observer.parameters)));\n });\n }\n subscribeToBundleChange() {\n this.languageChangeSubscription = this.languageContextService.onLanguageBundleChanged((bundle) => {\n if (bundle) {\n this.currentBundle = bundle;\n this.notifyTranslationsChanged();\n }\n });\n }\n destroy() {\n if (this.languageChangeSubscription) {\n this.languageChangeSubscription();\n }\n }\n}\nconst TranslationService = new TranslationServiceClassDefinition();\n\nexport { LoggerProvider as L, TranslationService as T, sanitizeHTML as s };\n"],"names":["TranslateLabel","constructor","hostRef","registerInstance","this","unsubscribeTranslationChanged","translationParameters","connectedCallback","TranslationService","onTranslate","labelKey","translatedLabel","HtmlUtil","sanitize","disconnectedCallback","render","h","Host","key","innerHTML","style","sanitizeHTML","html","element","document","createElement","value","LoggerProvider","logger","Loggers","getLoggerInstance","TranslationServiceClassDefinition","languageContextService","ServiceProvider","get","LanguageContextService","translationChangedObservers","defaultBundle","getDefaultBundle","subscribeToBundleChange","messageLabelKey","translationParameter","translationCallback","observer","parameters","callback","push","translate","index","indexOf","splice","translateInLocale","translation","translateFromBundle","currentBundle","applyParameters","warn","bundle","translateAsJsonObject","path","split","getTranslation","jsonObject","jsonOrTranslation","length","reduce","parameter","replaceAll","join","notifyTranslationsChanged","Object","keys","forEach","eventName","languageChangeSubscription","onLanguageBundleChanged","destroy"],"sourceRoot":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const __webpack_esm_id__=80933;export const __webpack_esm_ids__=[28662,64709,78469,80933,83847];export const __webpack_esm_modules__={80933(e,r,o){o(22742),o(33136),o(41559),o(83847),o(64709),o(72953),o(75752),o(21146),o(63030),angular.module("graphdb.framework.impex.import",["toastr","ngRoute","ngFileUpload","ui.bootstrap","graphdb.framework.impex.import.controllers","graphdb.framework.core.services.repositories","graphdb.framework.import.directives.validate-uri","graphdb.framework.import.directives.import-progress-indicator","graphdb.framework.import.directives.import-resource-tree"])},78469(e,r,o){var t=o(71315);angular.module("graphdb.framework.impex.import.controllers.import-resource-message-dialog",[]).controller("ImportResourceMessageDialogController",i),i.$inject=["$scope","$uibModalInstance","$translate","toastr","message"];const s=t.I.logger;function i(e,r,o,t,i){e.message=i,e.close=()=>{r.dismiss()},e.copyToClipboard=()=>{navigator.clipboard.writeText(e.message).then(()=>{t.success(o.instant("import.help.messages.copied_to_clipboard")),e.close()},e=>{s.error("Could not copy text: ",e)})}}},64709(){function e(){return{link:function(e,r,o){e.$watch("file.status",function(){"IMPORTING"!==e.file.status&&"UPLOADING"!==e.file.status||!$(r).has("object").length>0&&$(r).append('<object width="'+o.size+'" height="'+o.size+'" data="js/angular/templates/loader/ot-loader.svg?v=3.5.0-
|
|
2
|
-
//# sourceMappingURL=80933.
|
|
1
|
+
export const __webpack_esm_id__=80933;export const __webpack_esm_ids__=[28662,64709,78469,80933,83847];export const __webpack_esm_modules__={80933(e,r,o){o(22742),o(33136),o(41559),o(83847),o(64709),o(72953),o(75752),o(21146),o(63030),angular.module("graphdb.framework.impex.import",["toastr","ngRoute","ngFileUpload","ui.bootstrap","graphdb.framework.impex.import.controllers","graphdb.framework.core.services.repositories","graphdb.framework.import.directives.validate-uri","graphdb.framework.import.directives.import-progress-indicator","graphdb.framework.import.directives.import-resource-tree"])},78469(e,r,o){var t=o(71315);angular.module("graphdb.framework.impex.import.controllers.import-resource-message-dialog",[]).controller("ImportResourceMessageDialogController",i),i.$inject=["$scope","$uibModalInstance","$translate","toastr","message"];const s=t.I.logger;function i(e,r,o,t,i){e.message=i,e.close=()=>{r.dismiss()},e.copyToClipboard=()=>{navigator.clipboard.writeText(e.message).then(()=>{t.success(o.instant("import.help.messages.copied_to_clipboard")),e.close()},e=>{s.error("Could not copy text: ",e)})}}},64709(){function e(){return{link:function(e,r,o){e.$watch("file.status",function(){"IMPORTING"!==e.file.status&&"UPLOADING"!==e.file.status||!$(r).has("object").length>0&&$(r).append('<object width="'+o.size+'" height="'+o.size+'" data="js/angular/templates/loader/ot-loader.svg?v=3.5.0-TR5">{{\'common.loading\' | translate}}</object>')})}}}angular.module("graphdb.framework.import.directives.import-progress-indicator",[]).directive("ImportProgressIndicator",e),e.$inject=[]},60016(e,r,o){o(78469);var t=o(2998),s=o(35195);function i(e){return{restrict:"E",templateUrl:"js/angular/import/templates/import-resource-message.html",scope:{resource:"="},link:r=>{r.ImportResourceStatus=t.I,r.toTitleCase=e=>s.Sn(e),r.showMessage=r=>{e.open({templateUrl:"js/angular/import/templates/import-resource-message-dialog.html",controller:"ImportResourceMessageDialogController",size:"lg",windowClass:"import-resource-message-dialog",backdrop:"static",resolve:{message:function(){return r?r.importResource.message:""}}})}}}}angular.module("graphdb.framework.import.directives.import-resource-message",["graphdb.framework.impex.import.controllers.import-resource-message-dialog"]).directive("importResourceMessage",i),i.$inject=["$uibModal"]},28662(){function e(e,r){return{restrict:"E",templateUrl:"js/angular/import/templates/import-resource-status-info.html",scope:{resource:"="},link:o=>{const t=[];o.popoverTemplate="resourceStatusInfoTemplate.html",o.popoverIsOpen=!1,o.context=o.resource.importResource.context,o.replaceGraphs=o.resource.importResource.replaceGraphs,o.baseUrl=decodeURIComponent(o.resource.importResource.baseURI),o.forceSerial=o.resource.importResource.forceSerial,o.importedOn=o.resource.importResource.importedOn,o.parserSettings=o.resource.importResource.parserSettings,o.open=()=>{o.closeAllDialogs(),o.popoverIsOpen=!0},o.closeAllDialogs=()=>{e.$broadcast("closePopovers")},o.close=()=>{o.popoverIsOpen=!1};const s=e=>{"Escape"===e.key&&o.$apply(()=>{o.close()})};t.push(o.$on("closePopovers",o.close)),r.on("keydown",s),o.$on("$destroy",()=>{r.off("keydown",s),t.forEach(e=>e())})}}}angular.module("graphdb.framework.import.directives.import-resource-status-info",[]).directive("importResourceStatusInfo",e),e.$inject=["$rootScope","$document"]},72953(e,r,o){var t=o(2998),s=(o(60016),o(28662),o(66256)),i=o(71609),c=o(59601),a=o(33757),l=o(57154);const p={FILE:"FILE",DIRECTORY:"DIRECTORY",ALL:"ALL"},n={ALL:"ALL",NONE:"NONE",IMPORTED:"IMPORTED",NOT_IMPORTED:"NOT_IMPORTED"};function u(e,r){return{restrict:"E",templateUrl:"js/angular/import/templates/import-resource-tree.html",scope:{columnKeys:"=",showTypeFilter:"=",sortBy:"=",asc:"=",onImport:"&",onImportAll:"&",onReset:"&",onRemove:"&",onStopImport:"&",onEditResource:"&"},link:(o,u,m)=>{o.resources=new i.k,o.displayResources=[],o.TYPE_FILTER_OPTIONS=p,o.filterByType=p.ALL,o.filterByFileName="",o.STATUS_OPTIONS=n,o.selectedByStatus=void 0,o.areAllDisplayedImportResourcesSelected=!1,o.areAllDisplayedImportResourcesPartialSelected=!1,o.ImportResourceStatus=t.I,o.canRemoveResource=angular.isDefined(m.onRemove),o.canResetSelectedResources=!1,o.SORTING_TYPES=s.R,o.sortAsc=!angular.isDefined(m.asc)||o.asc,o.sortedBy=o.sortBy,o.showLoader=r.getShowLoader(),o.hasSelection=!1,o.selectionChanged=e=>{e.setSelection(e.selected),I(),d(),g()},o.selectResourceWithStatus=e=>{o.selectedByStatus=e,o.resources.setSelection(!1),n.ALL===o.selectedByStatus?o.resources.setSelection(!0):n.IMPORTED===o.selectedByStatus?o.resources.selectAllWithStatus([t.I.DONE]):n.NOT_IMPORTED===o.selectedByStatus&&o.resources.selectAllWithStatus([t.I.IMPORTING,t.I.NONE,t.I.ERROR,t.I.PENDING,t.I.INTERRUPTING]),R(),d()},o.filterByTypeChanged=e=>{o.filterByType=e,R()},o.filterByFileNameChanged=e=>{o.filterByFileName=e,N(R,100)},o.onResetStatus=()=>{const e=o.resources.getAllSelected().map(e=>e.path);e.length>0&&o.onReset({resources:e})},o.resetStatus=e=>{o.onReset({resources:[e.path]})},o.onRemoveResources=()=>{const e=o.resources.getAllSelected();e&&e.length>0&&o.onRemove({resources:e})},o.removeResource=e=>{o.onRemove({resources:[e]})},o.importAll=e=>{const r=o.resources.getAllSelectedForImport();r.length>0&&o.onImportAll({selectedResources:r,withoutChangingSettings:e})},o.stopImport=e=>{o.onStopImport({resource:e})},o.sort=e=>{o.sortedBy===e?o.sortAsc=!o.sortAsc:o.sortAsc=!0,o.sortedBy=e,R()},o.editResource=e=>{o.onEditResource({resource:e})};const d=()=>{o.canResetSelectedResources=o.resources.getSelectedImportedResources()},R=()=>{o.resources.getRoot().updateSelectionState(),y(),o.displayResources=o.resources.toList().filter(A).filter(E),g(),I()},g=()=>{const e=o.resources.getAllSelectedFilesNames();o.hasSelection=e.length>0,r.updateSelectedFilesNames(e)},I=()=>{const e=o.displayResources.some(e=>!e.selected),r=o.displayResources.some(e=>e.selected);o.areAllDisplayedImportResourcesSelected=r&&!e,o.areAllDisplayedImportResourcesPartialSelected=r&&e},y=()=>{s.R.NAME===o.sortedBy?o.resources.sort(f(o.sortAsc)):s.R.SIZE===o.sortedBy?o.resources.sort(h(o.sortAsc)):s.R.MODIFIED===o.sortedBy?o.resources.sort(S(o.sortAsc)):s.R.IMPORTED===o.sortedBy?o.resources.sort(T(o.sortAsc)):s.R.CONTEXT===o.sortedBy&&o.resources.sort(v(o.sortAsc))},f=e=>(r,o)=>e?r.importResource.name.localeCompare(o.importResource.name):o.importResource.name.localeCompare(r.importResource.name),h=e=>(r,o)=>{const t=l.ByteUtils.convertToBytes(r.importResource.size),s=l.ByteUtils.convertToBytes(o.importResource.size);return e?t-s:s-t},S=e=>(r,o)=>{const t=r.importResource.modifiedOn||Number.MAX_VALUE,s=o.importResource.modifiedOn||Number.MAX_VALUE;return e?t-s:s-t},T=e=>(r,o)=>{const t=r.importResource.importedOn||Number.MAX_VALUE,s=o.importResource.importedOn||Number.MAX_VALUE;return e?t-s:s-t},v=e=>(r,o)=>e?r.importResource.context.localeCompare(o.importResource.context):o.importResource.context.localeCompare(r.importResource.context),A=e=>p.ALL===o.filterByType||(o.filterByType===p.FILE?e.isFile():o.filterByType===p.DIRECTORY&&e.isDirectory()),E=e=>!o.filterByFileName||(o.filterByType===p.DIRECTORY?e.hasTextInDirectoriesName(o.filterByFileName):o.filterByType===p.FILE?e.hasTextInFilesName(o.filterByFileName):e.hasTextInResourcesName(o.filterByFileName));let O;const N=(r,o)=>{O&&e.cancel(O),O=e(r,o)},b=[];b.push(r.onResourcesUpdated((e=[])=>{const t=c.D.USER===r.getActiveTabId();o.resources.isEmpty()?(o.resources=a.Fp.toImportResourceTree(e,t),t&&(o.sortedBy=s.R.MODIFIED)):a.Fp.mergeResourceTree(o.resources,e,t),a.Fp.calculateElementIndent(o.resources),a.Fp.setupAfterTreeInitProperties(o.resources),R(),d()})),b.push(r.onShowLoaderUpdated(e=>o.showLoader=e)),b.push(r.onActiveTabIdUpdated(()=>o.resources=new i.k)),o.$on("$destroy",()=>{b.forEach(e=>e())})}}}angular.module("graphdb.framework.import.directives.import-resource-tree",["graphdb.framework.import.directives.import-resource-message","graphdb.framework.import.directives.import-resource-status-info"]).directive("importResourceTree",u),u.$inject=["$timeout","ImportContextService"]},83847(){function e(e){return{restrict:"A",require:"ngModel",link:function(r,o,t,s){s.$parsers.unshift(function(r){if(s.$setValidity("validateUri",!0),!s.$isEmpty(r)){const o=e.isValidIri(r,r.toString());s.$setValidity("validateUri",o)}return r})}}}angular.module("graphdb.framework.import.directives.validate-uri",[]).directive("validateUri",e),e.$inject=["UriUtils"]}};
|
|
2
|
+
//# sourceMappingURL=80933.11ccdbd4e85cb0b0da6e.bundle.js.map
|
package/dist/{80933.f525c8a525c14438dd9c.bundle.js.map → 80933.11ccdbd4e85cb0b0da6e.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AAqB6H,iBACpDzM,EAAOwF,UAAUkH,WACjB1M,EAAOwF,UAAYmH,EAAAA,GAA0BC,qBAAqBP,EAAcC,GAC5EA,IACAtM,EAAOwG,SAAWF,EAAAA,EAAY4D,WAGlCyC,EAAAA,GAA0BE,kBAAkB7M,EAAOwF,UAAW6G,EAAcC,GAEhFK,EAAAA,GAA0BG,uBAAuB9M,EAAOwF,WACxDmH,EAAAA,GAA0BI,6BAA6B/M,EAAOwF,WAC9DqC,IACAb,OASJkF,EAAchI,KAAKU,EAAqBoI,oBAAqBvG,GAAezG,EAAOyG,WAAaA,IAChGyF,EAAchI,KAAKU,EAAqBqI,qBAAqB,IAAMjN,EAAOwF,UAAY,IAAIC,EAAAA,IAO1FzF,EAAOmE,IAAI,WALkB+I,KACzBhB,EAAc5H,QAAS6I,GAAiBA,QAOxD,CAvTA1N,QACKC,OAAO,2DANI,CACZ,8DACA,oEAKCmC,UAAU,qBAAsB6C,GAErCA,EAA4B7E,QAAU,CAAC,WAAY,uB,UCXnD,SAASuN,EAAYC,GACjB,MAAO,CACHrL,SAAU,IACVsL,QAAS,UACTrM,KAAM,SAAUC,EAAOC,EAASC,EAAMmM,GAClCA,EAAKC,SAASC,QAAQ,SAAUC,GAE5B,GADAH,EAAKI,aAAa,eAAe,IAC5BJ,EAAKK,SAASF,GAAQ,CACvB,MAAMG,EAAQR,EAASS,WAAWJ,EAAOA,EAAMK,YAC/CR,EAAKI,aAAa,cAAeE,EACrC,CACA,OAAOH,CACX,EACJ,EAER,CAzBAjO,QACKC,OAAO,mDAHI,IAIXmC,UAAU,cAAeuL,GAE9BA,EAAYvN,QAAU,CAAC,W","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/import/app.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/controllers/import-resource-message-dialog.controller.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-progress-indicator.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-resource-message.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-resource-status-info.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-resource-tree.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/validate-uri.directive.js"],"sourcesContent":["import 'angular/core/services';\nimport 'angular/core/directives';\nimport 'angular/import/controllers/import-view.controller';\nimport 'angular/import/directives/validate-uri.directive';\nimport 'angular/import/directives/import-progress-indicator.directive';\nimport 'angular/import/directives/import-resource-tree.directive';\nimport 'angular/core/services/repositories.service';\nimport 'ng-file-upload/dist/ng-file-upload.min';\nimport 'ng-file-upload/dist/ng-file-upload-shim.min';\n\nconst modules = [\n 'toastr',\n 'ngRoute',\n 'ngFileUpload',\n 'ui.bootstrap',\n 'graphdb.framework.impex.import.controllers',\n 'graphdb.framework.core.services.repositories',\n 'graphdb.framework.import.directives.validate-uri',\n 'graphdb.framework.import.directives.import-progress-indicator',\n 'graphdb.framework.import.directives.import-resource-tree'\n];\n\nangular.module('graphdb.framework.impex.import', modules);\n","import {LoggerProvider} from \"../../core/services/logger-provider\";\n\nangular\n .module('graphdb.framework.impex.import.controllers.import-resource-message-dialog', [])\n .controller('ImportResourceMessageDialogController', ImportResourceMessageDialogController);\n\nImportResourceMessageDialogController.$inject = ['$scope', '$uibModalInstance', '$translate', 'toastr', 'message'];\n\nconst logger = LoggerProvider.logger;\n\nfunction ImportResourceMessageDialogController($scope, $uibModalInstance, $translate, toastr, message) {\n $scope.message = message;\n\n\n $scope.close = () => {\n $uibModalInstance.dismiss();\n };\n\n $scope.copyToClipboard = () => {\n navigator.clipboard.writeText($scope.message)\n .then(() => {\n toastr.success($translate.instant('import.help.messages.copied_to_clipboard'));\n $scope.close();\n }, (err) => {\n logger.error('Could not copy text: ', err);\n });\n };\n}\n","const modules = [];\n\nangular\n .module('graphdb.framework.import.directives.import-progress-indicator', modules)\n .directive('ImportProgressIndicator', ImportProgressIndicator);\n\nImportProgressIndicator.$inject = [];\n\n// importDirectives.directive('filesOntoLoader',\nfunction ImportProgressIndicator() {\n return {\n link: function (scope, element, attr) {\n scope.$watch('file.status', function () {\n if (scope.file.status === 'IMPORTING' || scope.file.status === 'UPLOADING') {\n if (!$(element).has('object').length > 0) {\n $(element).append('<object width=\"' + attr.size + '\" height=\"' + attr.size + '\" data=\"js/angular/templates/loader/ot-loader.svg?v=3.5.0-TR3\">{{\\'common.loading\\' | translate}}</object>');\n }\n }\n });\n }\n };\n}\n","import 'angular/import/controllers/import-resource-message-dialog.controller';\nimport {ImportResourceStatus} from \"../../models/import/import-resource-status\";\nimport * as stringUtils from \"../../utils/string-utils\";\n\nconst modules = ['graphdb.framework.impex.import.controllers.import-resource-message-dialog'];\n\nangular\n .module('graphdb.framework.import.directives.import-resource-message', modules)\n .directive('importResourceMessage', importResourceMessageDirective);\n\nimportResourceMessageDirective.$inject = ['$uibModal'];\n\nfunction importResourceMessageDirective($uibModal) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/import/templates/import-resource-message.html',\n scope: {\n resource: '='\n },\n link: ($scope) => {\n $scope.ImportResourceStatus = ImportResourceStatus;\n $scope.toTitleCase = (str) => stringUtils.toTitleCase(str);\n\n /**\n *\n * @param {ImportResourceTreeElement} resourceTreeElement\n */\n $scope.showMessage = (resourceTreeElement) => {\n $uibModal.open({\n templateUrl: 'js/angular/import/templates/import-resource-message-dialog.html',\n controller: 'ImportResourceMessageDialogController',\n size: 'lg',\n windowClass: 'import-resource-message-dialog',\n backdrop: 'static',\n resolve: {\n message: function () {\n return resourceTreeElement ? resourceTreeElement.importResource.message : '';\n }\n }\n });\n }\n }\n };\n}\n","const modules = [];\n\nangular\n .module('graphdb.framework.import.directives.import-resource-status-info', modules)\n .directive('importResourceStatusInfo', importResourceStatusInfoDirective);\n\nimportResourceStatusInfoDirective.$inject = ['$rootScope', '$document'];\n\nfunction importResourceStatusInfoDirective($rootScope, $document) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/import/templates/import-resource-status-info.html',\n scope: {\n resource: '='\n },\n link: ($scope) => {\n const subscribers = [];\n\n // =========================\n // Public variables\n // =========================\n $scope.popoverTemplate = 'resourceStatusInfoTemplate.html';\n $scope.popoverIsOpen = false;\n $scope.context = $scope.resource.importResource.context;\n $scope.replaceGraphs = $scope.resource.importResource.replaceGraphs;\n $scope.baseUrl = decodeURIComponent($scope.resource.importResource.baseURI);\n $scope.forceSerial = $scope.resource.importResource.forceSerial;\n $scope.importedOn = $scope.resource.importResource.importedOn;\n $scope.parserSettings = $scope.resource.importResource.parserSettings;\n\n // =========================\n // Public functions\n // =========================\n $scope.open = () => {\n $scope.closeAllDialogs();\n $scope.popoverIsOpen = true;\n };\n\n $scope.closeAllDialogs = () => {\n $rootScope.$broadcast('closePopovers');\n };\n\n $scope.close = () => {\n $scope.popoverIsOpen = false;\n };\n\n const handleEscapeKeyPress = (event) => {\n if (event.key === 'Escape') {\n $scope.$apply(() => {\n $scope.close();\n });\n }\n };\n\n const removeAllSubscribers = () => {\n subscribers.forEach((subscriber) => subscriber());\n };\n\n // =========================\n // Subscriptions\n // =========================\n\n subscribers.push($scope.$on('closePopovers', $scope.close));\n $document.on('keydown', handleEscapeKeyPress);\n\n $scope.$on('$destroy', () => {\n $document.off('keydown', handleEscapeKeyPress);\n removeAllSubscribers();\n });\n }\n };\n}\n","import {ImportResourceStatus} from \"../../models/import/import-resource-status\";\nimport 'angular/import/directives/import-resource-message.directive';\nimport 'angular/import/directives/import-resource-status-info.directive';\nimport {SortingType} from \"../../models/import/sorting-type\";\nimport {ImportResourceTreeElement} from \"../../models/import/import-resource-tree-element\";\nimport {TABS} from \"../services/import-context.service\";\nimport {ImportResourceTreeService} from \"../services/import-resource-tree.service\";\nimport {\n ByteUtils,\n} from \"@ontotext/workbench-api\";\n\nconst TYPE_FILTER_OPTIONS = {\n 'FILE': 'FILE',\n 'DIRECTORY': 'DIRECTORY',\n 'ALL': 'ALL',\n};\n\nconst STATUS_OPTIONS = {\n 'ALL': 'ALL',\n 'NONE': 'NONE',\n 'IMPORTED': 'IMPORTED',\n 'NOT_IMPORTED': 'NOT_IMPORTED',\n};\n\nconst modules = [\n 'graphdb.framework.import.directives.import-resource-message',\n 'graphdb.framework.import.directives.import-resource-status-info',\n];\n\nangular\n .module('graphdb.framework.import.directives.import-resource-tree', modules)\n .directive('importResourceTree', importResourceTreeDirective);\n\nimportResourceTreeDirective.$inject = ['$timeout', 'ImportContextService'];\n\nfunction importResourceTreeDirective($timeout, ImportContextService) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/import/templates/import-resource-tree.html',\n scope: {\n /**\n * Contains mapping of the column names to label keys. Should contain\n * keys for: name, size, imported, modified, context column names.\n */\n columnKeys: '=',\n /**\n * If the type filter buttons should be visible.\n */\n showTypeFilter: '=',\n /**\n * The default field to sort the resources by.\n */\n sortBy: '=',\n asc: '=',\n onImport: '&',\n onImportAll: '&',\n onReset: '&',\n onRemove: '&',\n onStopImport: '&',\n onEditResource: '&',\n },\n link: ($scope, element, attrs) => {\n // =========================\n // Public variables\n // =========================\n $scope.resources = new ImportResourceTreeElement();\n $scope.displayResources = [];\n $scope.TYPE_FILTER_OPTIONS = TYPE_FILTER_OPTIONS;\n $scope.filterByType = TYPE_FILTER_OPTIONS.ALL;\n $scope.filterByFileName = '';\n $scope.STATUS_OPTIONS = STATUS_OPTIONS;\n $scope.selectedByStatus = undefined;\n $scope.areAllDisplayedImportResourcesSelected = false;\n $scope.areAllDisplayedImportResourcesPartialSelected = false;\n $scope.ImportResourceStatus = ImportResourceStatus;\n $scope.canRemoveResource = angular.isDefined(attrs.onRemove);\n $scope.canResetSelectedResources = false;\n $scope.SORTING_TYPES = SortingType;\n $scope.sortAsc = angular.isDefined(attrs.asc) ? $scope.asc : true;\n $scope.sortedBy = $scope.sortBy;\n $scope.showLoader = ImportContextService.getShowLoader();\n $scope.hasSelection = false;\n\n // =========================\n // Public functions\n // =========================\n\n /**\n * Updates the selection model when a resource is selected or unselected.\n * @param {ImportResourceTreeElement} resource The resource that was selected or unselected.\n */\n $scope.selectionChanged = ((resource) => {\n resource.setSelection(resource.selected);\n updateSelectByStateDropdownModel();\n setCanResetResourcesFlag();\n updateHasSelection();\n });\n\n $scope.selectResourceWithStatus = (resourceStatus) => {\n $scope.selectedByStatus = resourceStatus;\n $scope.resources.setSelection(false);\n\n if (STATUS_OPTIONS.ALL === $scope.selectedByStatus) {\n $scope.resources.setSelection(true);\n } else if (STATUS_OPTIONS.IMPORTED === $scope.selectedByStatus) {\n $scope.resources.selectAllWithStatus([ImportResourceStatus.DONE]);\n } else if (STATUS_OPTIONS.NOT_IMPORTED === $scope.selectedByStatus) {\n $scope.resources.selectAllWithStatus([ImportResourceStatus.IMPORTING, ImportResourceStatus.NONE, ImportResourceStatus.ERROR, ImportResourceStatus.PENDING, ImportResourceStatus.INTERRUPTING]);\n }\n\n updateListedImportResources();\n setCanResetResourcesFlag();\n };\n\n $scope.filterByTypeChanged = (newType) => {\n $scope.filterByType = newType;\n updateListedImportResources();\n };\n\n $scope.filterByFileNameChanged = (filterByFileName) => {\n $scope.filterByFileName = filterByFileName;\n debounce(updateListedImportResources, 100);\n };\n\n /**\n * Resets the status of the selected resources.\n */\n $scope.onResetStatus = () => {\n const resourcesNames = $scope.resources.getAllSelected()\n .map((resource) => resource.path);\n if (resourcesNames.length > 0) {\n $scope.onReset({resources: resourcesNames});\n }\n };\n\n /**\n * Resets the status of the given resource.\n * @param {ImportResourceTreeElement} importResource\n */\n $scope.resetStatus = (importResource) => {\n $scope.onReset({resources: [importResource.path]});\n };\n\n $scope.onRemoveResources = () => {\n const selectedResources = $scope.resources.getAllSelected();\n if (selectedResources && selectedResources.length > 0) {\n $scope.onRemove({resources: selectedResources});\n }\n };\n\n $scope.removeResource = (resource) => {\n $scope.onRemove({resources: [resource]});\n };\n\n $scope.importAll = (withoutChangingSettings) => {\n const selectedResources = $scope.resources.getAllSelectedForImport();\n if (selectedResources.length > 0) {\n $scope.onImportAll({selectedResources: selectedResources, withoutChangingSettings});\n }\n };\n\n $scope.stopImport = (importResource) => {\n $scope.onStopImport({resource: importResource});\n };\n\n /**\n * Sorts resources by provided sorting type.\n * @param {SortingType} sortedBy The sorting type to use.\n */\n $scope.sort = (sortedBy) => {\n if ($scope.sortedBy === sortedBy) {\n $scope.sortAsc = !$scope.sortAsc;\n } else {\n $scope.sortAsc = true;\n }\n $scope.sortedBy = sortedBy;\n updateListedImportResources();\n };\n\n $scope.editResource = (resource) => {\n $scope.onEditResource({resource});\n };\n\n // =========================\n // Private functions\n // =========================\n\n /**\n * Sets the flag showing if any of the selected resources is already imported\n * and can have their states reset.\n */\n const setCanResetResourcesFlag = () => {\n $scope.canResetSelectedResources = $scope.resources.getSelectedImportedResources();\n };\n\n const updateListedImportResources = () => {\n $scope.resources.getRoot().updateSelectionState();\n sortResources();\n $scope.displayResources = $scope.resources.toList()\n .filter(filterByType)\n .filter(filterByName);\n\n updateHasSelection();\n updateSelectByStateDropdownModel();\n };\n\n const updateHasSelection = () => {\n const allSelectedFilesNames = $scope.resources.getAllSelectedFilesNames();\n $scope.hasSelection = allSelectedFilesNames.length > 0;\n ImportContextService.updateSelectedFilesNames(allSelectedFilesNames);\n };\n\n const updateSelectByStateDropdownModel = () => {\n const hasUnselectedDisplayedImportResource = $scope.displayResources.some((resource) => !resource.selected);\n const hasSelectedDisplayedImportResource = $scope.displayResources.some((resource) => resource.selected);\n $scope.areAllDisplayedImportResourcesSelected = hasSelectedDisplayedImportResource && !hasUnselectedDisplayedImportResource;\n $scope.areAllDisplayedImportResourcesPartialSelected = hasSelectedDisplayedImportResource && hasUnselectedDisplayedImportResource;\n };\n\n const sortResources = () => {\n if (SortingType.NAME === $scope.sortedBy) {\n $scope.resources.sort(compareByName($scope.sortAsc));\n } else if (SortingType.SIZE === $scope.sortedBy) {\n $scope.resources.sort(compareBySize($scope.sortAsc));\n } else if (SortingType.MODIFIED === $scope.sortedBy) {\n $scope.resources.sort(compareByModified($scope.sortAsc));\n } else if (SortingType.IMPORTED === $scope.sortedBy) {\n $scope.resources.sort(compareByImportedOn($scope.sortAsc));\n } else if (SortingType.CONTEXT === $scope.sortedBy) {\n $scope.resources.sort(compareByContext($scope.sortAsc));\n }\n };\n\n const compareByName = (acs) => (r1, r2) => {\n return acs ? r1.importResource.name.localeCompare(r2.importResource.name) : r2.importResource.name.localeCompare(r1.importResource.name);\n };\n\n const compareBySize = (acs) => (r1, r2) => {\n // The format of size returned by the backend has changed, but we need to keep the old format for backward compatibility.\n // Therefore, we convert the size to always be in bytes.\n const r1Size = ByteUtils.convertToBytes(r1.importResource.size);\n const r2Size = ByteUtils.convertToBytes(r2.importResource.size);\n return acs ? r1Size - r2Size : r2Size - r1Size;\n };\n\n const compareByModified = (acs) => (r1, r2) => {\n const r1ModifiedOn = r1.importResource.modifiedOn || Number.MAX_VALUE;\n const r2ModifiedOn = r2.importResource.modifiedOn || Number.MAX_VALUE;\n return acs ? r1ModifiedOn - r2ModifiedOn : r2ModifiedOn - r1ModifiedOn;\n };\n\n const compareByImportedOn = (acs) => (r1, r2) => {\n const r1ImportedOn = r1.importResource.importedOn || Number.MAX_VALUE;\n const r2ImportedOn = r2.importResource.importedOn || Number.MAX_VALUE;\n return acs ? r1ImportedOn - r2ImportedOn : r2ImportedOn - r1ImportedOn;\n };\n\n const compareByContext = (acs) => (r1, r2) => {\n return acs ? r1.importResource.context.localeCompare(r2.importResource.context) : r2.importResource.context.localeCompare(r1.importResource.context);\n };\n\n const filterByType = (resource) => {\n if (TYPE_FILTER_OPTIONS.ALL === $scope.filterByType) {\n return true;\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.FILE) {\n return resource.isFile();\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.DIRECTORY) {\n return resource.isDirectory();\n }\n\n return false;\n };\n\n const filterByName = (resource) => {\n if (!$scope.filterByFileName) {\n return true;\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.DIRECTORY) {\n return resource.hasTextInDirectoriesName($scope.filterByFileName);\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.FILE) {\n return resource.hasTextInFilesName($scope.filterByFileName);\n }\n return resource.hasTextInResourcesName($scope.filterByFileName);\n };\n\n let debounceTimeout;\n const debounce = (func, delay) => {\n // Clear previous timeout\n if (debounceTimeout) {\n $timeout.cancel(debounceTimeout);\n }\n\n // Set new timeout\n debounceTimeout = $timeout(func, delay);\n };\n\n // =========================\n // Subscription handlers\n // =========================\n\n const onResourcesUpdatedHandler = (newResources = []) => {\n const isUserImport = TABS.USER === ImportContextService.getActiveTabId();\n if ($scope.resources.isEmpty()) {\n $scope.resources = ImportResourceTreeService.toImportResourceTree(newResources, isUserImport);\n if (isUserImport) {\n $scope.sortedBy = SortingType.MODIFIED;\n }\n } else {\n ImportResourceTreeService.mergeResourceTree($scope.resources, newResources, isUserImport);\n }\n ImportResourceTreeService.calculateElementIndent($scope.resources);\n ImportResourceTreeService.setupAfterTreeInitProperties($scope.resources);\n updateListedImportResources();\n setCanResetResourcesFlag();\n };\n\n // =========================\n // Subscriptions\n // =========================\n const subscriptions = [];\n\n subscriptions.push(ImportContextService.onResourcesUpdated(onResourcesUpdatedHandler));\n subscriptions.push(ImportContextService.onShowLoaderUpdated((showLoader) => $scope.showLoader = showLoader));\n subscriptions.push(ImportContextService.onActiveTabIdUpdated(() => $scope.resources = new ImportResourceTreeElement()));\n\n const removeAllSubscribers = () => {\n subscriptions.forEach((subscription) => subscription());\n };\n\n // Deregister the watcher when the scope/directive is destroyed\n $scope.$on('$destroy', removeAllSubscribers);\n },\n };\n}\n","/**\n * This AngularJS directive validates whether an input value is a valid URI (IRI).\n *\n * @directive validateUri\n * @restrict A (Attribute)\n * @requires ngModel\n *\n * @example\n * <input type=\"text\" name=\"url\" ng-model=\"url\" validate-uri>\n */\nconst modules = [];\n\nangular\n .module('graphdb.framework.import.directives.validate-uri', modules)\n .directive('validateUri', validateUri);\n\nvalidateUri.$inject = ['UriUtils'];\n\n/**\n * @function validateUri\n * @param {UriUtils} UriUtils - Service for URI validation.\n */\nfunction validateUri(UriUtils) {\n return {\n restrict: 'A',\n require: 'ngModel',\n link: function (scope, element, attr, ctrl) {\n ctrl.$parsers.unshift(function (value) {\n ctrl.$setValidity('validateUri', true);\n if (!ctrl.$isEmpty(value)) {\n const valid = UriUtils.isValidIri(value, value.toString());\n ctrl.$setValidity('validateUri', valid);\n }\n return value;\n });\n }\n };\n}\n"],"names":["angular","module","controller","ImportResourceMessageDialogController","$inject","logger","LoggerProvider","$scope","$uibModalInstance","$translate","toastr","message","close","dismiss","copyToClipboard","navigator","clipboard","writeText","then","success","instant","err","error","ImportProgressIndicator","link","scope","element","attr","$watch","file","status","$","has","length","append","size","directive","importResourceMessageDirective","$uibModal","restrict","templateUrl","resource","ImportResourceStatus","toTitleCase","str","stringUtils","showMessage","resourceTreeElement","open","windowClass","backdrop","resolve","importResource","importResourceStatusInfoDirective","$rootScope","$document","subscribers","popoverTemplate","popoverIsOpen","context","replaceGraphs","baseUrl","decodeURIComponent","baseURI","forceSerial","importedOn","parserSettings","closeAllDialogs","$broadcast","handleEscapeKeyPress","event","key","$apply","push","$on","on","off","forEach","subscriber","TYPE_FILTER_OPTIONS","STATUS_OPTIONS","importResourceTreeDirective","$timeout","ImportContextService","columnKeys","showTypeFilter","sortBy","asc","onImport","onImportAll","onReset","onRemove","onStopImport","onEditResource","attrs","resources","ImportResourceTreeElement","displayResources","filterByType","ALL","filterByFileName","selectedByStatus","undefined","areAllDisplayedImportResourcesSelected","areAllDisplayedImportResourcesPartialSelected","canRemoveResource","isDefined","canResetSelectedResources","SORTING_TYPES","SortingType","sortAsc","sortedBy","showLoader","getShowLoader","hasSelection","selectionChanged","setSelection","selected","updateSelectByStateDropdownModel","setCanResetResourcesFlag","updateHasSelection","selectResourceWithStatus","resourceStatus","IMPORTED","selectAllWithStatus","DONE","NOT_IMPORTED","IMPORTING","NONE","ERROR","PENDING","INTERRUPTING","updateListedImportResources","filterByTypeChanged","newType","filterByFileNameChanged","debounce","onResetStatus","resourcesNames","getAllSelected","map","path","resetStatus","onRemoveResources","selectedResources","removeResource","importAll","withoutChangingSettings","getAllSelectedForImport","stopImport","sort","editResource","getSelectedImportedResources","getRoot","updateSelectionState","sortResources","toList","filter","filterByName","allSelectedFilesNames","getAllSelectedFilesNames","updateSelectedFilesNames","hasUnselectedDisplayedImportResource","some","hasSelectedDisplayedImportResource","NAME","compareByName","SIZE","compareBySize","MODIFIED","compareByModified","compareByImportedOn","CONTEXT","compareByContext","acs","r1","r2","name","localeCompare","r1Size","ByteUtils","convertToBytes","r2Size","r1ModifiedOn","modifiedOn","Number","MAX_VALUE","r2ModifiedOn","r1ImportedOn","r2ImportedOn","FILE","isFile","DIRECTORY","isDirectory","hasTextInDirectoriesName","hasTextInFilesName","hasTextInResourcesName","debounceTimeout","func","delay","cancel","subscriptions","onResourcesUpdated","onResourcesUpdatedHandler","newResources","isUserImport","TABS","USER","getActiveTabId","isEmpty","ImportResourceTreeService","toImportResourceTree","mergeResourceTree","calculateElementIndent","setupAfterTreeInitProperties","onShowLoaderUpdated","onActiveTabIdUpdated","removeAllSubscribers","subscription","validateUri","UriUtils","require","ctrl","$parsers","unshift","value","$setValidity","$isEmpty","valid","isValidIri","toString"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"file":"80933.11ccdbd4e85cb0b0da6e.bundle.js","mappings":"2OAsBAA,QAAQC,OAAO,iCAZC,CACZ,SACA,UACA,eACA,eACA,6CACA,+CACA,mDACA,gEACA,4D,8BCjBJD,QACKC,OAAO,4EAA6E,IACpFC,WAAW,wCAAyCC,GAEzDA,EAAsCC,QAAU,CAAC,SAAU,oBAAqB,aAAc,SAAU,WAExG,MAAMC,EAASC,EAAAA,EAAeD,OAE9B,SAASF,EAAsCI,EAAQC,EAAmBC,EAAYC,EAAQC,GAC1FJ,EAAOI,QAAUA,EAGjBJ,EAAOK,MAAQ,KACXJ,EAAkBK,WAGtBN,EAAOO,gBAAkB,KACrBC,UAAUC,UAAUC,UAAUV,EAAOI,S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AS6I,GAAiBA,QAOxD,CAvTA1N,QACKC,OAAO,2DANI,CACZ,8DACA,oEAKCmC,UAAU,qBAAsB6C,GAErCA,EAA4B7E,QAAU,CAAC,WAAY,uB,UCXnD,SAASuN,EAAYC,GACjB,MAAO,CACHrL,SAAU,IACVsL,QAAS,UACTrM,KAAM,SAAUC,EAAOC,EAASC,EAAMmM,GAClCA,EAAKC,SAASC,QAAQ,SAAUC,GAE5B,GADAH,EAAKI,aAAa,eAAe,IAC5BJ,EAAKK,SAASF,GAAQ,CACvB,MAAMG,EAAQR,EAASS,WAAWJ,EAAOA,EAAMK,YAC/CR,EAAKI,aAAa,cAAeE,EACrC,CACA,OAAOH,CACX,EACJ,EAER,CAzBAjO,QACKC,OAAO,mDAHI,IAIXmC,UAAU,cAAeuL,GAE9BA,EAAYvN,QAAU,CAAC,W","sources":["webpack://root-config/./packages/legacy-workbench/src/js/angular/import/app.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/controllers/import-resource-message-dialog.controller.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-progress-indicator.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-resource-message.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-resource-status-info.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/import-resource-tree.directive.js","webpack://root-config/./packages/legacy-workbench/src/js/angular/import/directives/validate-uri.directive.js"],"sourcesContent":["import 'angular/core/services';\nimport 'angular/core/directives';\nimport 'angular/import/controllers/import-view.controller';\nimport 'angular/import/directives/validate-uri.directive';\nimport 'angular/import/directives/import-progress-indicator.directive';\nimport 'angular/import/directives/import-resource-tree.directive';\nimport 'angular/core/services/repositories.service';\nimport 'ng-file-upload/dist/ng-file-upload.min';\nimport 'ng-file-upload/dist/ng-file-upload-shim.min';\n\nconst modules = [\n 'toastr',\n 'ngRoute',\n 'ngFileUpload',\n 'ui.bootstrap',\n 'graphdb.framework.impex.import.controllers',\n 'graphdb.framework.core.services.repositories',\n 'graphdb.framework.import.directives.validate-uri',\n 'graphdb.framework.import.directives.import-progress-indicator',\n 'graphdb.framework.import.directives.import-resource-tree'\n];\n\nangular.module('graphdb.framework.impex.import', modules);\n","import {LoggerProvider} from \"../../core/services/logger-provider\";\n\nangular\n .module('graphdb.framework.impex.import.controllers.import-resource-message-dialog', [])\n .controller('ImportResourceMessageDialogController', ImportResourceMessageDialogController);\n\nImportResourceMessageDialogController.$inject = ['$scope', '$uibModalInstance', '$translate', 'toastr', 'message'];\n\nconst logger = LoggerProvider.logger;\n\nfunction ImportResourceMessageDialogController($scope, $uibModalInstance, $translate, toastr, message) {\n $scope.message = message;\n\n\n $scope.close = () => {\n $uibModalInstance.dismiss();\n };\n\n $scope.copyToClipboard = () => {\n navigator.clipboard.writeText($scope.message)\n .then(() => {\n toastr.success($translate.instant('import.help.messages.copied_to_clipboard'));\n $scope.close();\n }, (err) => {\n logger.error('Could not copy text: ', err);\n });\n };\n}\n","const modules = [];\n\nangular\n .module('graphdb.framework.import.directives.import-progress-indicator', modules)\n .directive('ImportProgressIndicator', ImportProgressIndicator);\n\nImportProgressIndicator.$inject = [];\n\n// importDirectives.directive('filesOntoLoader',\nfunction ImportProgressIndicator() {\n return {\n link: function (scope, element, attr) {\n scope.$watch('file.status', function () {\n if (scope.file.status === 'IMPORTING' || scope.file.status === 'UPLOADING') {\n if (!$(element).has('object').length > 0) {\n $(element).append('<object width=\"' + attr.size + '\" height=\"' + attr.size + '\" data=\"js/angular/templates/loader/ot-loader.svg?v=3.5.0-TR5\">{{\\'common.loading\\' | translate}}</object>');\n }\n }\n });\n }\n };\n}\n","import 'angular/import/controllers/import-resource-message-dialog.controller';\nimport {ImportResourceStatus} from \"../../models/import/import-resource-status\";\nimport * as stringUtils from \"../../utils/string-utils\";\n\nconst modules = ['graphdb.framework.impex.import.controllers.import-resource-message-dialog'];\n\nangular\n .module('graphdb.framework.import.directives.import-resource-message', modules)\n .directive('importResourceMessage', importResourceMessageDirective);\n\nimportResourceMessageDirective.$inject = ['$uibModal'];\n\nfunction importResourceMessageDirective($uibModal) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/import/templates/import-resource-message.html',\n scope: {\n resource: '='\n },\n link: ($scope) => {\n $scope.ImportResourceStatus = ImportResourceStatus;\n $scope.toTitleCase = (str) => stringUtils.toTitleCase(str);\n\n /**\n *\n * @param {ImportResourceTreeElement} resourceTreeElement\n */\n $scope.showMessage = (resourceTreeElement) => {\n $uibModal.open({\n templateUrl: 'js/angular/import/templates/import-resource-message-dialog.html',\n controller: 'ImportResourceMessageDialogController',\n size: 'lg',\n windowClass: 'import-resource-message-dialog',\n backdrop: 'static',\n resolve: {\n message: function () {\n return resourceTreeElement ? resourceTreeElement.importResource.message : '';\n }\n }\n });\n }\n }\n };\n}\n","const modules = [];\n\nangular\n .module('graphdb.framework.import.directives.import-resource-status-info', modules)\n .directive('importResourceStatusInfo', importResourceStatusInfoDirective);\n\nimportResourceStatusInfoDirective.$inject = ['$rootScope', '$document'];\n\nfunction importResourceStatusInfoDirective($rootScope, $document) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/import/templates/import-resource-status-info.html',\n scope: {\n resource: '='\n },\n link: ($scope) => {\n const subscribers = [];\n\n // =========================\n // Public variables\n // =========================\n $scope.popoverTemplate = 'resourceStatusInfoTemplate.html';\n $scope.popoverIsOpen = false;\n $scope.context = $scope.resource.importResource.context;\n $scope.replaceGraphs = $scope.resource.importResource.replaceGraphs;\n $scope.baseUrl = decodeURIComponent($scope.resource.importResource.baseURI);\n $scope.forceSerial = $scope.resource.importResource.forceSerial;\n $scope.importedOn = $scope.resource.importResource.importedOn;\n $scope.parserSettings = $scope.resource.importResource.parserSettings;\n\n // =========================\n // Public functions\n // =========================\n $scope.open = () => {\n $scope.closeAllDialogs();\n $scope.popoverIsOpen = true;\n };\n\n $scope.closeAllDialogs = () => {\n $rootScope.$broadcast('closePopovers');\n };\n\n $scope.close = () => {\n $scope.popoverIsOpen = false;\n };\n\n const handleEscapeKeyPress = (event) => {\n if (event.key === 'Escape') {\n $scope.$apply(() => {\n $scope.close();\n });\n }\n };\n\n const removeAllSubscribers = () => {\n subscribers.forEach((subscriber) => subscriber());\n };\n\n // =========================\n // Subscriptions\n // =========================\n\n subscribers.push($scope.$on('closePopovers', $scope.close));\n $document.on('keydown', handleEscapeKeyPress);\n\n $scope.$on('$destroy', () => {\n $document.off('keydown', handleEscapeKeyPress);\n removeAllSubscribers();\n });\n }\n };\n}\n","import {ImportResourceStatus} from \"../../models/import/import-resource-status\";\nimport 'angular/import/directives/import-resource-message.directive';\nimport 'angular/import/directives/import-resource-status-info.directive';\nimport {SortingType} from \"../../models/import/sorting-type\";\nimport {ImportResourceTreeElement} from \"../../models/import/import-resource-tree-element\";\nimport {TABS} from \"../services/import-context.service\";\nimport {ImportResourceTreeService} from \"../services/import-resource-tree.service\";\nimport {\n ByteUtils,\n} from \"@ontotext/workbench-api\";\n\nconst TYPE_FILTER_OPTIONS = {\n 'FILE': 'FILE',\n 'DIRECTORY': 'DIRECTORY',\n 'ALL': 'ALL',\n};\n\nconst STATUS_OPTIONS = {\n 'ALL': 'ALL',\n 'NONE': 'NONE',\n 'IMPORTED': 'IMPORTED',\n 'NOT_IMPORTED': 'NOT_IMPORTED',\n};\n\nconst modules = [\n 'graphdb.framework.import.directives.import-resource-message',\n 'graphdb.framework.import.directives.import-resource-status-info',\n];\n\nangular\n .module('graphdb.framework.import.directives.import-resource-tree', modules)\n .directive('importResourceTree', importResourceTreeDirective);\n\nimportResourceTreeDirective.$inject = ['$timeout', 'ImportContextService'];\n\nfunction importResourceTreeDirective($timeout, ImportContextService) {\n return {\n restrict: 'E',\n templateUrl: 'js/angular/import/templates/import-resource-tree.html',\n scope: {\n /**\n * Contains mapping of the column names to label keys. Should contain\n * keys for: name, size, imported, modified, context column names.\n */\n columnKeys: '=',\n /**\n * If the type filter buttons should be visible.\n */\n showTypeFilter: '=',\n /**\n * The default field to sort the resources by.\n */\n sortBy: '=',\n asc: '=',\n onImport: '&',\n onImportAll: '&',\n onReset: '&',\n onRemove: '&',\n onStopImport: '&',\n onEditResource: '&',\n },\n link: ($scope, element, attrs) => {\n // =========================\n // Public variables\n // =========================\n $scope.resources = new ImportResourceTreeElement();\n $scope.displayResources = [];\n $scope.TYPE_FILTER_OPTIONS = TYPE_FILTER_OPTIONS;\n $scope.filterByType = TYPE_FILTER_OPTIONS.ALL;\n $scope.filterByFileName = '';\n $scope.STATUS_OPTIONS = STATUS_OPTIONS;\n $scope.selectedByStatus = undefined;\n $scope.areAllDisplayedImportResourcesSelected = false;\n $scope.areAllDisplayedImportResourcesPartialSelected = false;\n $scope.ImportResourceStatus = ImportResourceStatus;\n $scope.canRemoveResource = angular.isDefined(attrs.onRemove);\n $scope.canResetSelectedResources = false;\n $scope.SORTING_TYPES = SortingType;\n $scope.sortAsc = angular.isDefined(attrs.asc) ? $scope.asc : true;\n $scope.sortedBy = $scope.sortBy;\n $scope.showLoader = ImportContextService.getShowLoader();\n $scope.hasSelection = false;\n\n // =========================\n // Public functions\n // =========================\n\n /**\n * Updates the selection model when a resource is selected or unselected.\n * @param {ImportResourceTreeElement} resource The resource that was selected or unselected.\n */\n $scope.selectionChanged = ((resource) => {\n resource.setSelection(resource.selected);\n updateSelectByStateDropdownModel();\n setCanResetResourcesFlag();\n updateHasSelection();\n });\n\n $scope.selectResourceWithStatus = (resourceStatus) => {\n $scope.selectedByStatus = resourceStatus;\n $scope.resources.setSelection(false);\n\n if (STATUS_OPTIONS.ALL === $scope.selectedByStatus) {\n $scope.resources.setSelection(true);\n } else if (STATUS_OPTIONS.IMPORTED === $scope.selectedByStatus) {\n $scope.resources.selectAllWithStatus([ImportResourceStatus.DONE]);\n } else if (STATUS_OPTIONS.NOT_IMPORTED === $scope.selectedByStatus) {\n $scope.resources.selectAllWithStatus([ImportResourceStatus.IMPORTING, ImportResourceStatus.NONE, ImportResourceStatus.ERROR, ImportResourceStatus.PENDING, ImportResourceStatus.INTERRUPTING]);\n }\n\n updateListedImportResources();\n setCanResetResourcesFlag();\n };\n\n $scope.filterByTypeChanged = (newType) => {\n $scope.filterByType = newType;\n updateListedImportResources();\n };\n\n $scope.filterByFileNameChanged = (filterByFileName) => {\n $scope.filterByFileName = filterByFileName;\n debounce(updateListedImportResources, 100);\n };\n\n /**\n * Resets the status of the selected resources.\n */\n $scope.onResetStatus = () => {\n const resourcesNames = $scope.resources.getAllSelected()\n .map((resource) => resource.path);\n if (resourcesNames.length > 0) {\n $scope.onReset({resources: resourcesNames});\n }\n };\n\n /**\n * Resets the status of the given resource.\n * @param {ImportResourceTreeElement} importResource\n */\n $scope.resetStatus = (importResource) => {\n $scope.onReset({resources: [importResource.path]});\n };\n\n $scope.onRemoveResources = () => {\n const selectedResources = $scope.resources.getAllSelected();\n if (selectedResources && selectedResources.length > 0) {\n $scope.onRemove({resources: selectedResources});\n }\n };\n\n $scope.removeResource = (resource) => {\n $scope.onRemove({resources: [resource]});\n };\n\n $scope.importAll = (withoutChangingSettings) => {\n const selectedResources = $scope.resources.getAllSelectedForImport();\n if (selectedResources.length > 0) {\n $scope.onImportAll({selectedResources: selectedResources, withoutChangingSettings});\n }\n };\n\n $scope.stopImport = (importResource) => {\n $scope.onStopImport({resource: importResource});\n };\n\n /**\n * Sorts resources by provided sorting type.\n * @param {SortingType} sortedBy The sorting type to use.\n */\n $scope.sort = (sortedBy) => {\n if ($scope.sortedBy === sortedBy) {\n $scope.sortAsc = !$scope.sortAsc;\n } else {\n $scope.sortAsc = true;\n }\n $scope.sortedBy = sortedBy;\n updateListedImportResources();\n };\n\n $scope.editResource = (resource) => {\n $scope.onEditResource({resource});\n };\n\n // =========================\n // Private functions\n // =========================\n\n /**\n * Sets the flag showing if any of the selected resources is already imported\n * and can have their states reset.\n */\n const setCanResetResourcesFlag = () => {\n $scope.canResetSelectedResources = $scope.resources.getSelectedImportedResources();\n };\n\n const updateListedImportResources = () => {\n $scope.resources.getRoot().updateSelectionState();\n sortResources();\n $scope.displayResources = $scope.resources.toList()\n .filter(filterByType)\n .filter(filterByName);\n\n updateHasSelection();\n updateSelectByStateDropdownModel();\n };\n\n const updateHasSelection = () => {\n const allSelectedFilesNames = $scope.resources.getAllSelectedFilesNames();\n $scope.hasSelection = allSelectedFilesNames.length > 0;\n ImportContextService.updateSelectedFilesNames(allSelectedFilesNames);\n };\n\n const updateSelectByStateDropdownModel = () => {\n const hasUnselectedDisplayedImportResource = $scope.displayResources.some((resource) => !resource.selected);\n const hasSelectedDisplayedImportResource = $scope.displayResources.some((resource) => resource.selected);\n $scope.areAllDisplayedImportResourcesSelected = hasSelectedDisplayedImportResource && !hasUnselectedDisplayedImportResource;\n $scope.areAllDisplayedImportResourcesPartialSelected = hasSelectedDisplayedImportResource && hasUnselectedDisplayedImportResource;\n };\n\n const sortResources = () => {\n if (SortingType.NAME === $scope.sortedBy) {\n $scope.resources.sort(compareByName($scope.sortAsc));\n } else if (SortingType.SIZE === $scope.sortedBy) {\n $scope.resources.sort(compareBySize($scope.sortAsc));\n } else if (SortingType.MODIFIED === $scope.sortedBy) {\n $scope.resources.sort(compareByModified($scope.sortAsc));\n } else if (SortingType.IMPORTED === $scope.sortedBy) {\n $scope.resources.sort(compareByImportedOn($scope.sortAsc));\n } else if (SortingType.CONTEXT === $scope.sortedBy) {\n $scope.resources.sort(compareByContext($scope.sortAsc));\n }\n };\n\n const compareByName = (acs) => (r1, r2) => {\n return acs ? r1.importResource.name.localeCompare(r2.importResource.name) : r2.importResource.name.localeCompare(r1.importResource.name);\n };\n\n const compareBySize = (acs) => (r1, r2) => {\n // The format of size returned by the backend has changed, but we need to keep the old format for backward compatibility.\n // Therefore, we convert the size to always be in bytes.\n const r1Size = ByteUtils.convertToBytes(r1.importResource.size);\n const r2Size = ByteUtils.convertToBytes(r2.importResource.size);\n return acs ? r1Size - r2Size : r2Size - r1Size;\n };\n\n const compareByModified = (acs) => (r1, r2) => {\n const r1ModifiedOn = r1.importResource.modifiedOn || Number.MAX_VALUE;\n const r2ModifiedOn = r2.importResource.modifiedOn || Number.MAX_VALUE;\n return acs ? r1ModifiedOn - r2ModifiedOn : r2ModifiedOn - r1ModifiedOn;\n };\n\n const compareByImportedOn = (acs) => (r1, r2) => {\n const r1ImportedOn = r1.importResource.importedOn || Number.MAX_VALUE;\n const r2ImportedOn = r2.importResource.importedOn || Number.MAX_VALUE;\n return acs ? r1ImportedOn - r2ImportedOn : r2ImportedOn - r1ImportedOn;\n };\n\n const compareByContext = (acs) => (r1, r2) => {\n return acs ? r1.importResource.context.localeCompare(r2.importResource.context) : r2.importResource.context.localeCompare(r1.importResource.context);\n };\n\n const filterByType = (resource) => {\n if (TYPE_FILTER_OPTIONS.ALL === $scope.filterByType) {\n return true;\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.FILE) {\n return resource.isFile();\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.DIRECTORY) {\n return resource.isDirectory();\n }\n\n return false;\n };\n\n const filterByName = (resource) => {\n if (!$scope.filterByFileName) {\n return true;\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.DIRECTORY) {\n return resource.hasTextInDirectoriesName($scope.filterByFileName);\n }\n\n if ($scope.filterByType === TYPE_FILTER_OPTIONS.FILE) {\n return resource.hasTextInFilesName($scope.filterByFileName);\n }\n return resource.hasTextInResourcesName($scope.filterByFileName);\n };\n\n let debounceTimeout;\n const debounce = (func, delay) => {\n // Clear previous timeout\n if (debounceTimeout) {\n $timeout.cancel(debounceTimeout);\n }\n\n // Set new timeout\n debounceTimeout = $timeout(func, delay);\n };\n\n // =========================\n // Subscription handlers\n // =========================\n\n const onResourcesUpdatedHandler = (newResources = []) => {\n const isUserImport = TABS.USER === ImportContextService.getActiveTabId();\n if ($scope.resources.isEmpty()) {\n $scope.resources = ImportResourceTreeService.toImportResourceTree(newResources, isUserImport);\n if (isUserImport) {\n $scope.sortedBy = SortingType.MODIFIED;\n }\n } else {\n ImportResourceTreeService.mergeResourceTree($scope.resources, newResources, isUserImport);\n }\n ImportResourceTreeService.calculateElementIndent($scope.resources);\n ImportResourceTreeService.setupAfterTreeInitProperties($scope.resources);\n updateListedImportResources();\n setCanResetResourcesFlag();\n };\n\n // =========================\n // Subscriptions\n // =========================\n const subscriptions = [];\n\n subscriptions.push(ImportContextService.onResourcesUpdated(onResourcesUpdatedHandler));\n subscriptions.push(ImportContextService.onShowLoaderUpdated((showLoader) => $scope.showLoader = showLoader));\n subscriptions.push(ImportContextService.onActiveTabIdUpdated(() => $scope.resources = new ImportResourceTreeElement()));\n\n const removeAllSubscribers = () => {\n subscriptions.forEach((subscription) => subscription());\n };\n\n // Deregister the watcher when the scope/directive is destroyed\n $scope.$on('$destroy', removeAllSubscribers);\n },\n };\n}\n","/**\n * This AngularJS directive validates whether an input value is a valid URI (IRI).\n *\n * @directive validateUri\n * @restrict A (Attribute)\n * @requires ngModel\n *\n * @example\n * <input type=\"text\" name=\"url\" ng-model=\"url\" validate-uri>\n */\nconst modules = [];\n\nangular\n .module('graphdb.framework.import.directives.validate-uri', modules)\n .directive('validateUri', validateUri);\n\nvalidateUri.$inject = ['UriUtils'];\n\n/**\n * @function validateUri\n * @param {UriUtils} UriUtils - Service for URI validation.\n */\nfunction validateUri(UriUtils) {\n return {\n restrict: 'A',\n require: 'ngModel',\n link: function (scope, element, attr, ctrl) {\n ctrl.$parsers.unshift(function (value) {\n ctrl.$setValidity('validateUri', true);\n if (!ctrl.$isEmpty(value)) {\n const valid = UriUtils.isValidIri(value, value.toString());\n ctrl.$setValidity('validateUri', valid);\n }\n return value;\n });\n }\n };\n}\n"],"names":["angular","module","controller","ImportResourceMessageDialogController","$inject","logger","LoggerProvider","$scope","$uibModalInstance","$translate","toastr","message","close","dismiss","copyToClipboard","navigator","clipboard","writeText","then","success","instant","err","error","ImportProgressIndicator","link","scope","element","attr","$watch","file","status","$","has","length","append","size","directive","importResourceMessageDirective","$uibModal","restrict","templateUrl","resource","ImportResourceStatus","toTitleCase","str","stringUtils","showMessage","resourceTreeElement","open","windowClass","backdrop","resolve","importResource","importResourceStatusInfoDirective","$rootScope","$document","subscribers","popoverTemplate","popoverIsOpen","context","replaceGraphs","baseUrl","decodeURIComponent","baseURI","forceSerial","importedOn","parserSettings","closeAllDialogs","$broadcast","handleEscapeKeyPress","event","key","$apply","push","$on","on","off","forEach","subscriber","TYPE_FILTER_OPTIONS","STATUS_OPTIONS","importResourceTreeDirective","$timeout","ImportContextService","columnKeys","showTypeFilter","sortBy","asc","onImport","onImportAll","onReset","onRemove","onStopImport","onEditResource","attrs","resources","ImportResourceTreeElement","displayResources","filterByType","ALL","filterByFileName","selectedByStatus","undefined","areAllDisplayedImportResourcesSelected","areAllDisplayedImportResourcesPartialSelected","canRemoveResource","isDefined","canResetSelectedResources","SORTING_TYPES","SortingType","sortAsc","sortedBy","showLoader","getShowLoader","hasSelection","selectionChanged","setSelection","selected","updateSelectByStateDropdownModel","setCanResetResourcesFlag","updateHasSelection","selectResourceWithStatus","resourceStatus","IMPORTED","selectAllWithStatus","DONE","NOT_IMPORTED","IMPORTING","NONE","ERROR","PENDING","INTERRUPTING","updateListedImportResources","filterByTypeChanged","newType","filterByFileNameChanged","debounce","onResetStatus","resourcesNames","getAllSelected","map","path","resetStatus","onRemoveResources","selectedResources","removeResource","importAll","withoutChangingSettings","getAllSelectedForImport","stopImport","sort","editResource","getSelectedImportedResources","getRoot","updateSelectionState","sortResources","toList","filter","filterByName","allSelectedFilesNames","getAllSelectedFilesNames","updateSelectedFilesNames","hasUnselectedDisplayedImportResource","some","hasSelectedDisplayedImportResource","NAME","compareByName","SIZE","compareBySize","MODIFIED","compareByModified","compareByImportedOn","CONTEXT","compareByContext","acs","r1","r2","name","localeCompare","r1Size","ByteUtils","convertToBytes","r2Size","r1ModifiedOn","modifiedOn","Number","MAX_VALUE","r2ModifiedOn","r1ImportedOn","r2ImportedOn","FILE","isFile","DIRECTORY","isDirectory","hasTextInDirectoriesName","hasTextInFilesName","hasTextInResourcesName","debounceTimeout","func","delay","cancel","subscriptions","onResourcesUpdated","onResourcesUpdatedHandler","newResources","isUserImport","TABS","USER","getActiveTabId","isEmpty","ImportResourceTreeService","toImportResourceTree","mergeResourceTree","calculateElementIndent","setupAfterTreeInitProperties","onShowLoaderUpdated","onActiveTabIdUpdated","removeAllSubscribers","subscription","validateUri","UriUtils","require","ctrl","$parsers","unshift","value","$setValidity","$isEmpty","valid","isValidIri","toString"],"sourceRoot":""}
|