Compare commits

..

No commits in common. "master" and "v1.0.57" have entirely different histories.

11 changed files with 2470 additions and 6167 deletions

View File

@ -1,13 +0,0 @@
# Changelog
## 2024-12-19 - 1.0.59 - fix(dependencies)
Update package dependencies and project metadata
- Updated package dependencies to the latest versions in package.json
- Synchronized project description and keywords in npmextra.json with package.json
## 2023-11-28 - 1.0.55 to 1.0.58 - core updates
Main changes include fixing and updating core functionalities.
- Fixed core issues and updated core functionalities in versions 1.0.55, 1.0.56, and 1.0.57.
- Further updates and improvements were carried out in version 1.0.58.

View File

@ -5,25 +5,10 @@
"githost": "gitlab.com", "githost": "gitlab.com",
"gitscope": "signature.digital_private", "gitscope": "signature.digital_private",
"gitrepo": "catalog", "gitrepo": "catalog",
"description": "A comprehensive catalog of customizable web components designed for building and managing e-signature applications.", "description": "a catalog containing components for e-signing",
"npmPackagename": "@signature.digital_private/catalog", "npmPackagename": "@signature.digital_private/catalog",
"license": "UNLICENSED", "license": "UNLICENSED",
"projectDomain": "signature.digital", "projectDomain": "signature.digital"
"keywords": [
"e-signature",
"web components",
"digital signature",
"signature capture",
"ECMAScript Modules",
"typescript",
"component library",
"contract management",
"frontend development",
"signature pad",
"custom elements",
"electronic signing",
"npm package"
]
} }
}, },
"npmci": { "npmci": {

View File

@ -1,11 +1,10 @@
{ {
"name": "@signature.digital/catalog", "name": "@signature.digital_private/catalog",
"version": "1.0.59", "version": "1.0.57",
"private": false, "private": false,
"description": "A comprehensive catalog of customizable web components designed for building and managing e-signature applications.", "description": "a catalog containing components for e-signing",
"exports": { "main": "dist_ts_web/index.js",
".": "./dist_ts_web/index.ts" "typings": "dist_ts_web/index.d.ts",
},
"type": "module", "type": "module",
"scripts": { "scripts": {
"test": "npm run build", "test": "npm run build",
@ -13,20 +12,21 @@
"watch": "tswatch element" "watch": "tswatch element"
}, },
"author": "Task Venture Capital GmbH", "author": "Task Venture Capital GmbH",
"license": "MIT", "license": "UNLICENSED",
"dependencies": { "dependencies": {
"@design.estate/dees-catalog": "^1.3.3", "@design.estate/dees-catalog": "^1.0.230",
"@design.estate/dees-domtools": "^2.0.65", "@design.estate/dees-domtools": "^2.0.55",
"@design.estate/dees-element": "^2.0.39", "@design.estate/dees-element": "^2.0.33",
"@design.estate/dees-wcctools": "^1.0.90", "@design.estate/dees-wcctools": "^1.0.37",
"@git.zone/tsrun": "^1.3.3", "@git.zone/tsrun": "^1.2.12",
"@signature.digital/tools": "^1.1.0", "@losslessone_private/loint-pubapi": "^1.0.9",
"signature_pad": "^5.0.4" "@signature.digital/portablecontract": "^1.0.3",
"signature_pad": "^4.1.7"
}, },
"devDependencies": { "devDependencies": {
"@git.zone/tsbuild": "^2.2.0", "@git.zone/tsbuild": "^2.1.24",
"@git.zone/tsbundle": "^2.1.0", "@git.zone/tsbundle": "^2.0.10",
"@git.zone/tswatch": "^2.0.37", "@git.zone/tswatch": "^2.0.13",
"@push.rocks/projectinfo": "^5.0.2" "@push.rocks/projectinfo": "^5.0.2"
}, },
"files": [ "files": [
@ -43,20 +43,5 @@
], ],
"browserslist": [ "browserslist": [
"last 1 Chrome versions" "last 1 Chrome versions"
],
"keywords": [
"e-signature",
"web components",
"digital signature",
"signature capture",
"ECMAScript Modules",
"typescript",
"component library",
"contract management",
"frontend development",
"signature pad",
"custom elements",
"electronic signing",
"npm package"
] ]
} }

8293
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

183
readme.md
View File

@ -1,164 +1,31 @@
# @signature.digital/catalog # @signature.digital_private/catalog
A catalog containing components for e-signing, built using modern web technologies for seamless integration and functionality. a catalog containing components for e-signing
## Install ## Availabililty and Links
To add `@signature.digital/catalog` to your project, run the following command in your terminal: * [npmjs.org (npm package)](https://www.npmjs.com/package/@signature.digital_private/catalog)
* [gitlab.com (source)](https://gitlab.com/signature.digital_private/catalog)
* [github.com (source mirror)](https://github.com/signature.digital_private/catalog)
* [docs (typedoc)](https://signature.digital_private.gitlab.io/catalog/)
```shell ## Status for master
npm install @signature.digital/catalog
```
This command will install `@signature.digital/catalog` along with its required peer dependencies. Ensure that your project is set up for ECMAScript Modules (ESM). Status Category | Status Badge
-- | --
GitLab Pipelines | [![pipeline status](https://gitlab.com/signature.digital_private/catalog/badges/master/pipeline.svg)](https://lossless.cloud)
GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/signature.digital_private/catalog/badges/master/coverage.svg)](https://lossless.cloud)
npm | [![npm downloads per month](https://badgen.net/npm/dy/@signature.digital_private/catalog)](https://lossless.cloud)
Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/signature.digital_private/catalog)](https://lossless.cloud)
TypeScript Support | [![TypeScript](https://badgen.net/badge/TypeScript/>=%203.x/blue?icon=typescript)](https://lossless.cloud)
node Support | [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](https://lossless.cloud)
PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@signature.digital_private/catalog)](https://lossless.cloud)
PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@signature.digital_private/catalog)](https://lossless.cloud)
BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@signature.digital_private/catalog)](https://lossless.cloud)
## Usage ## Usage
Use TypeScript for best in class intellisense
For further information read the linked docs at the top of this readme.
The `@signature.digital/catalog` package provides a set of web components specifically designed for building e-signature applications. These components can be used for capturing, displaying, and managing electronic signatures. The primary components offered in this package include `SignPad`, `SignBox`, and `ContractEditor`. ## Legal
> UNLICENSED licensed | **©** [Task Venture Capital GmbH](https://task.vc)
### Setting Up the Environment | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
To make the most of `@signature.digital/catalog`, you'll want to ensure you have your environment ready to use web components. If you're using a standard web setup with a module bundler like Webpack, Rollup, or Vite, make sure your build process supports ECMAScript modules.
### Basic Example of `SignPad`
The `SignPad` component is a customizable signature pad that can be used to capture user signatures. Here's how to implement it in your HTML:
```typescript
import '@signature.digital/catalog/element';
class MySignatureComponent extends HTMLElement {
connectedCallback() {
this.innerHTML = '<sdig-signpad></sdig-signpad>';
}
}
customElements.define('my-signature-component', MySignatureComponent);
```
In this example, a simple HTML element is constructed that includes the `sdig-signpad` custom element. This signature pad allows users to draw their signatures directly in the browser.
### Advanced Usage with `SignBox`
The `SignBox` component wraps `SignPad` with additional controls for signing actions like clear and undo. This provides a complete signing interface out of the box.
```typescript
import '@signature.digital/catalog/element';
class MyCompleteSignatureBox extends HTMLElement {
connectedCallback() {
this.innerHTML = `<sdig-signbox></sdig-signbox>`;
this.querySelector('sdig-signbox').addEventListener('signature', (e) => {
const signatureData = e.detail.signature;
console.log('Signature data:', signatureData);
});
}
}
customElements.define('my-complete-signature-box', MyCompleteSignatureBox);
```
In this setup, `SignBox` also manages the signature data and emits a custom event once the signature is submitted. You can listen for this event to gather the signature data for storage or further processing.
### Integrating `ContractEditor`
ContractEditor allows for manipulating contract details and integrating signature capabilities directly into documents. This component communicates with its state using Smartstate, an inbuilt state management system.
```typescript
import '@signature.digital/catalog/element';
import { IPortableContract } from '@signature.digital/tools/interfaces';
class MyContractEditor extends HTMLElement {
editContract(contract: IPortableContract) {
const editor = this.querySelector('sdig-contracteditor');
editor.contract = contract;
}
connectedCallback() {
this.innerHTML = `<sdig-contracteditor></sdig-contracteditor>`;
}
}
customElements.define('my-contract-editor', MyContractEditor);
```
`ContractEditor` can be dynamically updated by changing the `contract` property. This component expects contract definitions compatible with the `IPortableContract` interface, offering an adaptable and customizable editing solution.
### Example Application
Below is an integrated example showing how all of these components can be put together to form a basic signature application.
```typescript
import '@signature.digital/catalog/element';
import { IPortableContract } from '@signature.digital/tools/interfaces';
import { demoContract } from '@signature.digital/tools/demodata';
class CombinedSignatureApp extends HTMLElement {
private contract: IPortableContract = demoContract;
constructor() {
super();
}
render() {
this.innerHTML = `
<my-complete-signature-box></my-complete-signature-box>
<my-contract-editor></my-contract-editor>
`;
this.querySelector('my-contract-editor').editContract(this.contract);
}
connectedCallback() {
this.render();
}
}
customElements.define('combined-signature-app', CombinedSignatureApp);
```
In a real-world scenario, `CombinedSignatureApp` could be binding multiple processes around collecting and displaying signatures, including validation logic, storage mechanisms, and user feedback systems.
### Handling Signatures
Once you have a user signature, you can convert it between different formats like `Data`, `SVG` or simply clear or undo modifications. Here is how you can handle these activities within your JavaScript:
```typescript
document.querySelector('sdig-signpad').addEventListener('signature', async (event) => {
const signaturePad = event.target as SignPad;
console.log(await signaturePad.toData()); // Get signature data
console.log(await signaturePad.toSVG()); // Convert to SVG
await signaturePad.undo(); // Undo last action
await signaturePad.clear(); // Clear the signature pad
});
```
This versatile use of `sdig-signpad` demonstrates how diverse use case scenarios for signatures can be developed, be it collecting, transforming, or editing current user inputs.
### Responsive Design Considerations
When building applications that include e-signature capabilities, you must ensure your components respond well to different screen sizes. Components in `@signature.digital/catalog` are designed with CSS variables and flexible dimensions, but specific implementations can benefit from additional CSS media queries.
### Custom Styling
Each component is styled using Light DOM scoped styles. Components like `sdig-signpad` come with default styles, but they are capable of overriding these styles for consistent design alignment within your project. For example:
```typescript
const style = document.createElement('style');
style.textContent = `
sdig-signpad, sdig-signbox {
--main-background-color: #fff;
--line-color: #000;
--button-color: #007bff;
}
`;
document.head.appendChild(style);
```
These CSS custom properties modify component styles, from appearance to behavior, creating a cohesive look with the rest of your site's aesthetics.
### Conclusion
With `@signature.digital/catalog`, developers have a comprehensive toolkit for integrating sophisticated e-signature functionalities into their web applications. Its wide array of customizable components, flexibility, and ease of use out of the box makes it an indispensable inclusion for building modern digital signature workflows. Whether for simple signature capture or complex contract management, this package has you covered. Explore more advanced topics and extend the capabilities to fit unique business needs in your applications.
undefined

View File

@ -1,8 +1,8 @@
/** /**
* autocreated commitinfo by @push.rocks/commitinfo * autocreated commitinfo by @pushrocks/commitinfo
*/ */
export const commitinfo = { export const commitinfo = {
name: '@signature.digital/catalog', name: '@signature.digital_private/catalog',
version: '1.0.59', version: '1.0.57',
description: 'A comprehensive catalog of customizable web components designed for building and managing e-signature applications.' description: 'a catalog containing components for e-signing'
} }

View File

@ -1,14 +1,4 @@
import { import { DeesElement, property, html, customElement, type TemplateResult, css, cssManager } from '@design.estate/dees-element';
DeesElement,
property,
html,
customElement,
type TemplateResult,
css,
cssManager,
domtools,
} from '@design.estate/dees-element';
import * as plugins from '../plugins.js'; import * as plugins from '../plugins.js';
declare global { declare global {
@ -17,26 +7,5 @@ declare global {
} }
} }
@customElement('sdig-contracteditor') @customElement('sdig-signbox')
export class ContractEditor extends DeesElement { export class ContractEditor extends DeesElement {}
public static demo = () => html` <sdig-contracteditor
.contract=${plugins.sdDemodata.demoContract}
></sdig-contracteditor> `;
// INSTANCE
public localStateInstance = new domtools.plugins.smartstate.Smartstate();
public contractState =
this.localStateInstance.getStatePart<plugins.sdInterfaces.IPortableContract>('contract');
@property({ type: Object })
public contract: plugins.sdInterfaces.IPortableContract;
public async firstUpdated(_changedProperties: Map<string | number | symbol, unknown>) {
super.firstUpdated(_changedProperties);
}
public render(): TemplateResult {
return html` <div class="mainbox"></div> `;
}
}

View File

@ -26,14 +26,13 @@ export class SignPad extends DeesElement {
color: white; color: white;
position: relative; position: relative;
max-width: 600px; max-width: 600px;
min-height: 280px; min-height: 200px;
max-height: 400px; max-height: 400px;
} }
.mainbox { .mainbox {
position: relative; position: relative;
width: 600px; min-height: 280px;
height: 280px;
} }
.signline { .signline {

View File

@ -1,12 +1,8 @@
// @signature.digital scope // @signature.digital scope
import * as sdDemodata from '@signature.digital/tools/demodata'; import * as portablecontract from '@signature.digital/portablecontract';
import * as sdInterfaces from '@signature.digital/tools/interfaces';
import * as sdTools from '@signature.digital/tools';
export { export {
sdDemodata, portablecontract,
sdInterfaces,
sdTools,
} }
// @design.estate scope // @design.estate scope