@digipair/skill-web-notification 0.91.0-0 → 0.91.0

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.
@@ -0,0 +1,2 @@
1
+ export * from './lib/engine';
2
+ export * from './lib/pins-settings.interface';
@@ -0,0 +1,9 @@
1
+ export interface Alias {
2
+ name: string;
3
+ library: string;
4
+ element: string;
5
+ properties: {
6
+ library: string;
7
+ element: string;
8
+ };
9
+ }
@@ -0,0 +1,13 @@
1
+ import { PinsSettings } from './pins-settings.interface';
2
+ type CONFIG_KEY = 'BASE_URL' | 'LIBRARIES' | 'ALIAS' | 'LOGGER';
3
+ export declare const config: {
4
+ set: (key: CONFIG_KEY, value: any) => void;
5
+ log: (level: string, path: string, message: string, context: any, data?: any) => any;
6
+ };
7
+ export declare const applyTemplate: (value: any, context: any) => any;
8
+ export declare const executePinsList: (pinsSettingsList: PinsSettings[], context: any, path?: string) => Promise<any>;
9
+ export declare const generateElementFromPins: (pinsSettings: PinsSettings, parent: Element, context: any, document?: Document, options?: {
10
+ import: boolean;
11
+ }) => Promise<Element | void>;
12
+ export declare const preparePinsSettings: (settings: PinsSettings, context: any) => PinsSettings;
13
+ export {};
@@ -0,0 +1,15 @@
1
+ export interface PinsSettings {
2
+ library: string;
3
+ element: string;
4
+ properties?: {
5
+ [key: string]: any;
6
+ };
7
+ conditions?: {
8
+ if?: boolean;
9
+ each?: any[];
10
+ };
11
+ pins?: PinsSettings[];
12
+ events?: {
13
+ [key: string]: PinsSettings[];
14
+ };
15
+ }
@@ -0,0 +1,5 @@
1
+ import { PinsSettings } from '@digipair/engine';
2
+ export declare const information: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<void>;
3
+ export declare const error: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<void>;
4
+ export declare const confirm: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<boolean>;
5
+ export declare const alert: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<void>;
package/package.json CHANGED
@@ -1,28 +1,12 @@
1
1
  {
2
2
  "name": "@digipair/skill-web-notification",
3
- "version": "0.91.0-0",
4
- "type": "module",
5
- "main": "dist/libs/skill-web-notification/index.cjs.js",
6
- "module": "dist/libs/skill-web-notification/index.esm.js",
7
- "types": "dist/libs/skill-web-notification/index.esm.d.ts",
8
- "exports": {
9
- "./package.json": "./libs/skill-web-notification/package.json",
10
- ".": {
11
- "development": "./dist/libs/skill-web-notification/src/index.ts",
12
- "types": "./dist/libs/skill-web-notification/index.esm.d.ts",
13
- "import": "./dist/libs/skill-web-notification/index.esm.js",
14
- "default": "./dist/libs/skill-web-notification/index.cjs.js"
15
- }
16
- },
3
+ "version": "0.91.0",
17
4
  "keywords": [
18
5
  "digipair",
19
6
  "web",
20
7
  "util"
21
8
  ],
22
- "nx": {
23
- "name": "skill-web-notification"
24
- },
25
- "dependencies": {
26
- "@digipair/engine": "0.91.0-0"
27
- }
28
- }
9
+ "dependencies": {},
10
+ "main": "./index.cjs.js",
11
+ "module": "./index.esm.js"
12
+ }
package/.swcrc DELETED
@@ -1,28 +0,0 @@
1
- {
2
- "jsc": {
3
- "target": "es2017",
4
- "parser": {
5
- "syntax": "typescript",
6
- "decorators": true,
7
- "dynamicImport": true
8
- },
9
- "transform": {
10
- "decoratorMetadata": true,
11
- "legacyDecorator": true
12
- },
13
- "keepClassNames": true,
14
- "externalHelpers": true,
15
- "loose": true
16
- },
17
- "module": {
18
- "type": "es6"
19
- },
20
- "sourceMaps": true,
21
- "exclude": [
22
- "jest.config.ts",
23
- ".*\\.spec.tsx?$",
24
- ".*\\.test.tsx?$",
25
- "./src/jest-setup.ts$",
26
- "./**/jest-setup.ts$"
27
- ]
28
- }
package/README.md DELETED
@@ -1,7 +0,0 @@
1
- # mylib
2
-
3
- This library was generated with [Nx](https://nx.dev).
4
-
5
- ## Building
6
-
7
- Run `nx build mylib` to build the library.
package/eslint.config.mjs DELETED
@@ -1,22 +0,0 @@
1
- import baseConfig from '../../eslint.config.mjs';
2
-
3
- export default [
4
- ...baseConfig,
5
- {
6
- files: ['**/*.json'],
7
- rules: {
8
- '@nx/dependency-checks': [
9
- 'error',
10
- {
11
- ignoredFiles: [
12
- '{projectRoot}/eslint.config.{js,cjs,mjs}',
13
- '{projectRoot}/rollup.config.{js,ts,mjs,mts,cjs,cts}',
14
- ],
15
- },
16
- ],
17
- },
18
- languageOptions: {
19
- parser: await import('jsonc-eslint-parser'),
20
- },
21
- },
22
- ];
package/rollup.config.cjs DELETED
@@ -1,28 +0,0 @@
1
- const { withNx } = require('@nx/rollup/with-nx');
2
-
3
- module.exports = withNx(
4
- {
5
- main: 'libs/skill-web-notification/src/index.ts',
6
- outputPath: 'dist/libs/skill-web-notification',
7
- tsConfig: 'libs/skill-web-notification/tsconfig.lib.json',
8
- compiler: 'swc',
9
- format: ['esm', "cjs"],
10
- assets: [
11
- {
12
- input: 'libs/skill-web-notification/',
13
- glob: 'package.json',
14
- output: '.'
15
- },
16
- {
17
- input: 'libs/skill-web-notification/src/',
18
- glob: '*.json',
19
- output: '.'
20
- }
21
- ]
22
- },
23
- {
24
- // Provide additional rollup configuration here. See: https://rollupjs.org/configuration-options
25
- // e.g.
26
- // output: { sourcemap: true },
27
- }
28
- );
@@ -1 +0,0 @@
1
- declare module 'handlebars/dist/handlebars.min.js';
@@ -1,7 +0,0 @@
1
- import { skillWebNotification } from './skill-web-notification';
2
-
3
- describe('skillWebNotification', () => {
4
- it('should work', () => {
5
- expect(skillWebNotification()).toEqual('skill-web-notification');
6
- });
7
- });
@@ -1,80 +0,0 @@
1
- import { PinsSettings, executePinsList } from '@digipair/engine';
2
- import * as ToastifyJs from 'toastify-js';
3
-
4
- const Toastify = (ToastifyJs as any).default;
5
-
6
- class NotificationService {
7
- constructor() {
8
- const globalInstance: any = typeof window === 'undefined' ? global : window;
9
- const config = globalInstance.__DIGIPAIR_CONFIG__;
10
- const version = '1.12.0';
11
- let link = document.querySelector('#digipair-skill-web-notification-css') as any;
12
-
13
- if (!link) {
14
- link = document.createElement('link');
15
- link.id = 'digipair-skill-web-notification-css';
16
- link.rel = 'stylesheet';
17
- link.href = `${config.BASE_URL}/toastify-js@${version}/src/toastify.css`;
18
- link.type = 'text/css';
19
- document.head.appendChild(link);
20
- }
21
- }
22
-
23
- async information(params: any, _pinsSettingsList: PinsSettings[], _context: any) {
24
- const { message } = params;
25
-
26
- Toastify({
27
- text: message,
28
- position: 'center',
29
- style: {
30
- 'font-family': '"Poppins", sans-serif',
31
- background: '#52DFDB',
32
- },
33
- duration: 3000,
34
- }).showToast();
35
- }
36
-
37
- async error(params: any, _pinsSettingsList: PinsSettings[], _context: any) {
38
- const { message } = params;
39
-
40
- Toastify({
41
- text: message,
42
- position: 'center',
43
- style: {
44
- 'font-family': '"Poppins", sans-serif',
45
- background: 'linear-gradient(90deg, rgba(121,9,9,1) 0%, rgba(203,62,62,1) 100%)',
46
- },
47
- duration: 3000,
48
- }).showToast();
49
- }
50
-
51
- async confirm(params: any, _pinsSettingsList: PinsSettings[], context: any) {
52
- const { message, ok = [], ko = [] } = params;
53
-
54
- if (!window.confirm(message)) {
55
- await executePinsList(ko, context, `${context.__PATH__}.ko`);
56
- return false;
57
- }
58
-
59
- await executePinsList(ok, context, `${context.__PATH__}.ok`);
60
- return true;
61
- }
62
-
63
- async alert(params: any, _pinsSettingsList: PinsSettings[], _context: any) {
64
- const { message } = params;
65
-
66
- return window.alert(message);
67
- }
68
- }
69
-
70
- export const information = (params: any, pinsSettingsList: PinsSettings[], context: any) =>
71
- new NotificationService().information(params, pinsSettingsList, context);
72
-
73
- export const error = (params: any, pinsSettingsList: PinsSettings[], context: any) =>
74
- new NotificationService().error(params, pinsSettingsList, context);
75
-
76
- export const confirm = (params: any, pinsSettingsList: PinsSettings[], context: any) =>
77
- new NotificationService().confirm(params, pinsSettingsList, context);
78
-
79
- export const alert = (params: any, pinsSettingsList: PinsSettings[], context: any) =>
80
- new NotificationService().alert(params, pinsSettingsList, context);
package/tsconfig.json DELETED
@@ -1,13 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.base.json",
3
- "files": [],
4
- "include": [],
5
- "references": [
6
- {
7
- "path": "../engine"
8
- },
9
- {
10
- "path": "./tsconfig.lib.json"
11
- }
12
- ]
13
- }
package/tsconfig.lib.json DELETED
@@ -1,19 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.base.json",
3
- "compilerOptions": {
4
- "rootDir": "src",
5
- "outDir": "dist",
6
- "tsBuildInfoFile": "dist/tsconfig.lib.tsbuildinfo",
7
- "emitDeclarationOnly": true,
8
- "module": "esnext",
9
- "moduleResolution": "node",
10
- "forceConsistentCasingInFileNames": true,
11
- "types": ["node"]
12
- },
13
- "include": ["src/**/*.ts"],
14
- "references": [
15
- {
16
- "path": "../engine/tsconfig.lib.json"
17
- }
18
- ]
19
- }
File without changes
File without changes
File without changes