Skip to content
Snippets Groups Projects
Commit 74d209bf authored by Neuber, Eugen Ramon's avatar Neuber, Eugen Ramon :speech_balloon: Committed by Reiter, Christoph
Browse files

Remove CDNJS.CLOUDFLARE for bulma.css

parent 00ffb46a
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,14 @@ ...@@ -4,7 +4,14 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<script type="module" id="vpu-knowledge-base-web-page-element-view-wc-src" src="bundle.js"></script> <script type="module" id="vpu-knowledge-base-web-page-element-view-wc-src" src="bundle.js"></script>
</head> </head>
<style>
vpu-knowledge-base-web-page-element-view-demo {
--KBBorderRadius: 10px;
--KBBorder: 2px dashed red;
--KBMargin: 20px;
--KBPadding: 5px;
}
</style>
<body> <body>
<vpu-knowledge-base-web-page-element-view-demo lang="de"></vpu-knowledge-base-web-page-element-view-demo> <vpu-knowledge-base-web-page-element-view-demo lang="de"></vpu-knowledge-base-web-page-element-view-demo>
......
...@@ -3,31 +3,37 @@ ...@@ -3,31 +3,37 @@
"version": "1.0.0", "version": "1.0.0",
"main": "src/index.js", "main": "src/index.js",
"devDependencies": { "devDependencies": {
"chai": "^4.2.0",
"i18next-scanner": "^2.10.2",
"karma": "^4.2.0", "karma": "^4.2.0",
"karma-chai": "^0.1.0", "karma-chai": "^0.1.0",
"karma-chrome-launcher": "^3.0.0", "karma-chrome-launcher": "^3.0.0",
"karma-mocha": "^1.3.0", "karma-mocha": "^1.3.0",
"mocha": "^6.2.0",
"node-sass": "^4.12.0", "node-sass": "^4.12.0",
"puppeteer": "^1.15.0", "puppeteer": "^1.15.0",
"mocha": "^6.2.0", "rollup": "^1.20.0",
"chai": "^4.2.0",
"rollup": "^1.11.3",
"rollup-plugin-commonjs": "^10.0.2", "rollup-plugin-commonjs": "^10.0.2",
"rollup-plugin-consts": "^1.0.1", "rollup-plugin-consts": "^1.0.1",
"rollup-plugin-copy": "^3.1.0", "rollup-plugin-copy": "^3.1.0",
"rollup-plugin-delete": "^1.1.0",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-multi-entry": "^2.1.0",
"rollup-plugin-node-resolve": "^5.2.0", "rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-postcss": "^2.0.3", "rollup-plugin-postcss": "^2.0.3",
"rollup-plugin-replace": "^2.2.0",
"rollup-plugin-serve": "^1.0.1", "rollup-plugin-serve": "^1.0.1",
"rollup-plugin-terser": "^5.1.1", "rollup-plugin-terser": "^5.1.1",
"rollup-plugin-json": "^4.0.0", "rollup-plugin-url": "^2.2.2",
"rollup-plugin-multi-entry": "^2.1.0",
"i18next-scanner": "^2.10.2",
"vpu-auth": "file:./vendor/auth", "vpu-auth": "file:./vendor/auth",
"vpu-common": "file:./vendor/common" "vpu-common": "file:./vendor/common"
}, },
"dependencies": { "dependencies": {
"bulma": "^0.7.5",
"i18next": "^17.0.3",
"lit-element": "^2.1.0", "lit-element": "^2.1.0",
"lit-html": "^1.1.1" "lit-html": "^1.1.1",
"material-design-icons-svg": "^3.0.0"
}, },
"scripts": { "scripts": {
"clean": "rm dist/*", "clean": "rm dist/*",
......
import path from 'path'; import path from 'path';
import resolve from 'rollup-plugin-node-resolve'; import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs'; import commonjs from 'rollup-plugin-commonjs';
import postcss from 'rollup-plugin-postcss';
import copy from 'rollup-plugin-copy'; import copy from 'rollup-plugin-copy';
import {terser} from "rollup-plugin-terser"; import {terser} from "rollup-plugin-terser";
import json from 'rollup-plugin-json'; import json from 'rollup-plugin-json';
import serve from 'rollup-plugin-serve'; import serve from 'rollup-plugin-serve';
import multiEntry from 'rollup-plugin-multi-entry'; import multiEntry from 'rollup-plugin-multi-entry';
import url from "rollup-plugin-url";
import consts from 'rollup-plugin-consts'; import consts from 'rollup-plugin-consts';
import del from 'rollup-plugin-delete';
const build = (typeof process.env.BUILD !== 'undefined') ? process.env.BUILD : 'local'; const build = (typeof process.env.BUILD !== 'undefined') ? process.env.BUILD : 'local';
console.log("build: " + build); console.log("build: " + build);
...@@ -19,6 +20,9 @@ export default { ...@@ -19,6 +20,9 @@ export default {
format: 'esm' format: 'esm'
}, },
plugins: [ plugins: [
del({
targets: 'dist/*'
}),
multiEntry(), multiEntry(),
consts({ consts({
environment: build, environment: build,
...@@ -33,10 +37,14 @@ export default { ...@@ -33,10 +37,14 @@ export default {
include: 'node_modules/**' include: 'node_modules/**'
}), }),
json(), json(),
postcss({ url({
inject: false, limit: 0,
minimize: false, include: [
plugins: [] "node_modules/bulma/**/*.css",
"node_modules/bulma/**/*.sass",
],
emitFiles: true,
fileName: 'shared/[name].[hash][extname]'
}), }),
(build !== 'local' && build !== 'test') ? terser() : false, (build !== 'local' && build !== 'test') ? terser() : false,
copy({ copy({
......
import 'vpu-auth';
import './vpu-kb-wpe-view.js';
import {i18n} from './i18n'; import {i18n} from './i18n';
import {html, LitElement} from 'lit-element'; import {html, LitElement} from 'lit-element';
import 'vpu-auth';
import './vpu-kb-wpe-view';
import * as commonUtils from 'vpu-common/utils'; import * as commonUtils from 'vpu-common/utils';
import bulmaCSSPath from "bulma/css/bulma.min.css";
import * as utils from "./utils";
class KnowledgeBaseWebPageElementViewDemo extends LitElement { class KnowledgeBaseWebPageElementViewDemo extends LitElement {
constructor() { constructor() {
...@@ -27,17 +29,27 @@ class KnowledgeBaseWebPageElementViewDemo extends LitElement { ...@@ -27,17 +29,27 @@ class KnowledgeBaseWebPageElementViewDemo extends LitElement {
} }
render() { render() {
const bulmaCSS = utils.getAssetURL(bulmaCSSPath);
return html` return html`
<link rel="stylesheet" href="${bulmaCSS}">
<style> <style>
vpu-knowledge-base-web-page-element-view.clean {
--KBBorder: initial;
--KBBorderRadius: initial;
--KBMargin: initial;
--KBPadding: initial;
}
vpu-knowledge-base-web-page-element-view.opt {
--KBBorder: 2px solid blue;
}
</style> </style>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.5/css/bulma.min.css">
<section class="section"> <section class="section">
<div class="content"> <div class="content">
<h1 class="title">KnowledgeBaseWebPageElementView-Demo</h1> <h1 class="title">KnowledgeBaseWebPageElementView-Demo</h1>
</div> </div>
<div class="content"> <div class="content">
<vpu-auth lang="${this.lang}" client-id="${commonUtils.setting('keyCloakClientId')}" load-person force-login></vpu-auth> <vpu-auth lang="${this.lang}" client-id="${commonUtils.setting('keyCloakClientId')}" load-person remember-login></vpu-auth>
</div> </div>
<div class="content"> <div class="content">
<h2 class="subtitle">Deutsch</h2> <h2 class="subtitle">Deutsch</h2>
...@@ -58,7 +70,7 @@ class KnowledgeBaseWebPageElementViewDemo extends LitElement { ...@@ -58,7 +70,7 @@ class KnowledgeBaseWebPageElementViewDemo extends LitElement {
<div class="content"> <div class="content">
<p>ohne Text in der WebComponent:</p> <p>ohne Text in der WebComponent:</p>
Kontaktieren Sie uns unter... Kontaktieren Sie uns unter...
<vpu-knowledge-base-web-page-element-view lang="${this.lang}" value="abc/def/klm"></vpu-knowledge-base-web-page-element-view> <vpu-knowledge-base-web-page-element-view class="opt" lang="${this.lang}" value="abc/def/klm"></vpu-knowledge-base-web-page-element-view>
</div> </div>
</section> </section>
`; `;
......
export const getAssetURL = (path) => {
const elm = document.getElementById('vpu-knowledge-base-web-page-element-view-wc-src');
if (!elm)
return path;
const url = elm.src;
// newer browsers only
//var url = import.meta.url;
return new URL(path, url).href;
};
...@@ -2,9 +2,11 @@ import {i18n} from './i18n'; ...@@ -2,9 +2,11 @@ import {i18n} from './i18n';
import {html} from 'lit-element'; import {html} from 'lit-element';
// import JSONLD from 'vpu-common/jsonld'; // import JSONLD from 'vpu-common/jsonld';
import VPULitElement from 'vpu-common/vpu-lit-element' import VPULitElement from 'vpu-common/vpu-lit-element'
import * as commonUtils from "vpu-common/utils";
import "vpu-common/vpu-mini-spinner.js"; import "vpu-common/vpu-mini-spinner.js";
import * as commonUtils from "vpu-common/utils";
import {unsafeHTML} from 'lit-html/directives/unsafe-html.js'; import {unsafeHTML} from 'lit-html/directives/unsafe-html.js';
import bulmaCSSPath from "bulma/css/bulma.min.css";
import * as utils from "./utils";
/** /**
* KnowledgeBaseWebPageElementView web component * KnowledgeBaseWebPageElementView web component
...@@ -155,10 +157,17 @@ class VPUKnowledgeBaseWebPageElementView extends VPULitElement { ...@@ -155,10 +157,17 @@ class VPUKnowledgeBaseWebPageElementView extends VPULitElement {
render() { render() {
//<link rel="stylesheet" href="${this.css}"> //<link rel="stylesheet" href="${this.css}">
const bulmaCSS = utils.getAssetURL(bulmaCSSPath);
return html` return html`
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.5/css/bulma.min.css"> <link rel="stylesheet" href="${bulmaCSS}">
<style> <style>
.kb {display: none} .kb {
display: none;
border-radius: var(--KBBorderRadius, 0);
border: var(--KBBorder, 0);
margin: var(--KBMargin, 0);
padding: var(--KBPadding, 0);
}
span.has-text img {margin-left: 5px} span.has-text img {margin-left: 5px}
span.with-pointer { cursor: pointer; } span.with-pointer { cursor: pointer; }
</style> </style>
......
auth @ 33f040f4
Subproject commit 6a6413f48e0cd5508546841905f73a9486211bd0 Subproject commit 33f040f4a2cedef5ea468f88dbd93210277bb67e
common @ 5e3da6e2
Subproject commit f65096b99b737a046d07ad6616eec31788850422 Subproject commit 5e3da6e22fd0d14b95fbc032d385c020ae47fba7
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment