feat(app): initialize product shell
This commit is contained in:
+21
@@ -0,0 +1,21 @@
|
||||
.nogit/
|
||||
|
||||
# artifacts
|
||||
coverage/
|
||||
public/
|
||||
|
||||
# installs
|
||||
node_modules/
|
||||
|
||||
# caches
|
||||
.yarn/
|
||||
.cache/
|
||||
.rpt2_cache
|
||||
|
||||
# builds
|
||||
dist/
|
||||
dist_*/
|
||||
|
||||
# AI
|
||||
.claude/
|
||||
.serena/
|
||||
@@ -0,0 +1,62 @@
|
||||
{
|
||||
"gitzone": {
|
||||
"projectType": "website",
|
||||
"module": {
|
||||
"githost": "code.foss.global",
|
||||
"gitscope": "signature.digital",
|
||||
"gitrepo": "app",
|
||||
"description": "Product application shell for signature.digital.",
|
||||
"npmPackagename": "@signature.digital/app",
|
||||
"license": "MIT",
|
||||
"projectDomain": "signature.digital"
|
||||
}
|
||||
},
|
||||
"npmci": {
|
||||
"npmGlobalTools": []
|
||||
},
|
||||
"@git.zone/tsbundle": {
|
||||
"bundles": [
|
||||
{
|
||||
"from": "./ts_web/index.ts",
|
||||
"to": "./dist_serve/bundle.js",
|
||||
"outputMode": "bundle",
|
||||
"bundler": "esbuild",
|
||||
"production": true,
|
||||
"includeFiles": ["./html/index.html"]
|
||||
}
|
||||
]
|
||||
},
|
||||
"@git.zone/tswatch": {
|
||||
"server": {
|
||||
"enabled": true,
|
||||
"port": 3002,
|
||||
"serveDir": "./dist_serve/",
|
||||
"liveReload": true
|
||||
},
|
||||
"bundles": [
|
||||
{
|
||||
"name": "website",
|
||||
"from": "./ts_web/index.ts",
|
||||
"to": "./dist_serve/bundle.js",
|
||||
"watchPatterns": ["./ts_web/**/*"],
|
||||
"triggerReload": true,
|
||||
"bundler": "esbuild",
|
||||
"production": false
|
||||
},
|
||||
{
|
||||
"name": "html",
|
||||
"from": "./html/index.html",
|
||||
"to": "./dist_serve/index.html",
|
||||
"watchPatterns": ["./html/**/*"],
|
||||
"triggerReload": true
|
||||
},
|
||||
{
|
||||
"name": "assets",
|
||||
"from": "./assets/",
|
||||
"to": "./dist_serve/assets/",
|
||||
"watchPatterns": ["./assets/**/*"],
|
||||
"triggerReload": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="theme-color" content="#09090b" />
|
||||
<link rel="icon" href="data:," />
|
||||
<title>signature.digital</title>
|
||||
<style>
|
||||
html {
|
||||
-webkit-text-size-adjust: 100%;
|
||||
background: #09090b;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
min-height: 100vh;
|
||||
background: #09090b;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<noscript>JavaScript is required to run signature.digital.</noscript>
|
||||
<script defer type="module" src="/bundle.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,19 @@
|
||||
Copyright (c) 2014 Task Venture Capital GmbH (hello@task.vc)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,44 @@
|
||||
{
|
||||
"name": "@signature.digital/app",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"description": "Product application shell for signature.digital.",
|
||||
"exports": {
|
||||
".": "./dist_ts_web/index.js"
|
||||
},
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"test": "pnpm run build",
|
||||
"build": "tsbuild tsfolders --web --allowimplicitany && tsbundle",
|
||||
"watch": "tswatch"
|
||||
},
|
||||
"author": "Task Venture Capital GmbH",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@design.estate/dees-element": "^2.2.4",
|
||||
"@signature.digital/catalog": "^1.5.1",
|
||||
"@signature.digital/interfaces": "file:../interfaces",
|
||||
"@signature.digital/tools": "file:../tools"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@git.zone/tsbuild": "^4.4.0",
|
||||
"@git.zone/tsbundle": "2.10.1",
|
||||
"@git.zone/tswatch": "^3.3.3",
|
||||
"@push.rocks/projectinfo": "^5.1.0",
|
||||
"@types/node": "^25.6.0"
|
||||
},
|
||||
"files": [
|
||||
"ts_web/**/*",
|
||||
"dist/**/*",
|
||||
"dist_*/**/*",
|
||||
"dist_ts_web/**/*",
|
||||
"assets/**/*",
|
||||
"html/**/*",
|
||||
".smartconfig.json",
|
||||
"license",
|
||||
"readme.md"
|
||||
],
|
||||
"browserslist": [
|
||||
"last 1 Chrome versions"
|
||||
]
|
||||
}
|
||||
Generated
+6707
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,82 @@
|
||||
# @signature.digital/app
|
||||
|
||||
Private product application shell for signature.digital. It composes the shared contract model, runtime/demo utilities, and reusable web component catalog into the deployable browser experience.
|
||||
|
||||
This package is where product-specific behavior belongs: routing, authentication integration, persistence/API binding, signing workflow orchestration, deployment configuration, and environment-specific application glue.
|
||||
|
||||
## Issue Reporting and Security
|
||||
|
||||
For reporting bugs, issues, or security vulnerabilities, please visit [community.foss.global/](https://community.foss.global/). This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a [code.foss.global/](https://code.foss.global/) account to submit Pull Requests directly.
|
||||
|
||||
## Current Shell
|
||||
|
||||
The browser entry point in `ts_web/index.ts` registers the catalog and renders the workspace custom element into `document.body`:
|
||||
|
||||
```typescript
|
||||
import '@signature.digital/catalog';
|
||||
import { html, render } from '@design.estate/dees-element';
|
||||
|
||||
render(
|
||||
html`<sdig-workspace accent="#3b82f6" density="comfortable" theme="dark"></sdig-workspace>`,
|
||||
document.body
|
||||
);
|
||||
```
|
||||
|
||||
The app also sets full-viewport base styles so the workspace fills the browser window.
|
||||
|
||||
## Package Boundaries
|
||||
|
||||
| Package | Responsibility |
|
||||
|---------|----------------|
|
||||
| `@signature.digital/app` | Deployable product shell and app-specific workflow glue |
|
||||
| `@signature.digital/catalog` | Reusable web components such as `sdig-workspace`, `sdig-signbox`, and `sdig-signpad` |
|
||||
| `@signature.digital/interfaces` | Canonical TypeScript contract model and factory defaults |
|
||||
| `@signature.digital/tools` | Convenience re-export of shared interfaces plus demo data package wiring |
|
||||
|
||||
## What Belongs Here
|
||||
|
||||
- Real authentication and session handling.
|
||||
- Server API clients and persistence adapters.
|
||||
- Product routing and page-level composition.
|
||||
- Workflow orchestration for prepare, send, sign, audit, archive, and export flows.
|
||||
- Environment-specific deployment and bundling configuration.
|
||||
- Integration with `@signature.digital/interfaces` data and `@signature.digital/catalog` components.
|
||||
|
||||
## What Does Not Belong Here
|
||||
|
||||
- Shared contract type definitions. Put those in `@signature.digital/interfaces`.
|
||||
- Reusable web components. Put those in `@signature.digital/catalog`.
|
||||
- Generic fixture contracts. Put those in `@signature.digital/demodata`.
|
||||
- Component-internal demo data. Keep that inside the catalog only when it is purely visual/demo state.
|
||||
|
||||
## Development
|
||||
|
||||
```shell
|
||||
pnpm install
|
||||
pnpm run build
|
||||
pnpm test
|
||||
pnpm run watch
|
||||
```
|
||||
|
||||
The build compiles `ts_web/` into `dist_ts_web/` and bundles the app into `dist_serve/` through `.smartconfig.json` and `@git.zone/tsbundle`.
|
||||
|
||||
## License and Legal Information
|
||||
|
||||
This repository contains open-source code licensed under the MIT License. A copy of the license can be found in the [license](./license) file.
|
||||
|
||||
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
|
||||
|
||||
### Trademarks
|
||||
|
||||
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH or third parties, and are not included within the scope of the MIT license granted herein.
|
||||
|
||||
Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines or the guidelines of the respective third-party owners, and any usage must be approved in writing. Third-party trademarks used herein are the property of their respective owners and used only in a descriptive manner, e.g. for an implementation of an API or similar.
|
||||
|
||||
### Company Information
|
||||
|
||||
Task Venture Capital GmbH
|
||||
Registered at District Court Bremen HRB 35230 HB, Germany
|
||||
|
||||
For any legal inquiries or further information, please contact us via email at hello@task.vc.
|
||||
|
||||
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
|
||||
@@ -0,0 +1,84 @@
|
||||
import '@signature.digital/catalog';
|
||||
import { html, render } from '@design.estate/dees-element';
|
||||
|
||||
type TWorkspaceView = 'inbox' | 'compose' | 'sign' | 'audit' | 'developers' | 'templates' | 'team' | 'settings';
|
||||
|
||||
const workspaceViews: TWorkspaceView[] = ['inbox', 'compose', 'sign', 'audit', 'developers', 'templates', 'team', 'settings'];
|
||||
|
||||
const isWorkspaceView = (view: string): view is TWorkspaceView => workspaceViews.includes(view as TWorkspaceView);
|
||||
|
||||
const viewFromLocation = (): TWorkspaceView => {
|
||||
const view = globalThis.location.hash.replace(/^#/, '');
|
||||
return isWorkspaceView(view) ? view : 'inbox';
|
||||
};
|
||||
|
||||
let currentView = viewFromLocation();
|
||||
let appRoot: HTMLElement | null = null;
|
||||
let routeChangeFrame: number | null = null;
|
||||
|
||||
const createAppRoot = () => {
|
||||
document.getElementById('signature-digital-app')?.remove();
|
||||
appRoot = document.createElement('div');
|
||||
appRoot.id = 'signature-digital-app';
|
||||
document.body.append(appRoot);
|
||||
};
|
||||
|
||||
const handleViewChange = (event: Event) => {
|
||||
const view = (event as CustomEvent<{ view?: TWorkspaceView }>).detail?.view;
|
||||
if (!view || !isWorkspaceView(view)) return;
|
||||
currentView = view;
|
||||
const nextHash = `#${view}`;
|
||||
if (globalThis.location.hash !== nextHash) {
|
||||
globalThis.location.hash = view;
|
||||
}
|
||||
};
|
||||
|
||||
const handleRouteChange = () => {
|
||||
if (routeChangeFrame !== null) {
|
||||
globalThis.cancelAnimationFrame(routeChangeFrame);
|
||||
}
|
||||
routeChangeFrame = globalThis.requestAnimationFrame(() => {
|
||||
routeChangeFrame = null;
|
||||
currentView = viewFromLocation();
|
||||
renderApp();
|
||||
});
|
||||
};
|
||||
|
||||
const renderApp = () => {
|
||||
if (!appRoot) createAppRoot();
|
||||
render(
|
||||
html`
|
||||
<style>
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
min-height: 100vh;
|
||||
background: #09090b;
|
||||
color: #fafafa;
|
||||
font-family: Geist, Inter, Roboto, sans-serif;
|
||||
}
|
||||
|
||||
body {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
sdig-workspace {
|
||||
height: 100vh;
|
||||
}
|
||||
</style>
|
||||
<sdig-workspace accent="#3b82f6" density="comfortable" theme="dark" initialView=${currentView} .initialView=${currentView} view=${currentView} .view=${currentView}></sdig-workspace>
|
||||
`,
|
||||
appRoot!
|
||||
);
|
||||
};
|
||||
|
||||
const run = async () => {
|
||||
createAppRoot();
|
||||
document.body.addEventListener('view-change', handleViewChange);
|
||||
globalThis.addEventListener('popstate', handleRouteChange);
|
||||
globalThis.addEventListener('hashchange', handleRouteChange);
|
||||
renderApp();
|
||||
};
|
||||
|
||||
run();
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"experimentalDecorators": true,
|
||||
"target": "ES2022",
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"esModuleInterop": true,
|
||||
"verbatimModuleSyntax": true,
|
||||
"types": ["node"]
|
||||
},
|
||||
"exclude": [
|
||||
"dist_*/**/*.d.ts"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user