Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Luigi headless #3967

Draft
wants to merge 63 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
b9ec01d
durchstich
hardl Jun 13, 2024
5a94eff
prettier
hardl Jun 13, 2024
1d87c95
Merge branch 'main' into luigi-headless
hardl Jun 13, 2024
b6c7110
handle no topnav children
hardl Jun 14, 2024
fbe5da7
simpledev template
hardl Jun 14, 2024
8ae81b4
prettier
hardl Jun 14, 2024
19b9047
Merge branch 'main' into luigi-headless
hardl Jul 12, 2024
912ad64
Merge branch 'main' into luigi-headless
hardl Jul 22, 2024
53bd426
restructureing
hardl Jul 29, 2024
7a25a24
Merge branch 'main' into luigi-headless
hardl Sep 23, 2024
bb80947
Merge branch 'main' into luigi-headless
hardl Oct 1, 2024
710a65c
Merge branch 'main' into luigi-headless
hardl Oct 7, 2024
2a7f8f3
Merge branch 'main' into luigi-headless
hardl Oct 10, 2024
286c3bf
some restructuring, logo click in example
hardl Oct 10, 2024
c045a9a
simple redirect
hardl Oct 10, 2024
c1c7dd4
template update
hardl Oct 11, 2024
0f12c8d
categories
hardl Oct 11, 2024
f83c95e
prettier
hardl Oct 11, 2024
ad8dd0a
cat expanded state
hardl Oct 11, 2024
f184b10
prettier
hardl Oct 11, 2024
c16e663
trying to prevent cat selection
hardl Oct 14, 2024
85ec2bb
prettier
hardl Oct 14, 2024
d4f9e69
Merge branch 'main' into luigi-headless
hardl Oct 15, 2024
b56c135
Merge branch 'main' into luigi-headless
hardl Oct 18, 2024
026cacf
move main layout rendering to connector
hardl Oct 18, 2024
8925804
prettier
hardl Oct 18, 2024
06eedc7
modals poc
hardl Oct 18, 2024
29a671f
poc partial update (shellbar)
hardl Oct 23, 2024
4e28714
prettier
hardl Oct 23, 2024
6a44dc6
Merge branch 'main' into luigi-headless
hardl Oct 23, 2024
e37bdda
migrate to svelte 5
hardl Oct 25, 2024
2493c44
prettier
hardl Oct 25, 2024
2efd1f1
svelte vs. prettier
hardl Oct 25, 2024
06dbb76
prettier
hardl Oct 25, 2024
dd6ed64
Merge branch 'main' into luigi-headless
hardl Oct 31, 2024
a5ae5c9
ts generation
hardl Nov 5, 2024
6932deb
Merge branch 'main' into luigi-headless
hardl Nov 5, 2024
32d7fc4
Merge branch 'main' into luigi-headless
hardl Nov 5, 2024
fae153d
Merge branch 'main' into luigi-headless
hardl Nov 11, 2024
0c0c72d
cleanup
hardl Nov 13, 2024
df3dfae
Merge branch 'main' into luigi-headless
hardl Nov 13, 2024
e06bd23
ModalSettings type + callback for renderModal
JohannesDoberer Nov 13, 2024
8ba2b82
prettier
JohannesDoberer Nov 13, 2024
5148b48
Merge branch 'luigi-headless' of github.com:SAP/luigi into luigi-head…
JohannesDoberer Nov 13, 2024
27f9296
missing type
JohannesDoberer Nov 13, 2024
8145979
ts update
hardl Nov 13, 2024
31dde26
verbatim hmhmhm
hardl Nov 13, 2024
a917621
Merge branch 'main' into luigi-headless
hardl Nov 13, 2024
8112901
added script cmd for temp releases
hardl Nov 15, 2024
1c388f7
Merge branch 'main' into luigi-headless
hardl Nov 19, 2024
4e2e40b
headless tabnav
JohannesDoberer Nov 19, 2024
4cf6637
prettier
JohannesDoberer Nov 19, 2024
8a07886
Merge branch 'luigi-headless' into tabNav
JohannesDoberer Nov 19, 2024
ca7b916
viewgroup/iframe caching preps
hardl Nov 19, 2024
e5c3834
prettier
hardl Nov 19, 2024
e3e38ca
productSwitcher
JohannesDoberer Nov 20, 2024
551bebd
prettier
JohannesDoberer Nov 20, 2024
1779ed5
Merge branch 'luigi-headless' into productswitcher
JohannesDoberer Nov 20, 2024
1c4535e
Merge branch 'luigi-headless' into tabNav
JohannesDoberer Nov 20, 2024
4f1e620
tab nav
JohannesDoberer Nov 22, 2024
551e328
prettier
JohannesDoberer Nov 22, 2024
b4585f8
events - nav only for now
hardl Nov 22, 2024
ec8ab1d
prettier
hardl Nov 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions core-modular/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# dependencies
/node_modules

# testing
/coverage
/.nyc_output

# production
/build
/public

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

.idea

npm-debug.log*
yarn-debug.log*
yarn-error.log*

.vscode/
/public*/luigi*.css
/public*/luigi*.js
/public*/*.woff
/public*/*.woff2
/public*/*.ttf

# maps
*.map

/dev-tools/simple-app
5 changes: 5 additions & 0 deletions core-modular/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Luigi Modular Core

## Overview

Luigi Core, headless, modular. WIP
96 changes: 96 additions & 0 deletions core-modular/dev-tools/simple-app_bak/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Luigi Headless</title>

<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1"
/>

<script
src="https://ui5-community.github.io/ui5-webcomponents-bundle/assets/bundle.esm.js"
type="module"
></script>
<script src="https://unpkg.com/@luigi-project/container" type="module"></script>

<script data-ui5-config type="application/json">
{ "theme": "sap_horizon" }
</script>
<link rel="stylesheet" href="/luigi-ui/lui.css" />
</head>

<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<script src="/public/luigi.js"></script>
<script src="/luigi-ui/lui-ui5wc.js"></script>
<script src="/luigi-config.js"></script>

<div class="tool-layout">
<ui5-shellbar>
<!-- <ui5-button icon="menu" slot="startButton" id="toggle"></ui5-button>
<ui5-avatar slot="profile" icon="customer"></ui5-avatar>
<img
slot="logo"
src="https://sap.github.io/ui5-webcomponents/images/sap-logo-svg.svg"
/>
<ui5-shellbar-item icon="area-chart" text="Node"></ui5-shellbar-item> -->
</ui5-shellbar>

<ui5-side-navigation>
<!--<ui5-side-navigation-item
text="Home"
icon="home"
></ui5-side-navigation-item>
<ui5-side-navigation-item text="People" expanded icon="group">
<ui5-side-navigation-sub-item
text="From My Team"
></ui5-side-navigation-sub-item>
<ui5-side-navigation-sub-item
text="From Other Team"
></ui5-side-navigation-sub-item>
</ui5-side-navigation-item>
<ui5-side-navigation-item
text="Locations"
icon="locate-me"
selected
></ui5-side-navigation-item>
<ui5-side-navigation-item text="Events" icon="calendar">
<ui5-side-navigation-sub-item
text="Local"
></ui5-side-navigation-sub-item>
<ui5-side-navigation-sub-item
text="Others"
></ui5-side-navigation-sub-item>
<ui5-side-navigation-sub-item
text="External Link"
href="https://sap.com"
target="_blank"
>
</ui5-side-navigation-sub-item>
</ui5-side-navigation-item>
<ui5-side-navigation-item
slot="fixedItems"
text="Useful Links"
icon="chain-link"
>
<ui5-side-navigation-sub-item
text="External Link"
href="https://sap.com"
target="_blank"
>
</ui5-side-navigation-sub-item>
</ui5-side-navigation-item>
<ui5-side-navigation-item
slot="fixedItems"
text="History"
icon="history"
>
</ui5-side-navigation-item>-->
</ui5-side-navigation>

<div class="content"></div>
</div>
</body>
</html>
42 changes: 42 additions & 0 deletions core-modular/dev-tools/simple-app_bak/luigi-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
window.onload = () => {
window.Luigi.setConfig({
navigation: {
nodes: [
{
pathSegment: 'home',
icon: 'home',
viewUrl: '/microfrontend.html#home',
children: [
{
pathSegment: 'c1',
label: 'MFE1',
icon: 'group',
viewUrl: '/microfrontend.html#child1'
},
{
pathSegment: 'c2',
label: 'MFE2',
icon: 'calendar',
viewUrl: '/microfrontend.html#child2'
}
]
},
{
pathSegment: 'help',
icon: 'sys-help',
viewUrl: '/microfrontend.html#help'
}
]
},
routing: {
useHashRouting: true
},
settings: {
responsiveNavigation: 'Fiori3',
header: {
title: 'Luigi Headless POC',
logo: 'https://fiddle.luigi-project.io/img/luigi.svg'
}
}
});
};
80 changes: 80 additions & 0 deletions core-modular/dev-tools/simple-app_bak/luigi-ui/lui-ui5wc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
const connector = {
renderTopNav: topNavData => {
const shellbar = document.querySelector('.tool-layout > ui5-shellbar');
shellbar.setAttribute('primary-title', topNavData.appTitle);
let html = '';
html += '<ui5-button icon="menu" slot="startButton" id="toggle"></ui5-button>';
if (topNavData.logo) {
html += `<img
slot="logo"
src="${topNavData.logo}"
/>`;
}
(topNavData.topNodes || []).forEach(n => {
html += `<ui5-shellbar-item icon="${n.icon}" text="${n.label}" luigi-route="${n.pathSegment}"></ui5-shellbar-item>`;
});
shellbar.innerHTML = html;
const items = shellbar.querySelectorAll('ui5-shellbar-item');
if (items) {
items.forEach(item => {
item.addEventListener('click', () => {
Luigi.navigation().navigate(item.getAttribute('luigi-route'));
});
});
}
//...
},
renderLeftNav: leftNavData => {
const sidenav = document.querySelector('ui5-side-navigation');
const burger = document.getElementById('toggle');
if (sidenav && burger) {
if (!burger._clickListener) {
burger._clickListener = () => {
sidenav.toggleAttribute('collapsed');
};
burger.addEventListener('click', burger._clickListener);
}

let html = '';

if (leftNavData.items) {
leftNavData.items.forEach(item => {
if (item.node) {
html += `<ui5-side-navigation-item
text="${item.node.label}"
icon="${item.node.icon}"
luigi-route="${leftNavData.basePath + '/' + item.node.pathSegment}"
${item.selected ? 'selected' : ''}
></ui5-side-navigation-item>`;
} else if (item.category) {
// tbd
}
});
}

document.body.classList.toggle('left-nav-hidden', !(leftNavData.items?.length > 0));
sidenav.innerHTML = html;

const items = sidenav.querySelectorAll('[luigi-route]');
if (items) {
items.forEach(item => {
item.addEventListener('click', () => {
Luigi.navigation().navigate(item.getAttribute('luigi-route'));
});
});
}
}
},
renderContent: navNode => {
const contentContainer = document.querySelector('.tool-layout > .content');
contentContainer.innerHTML = '';
const lc = document.createElement('luigi-container');
lc.setAttribute('viewUrl', navNode.viewUrl);
lc.webcomponent = navNode.webcomponent;
lc.context = navNode.context;
contentContainer.appendChild(lc);
}
};

// eslint-disable-next-line no-undef
Luigi.bootstrap(connector);
52 changes: 52 additions & 0 deletions core-modular/dev-tools/simple-app_bak/luigi-ui/lui.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
html,
body {
margin: 0;
position: relativ;
height: 100%;
background: var(--sapBackgroundColor);
}

ui5-side-navigation {
min-height: 0;
}

.left-nav-hidden ui5-side-navigation,
.left-nav-hidden ui5-shellbar #toggle {
display: none;
}

.left-nav-hidden .content {
grid-column: 1 / span 2;
}

ui5-shellbar::part(root) {
padding-inline-start: 0.75rem;
padding-inline-end: 1.25rem;
border-radius: 0.5rem;
box-shadow: 0 0 0.125rem 0 color-mix(in srgb, var(--sapContent_ShadowColor) 16%, transparent),
0 0.5rem 1rem 0 color-mix(in srgb, var(--sapContent_ShadowColor) 16%, transparent);
}

.tool-layout {
height: 100%;
box-sizing: border-box;
padding: 0.5rem 0.5rem 0 0.5rem;
/* background: color-mix(in srgb, black 4%, var(--sapBackgroundColor)); */
display: grid;
gap: 0.5rem;
grid-template-rows: auto 1fr;
grid-template-columns: auto 1fr;
}

ui5-shellbar {
grid-column: 1 / span 2;
grid-row: 1 / 2;
}

.content {
position: relative;
background: var(--sapBackgroundColor);
border-radius: 0.5rem 0.5rem 0 0;
box-shadow: 0 0 0.125rem 0 color-mix(in srgb, var(--sapContent_ShadowColor) 16%, transparent),
0 0.5rem 1rem 0 color-mix(in srgb, var(--sapContent_ShadowColor) 16%, transparent);
}
31 changes: 31 additions & 0 deletions core-modular/dev-tools/simple-app_bak/microfrontend.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<meta charset="utf-8" />
<link
href="https://unpkg.com/@luigi-project/core/luigi_horizon.css"
rel="stylesheet"
/>

<style>
body {
font-family: var(--sapFontFamily);
text-align: center;
color: #515559;
}
</style>
</head>

<body>
<div>
<h1>Luigi Simple Development Template</h1>
<p>Some content</p>
</div>
<script>
let div = document.createElement('div');
div.innerHTML = location.hash;
document.body.appendChild(div);
</script>
</body>
</html>
Loading
Loading