@startinblox/components-ds4go 1.0.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.
Files changed (56) hide show
  1. package/.gitlab-ci.yml +57 -0
  2. package/.storybook/main.ts +17 -0
  3. package/.storybook/preview-head.html +8 -0
  4. package/.storybook/preview.ts +22 -0
  5. package/LICENSE +21 -0
  6. package/README.md +129 -0
  7. package/biome.json +50 -0
  8. package/cypress/component/solid-boilerplate.cy.ts +9 -0
  9. package/cypress/support/component-index.html +12 -0
  10. package/cypress/support/component.ts +17 -0
  11. package/cypress.config.ts +11 -0
  12. package/dist/components-ds4go.css +1 -0
  13. package/dist/index.js +1634 -0
  14. package/lit-localize.json +15 -0
  15. package/locales/en.xlf +28 -0
  16. package/package.json +93 -0
  17. package/postcss.config.js +8 -0
  18. package/src/component.d.ts +167 -0
  19. package/src/components/catalog/ds4go-fact-bundle-holder.ts +162 -0
  20. package/src/components/modal/ds4go-fact-bundle-modal.ts +82 -0
  21. package/src/components/solid-fact-bundle.ts +225 -0
  22. package/src/context.json +1 -0
  23. package/src/helpers/components/ResourceMapper.ts +450 -0
  24. package/src/helpers/components/componentObjectHandler.ts +22 -0
  25. package/src/helpers/components/componentObjectsHandler.ts +14 -0
  26. package/src/helpers/components/dspComponent.ts +243 -0
  27. package/src/helpers/components/orbitComponent.ts +273 -0
  28. package/src/helpers/components/setupCacheInvalidation.ts +44 -0
  29. package/src/helpers/components/setupCacheOnResourceReady.ts +39 -0
  30. package/src/helpers/components/setupComponentSubscriptions.ts +73 -0
  31. package/src/helpers/components/setupOnSaveReset.ts +20 -0
  32. package/src/helpers/datas/dataBuilder.ts +43 -0
  33. package/src/helpers/datas/filterGenerator.ts +29 -0
  34. package/src/helpers/datas/filterObjectByDateAfter.ts +80 -0
  35. package/src/helpers/datas/filterObjectById.ts +54 -0
  36. package/src/helpers/datas/filterObjectByInterval.ts +133 -0
  37. package/src/helpers/datas/filterObjectByNamedValue.ts +103 -0
  38. package/src/helpers/datas/filterObjectByType.ts +30 -0
  39. package/src/helpers/datas/filterObjectByValue.ts +81 -0
  40. package/src/helpers/datas/sort.ts +40 -0
  41. package/src/helpers/i18n/configureLocalization.ts +17 -0
  42. package/src/helpers/index.ts +43 -0
  43. package/src/helpers/mappings/dsp-mapping-config.ts +545 -0
  44. package/src/helpers/ui/formatDate.ts +18 -0
  45. package/src/helpers/ui/lipsum.ts +12 -0
  46. package/src/helpers/utils/requestNavigation.ts +12 -0
  47. package/src/helpers/utils/uniq.ts +6 -0
  48. package/src/index.ts +14 -0
  49. package/src/initializer.ts +11 -0
  50. package/src/mocks/orbit.mock.ts +33 -0
  51. package/src/mocks/user.mock.ts +67 -0
  52. package/src/styles/_helpers/flex.scss +39 -0
  53. package/src/styles/index.scss +14 -0
  54. package/src/styles/modal/ds4go-fact-bundle-modal.scss +89 -0
  55. package/tsconfig.json +36 -0
  56. package/vite.config.ts +48 -0
package/.gitlab-ci.yml ADDED
@@ -0,0 +1,57 @@
1
+ ---
2
+ include:
3
+ project: infra/gitlab
4
+ ref: master
5
+ file: templates/nodejs.ci.yml
6
+
7
+ cache:
8
+ key: ${CI_COMMIT_REF_SLUG}
9
+ paths:
10
+ - .npm/
11
+
12
+ default:
13
+ image: node:22
14
+
15
+ stages:
16
+ - prepare
17
+ - test
18
+ - publish
19
+
20
+ prepare:
21
+ stage: prepare
22
+ image: node:22
23
+ before_script:
24
+ - npm ci --cache .npm --prefer-offline
25
+ - npm install -g semantic-release@24 @semantic-release/gitlab@13
26
+ script:
27
+ - npm run locale:build
28
+ - npm run build
29
+ artifacts:
30
+ when: on_success
31
+ paths:
32
+ - dist
33
+ expire_in: 1 day
34
+ tags:
35
+ - test
36
+
37
+ test:
38
+ stage: test
39
+ image:
40
+ name: cypress/included:15.5.0
41
+ entrypoint: [""]
42
+ before_script:
43
+ - npm ci --cache .npm --prefer-offline
44
+ script:
45
+ - npm run cy:run
46
+ except:
47
+ - tags
48
+ tags:
49
+ - test
50
+
51
+ publish:
52
+ stage: publish
53
+ extends: .publish_npm
54
+ only:
55
+ - master
56
+ - beta
57
+ - alpha
@@ -0,0 +1,17 @@
1
+ import type { StorybookConfig } from "@storybook/web-components-vite";
2
+
3
+ const config: StorybookConfig = {
4
+ stories: ["../stories/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
5
+ addons: ["@storybook/addon-docs"],
6
+
7
+ framework: {
8
+ name: "@storybook/web-components-vite",
9
+ options: {},
10
+ },
11
+
12
+ core: {
13
+ disableTelemetry: true,
14
+ }
15
+ };
16
+
17
+ export default config;
@@ -0,0 +1,8 @@
1
+ <script>
2
+ window.global = window;
3
+ </script>
4
+ <style>
5
+ .sbdocs.sbdocs-content {
6
+ max-width: 1440px;
7
+ }
8
+ </style>
@@ -0,0 +1,22 @@
1
+ import type { Preview } from "@storybook/web-components-vite";
2
+
3
+ import "@styles/index.scss";
4
+
5
+ import "@mocks/orbit.mock";
6
+
7
+ const preview: Preview = {
8
+ parameters: {
9
+ actions: { argTypesRegex: "^on[A-Z].*" },
10
+ controls: {
11
+ matchers: {
12
+ color: /(background|color)$/i,
13
+ date: /Date$/i,
14
+ },
15
+ },
16
+ docs: {
17
+ toc: true,
18
+ },
19
+ },
20
+ };
21
+
22
+ export default preview;
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026-PRESENT Startin blox
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,129 @@
1
+ # Startin'blox DS4GO Components
2
+
3
+ settings.yml:
4
+
5
+ ```yaml
6
+ dependencies:
7
+ - djangoldp-account
8
+ - django-webidoidc-provider
9
+ - djangoldp-i18n
10
+ - djangoldp-edc
11
+ - djangoldp-ds4go
12
+ ...
13
+
14
+ ldppackages:
15
+ - rest_framework
16
+ - oidc_provider
17
+ - djangoldp_account
18
+ - djangoldp_i18n
19
+ - djangoldp_ds4go
20
+ - djangoldp_edc
21
+ ...
22
+
23
+ server:
24
+ ...
25
+ USE_I18N: True
26
+ # Your application default language, will be served if no header are provided
27
+ LANGUAGE_CODE: fr
28
+ # Your application fallback language, will be served when a requested language is not available
29
+ MODELTRANSLATION_DEFAULT_LANGUAGE: fr
30
+ # Priority order. Ensure that every language is listed here to avoid empty translations
31
+ MODELTRANSLATION_FALLBACK_LANGUAGES:
32
+ - fr
33
+ - en
34
+ - es
35
+ # A list of all supported languages, you **must** make a migration afterwise
36
+ LANGUAGES:
37
+ - ['fr', 'Français']
38
+ - ['en', 'English']
39
+ - ['es', 'Español']
40
+
41
+ # EDC (Eclipse Dataspace Connector) configuration
42
+ EDC_URL: ...
43
+ EDC_PARTICIPANT_ID: ...
44
+ EDC_API_KEY: ...
45
+ EDC_AGREEMENT_VALIDATION_ENABLED: true
46
+ EDC_ASSET_ID_STRATEGY: slugify
47
+ EDC_NEGOTIATION_DISCOVERY_ENABLED: true
48
+ ```
49
+
50
+ config.json, client:
51
+
52
+ ```json
53
+ ...
54
+ "css": [
55
+ "https://ds4go.tems-components.startinblox.com/components-tems.css",
56
+ "https://ds4go-components.startinblox.com/components-ds4go.css"
57
+ ],
58
+ ...
59
+ ```
60
+
61
+ config.json, npm:
62
+
63
+ ```json
64
+ [
65
+ ...,
66
+ {
67
+ "package": "@startinblox/components-tems",
68
+ "version": "0",
69
+ "path": "https://ds4go.tems-components.startinblox.com/index.js"
70
+ },
71
+ {
72
+ "package": "@startinblox/components-ds4go",
73
+ "version": "0",
74
+ "path": "https://ds4go-components.startinblox.com/index.js"
75
+ },
76
+ ...
77
+ ]
78
+ ```
79
+
80
+ config.json, components:
81
+
82
+ ```json
83
+ [
84
+ ...,
85
+ {
86
+ "type": "fact-bundle",
87
+ "parameters": {
88
+ "menu": {
89
+ "name": "Fact Bundling",
90
+ "category": "Services",
91
+ "icon": "mingcute-bookmark-line",
92
+ "featureflags": [],
93
+ "alternate": [
94
+ "fact-bundle-creation"
95
+ ]
96
+ },
97
+ "header": "Fact Bundling",
98
+ "disableFiltering": true,
99
+ "defaultDataSrc": "server://factbundles/",
100
+ "bind-resources": ""
101
+ },
102
+ "route": "fact-bundles",
103
+ "routeAttributes": {
104
+ "rdf-type": "ds4go:FactBundle",
105
+ "use-id": ""
106
+ },
107
+ "integration": [
108
+ "menu",
109
+ "routing"
110
+ ]
111
+ },
112
+ {
113
+ "type": "fact-bundle-creation",
114
+ "parameters": {
115
+ "header": "Create a new Fact Bundle",
116
+ "dataSrc": "server://factbundles/"
117
+ },
118
+ "route": "fact-bundle-creation",
119
+ "integration": [
120
+ "routing"
121
+ ]
122
+ },
123
+ ...
124
+ ]
125
+ ```
126
+
127
+ ## License
128
+
129
+ [MIT](LICENSE)
package/biome.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "root": false,
3
+ "$schema": "https://biomejs.dev/schemas/2.0.0/schema.json",
4
+ "vcs": {
5
+ "enabled": true,
6
+ "clientKind": "git",
7
+ "useIgnoreFile": true
8
+ },
9
+ "files": {
10
+ "ignoreUnknown": false,
11
+ "includes": ["**"]
12
+ },
13
+ "formatter": {
14
+ "enabled": true,
15
+ "indentStyle": "space"
16
+ },
17
+ "assist": { "actions": { "source": { "organizeImports": "on" } } },
18
+ "linter": {
19
+ "enabled": true,
20
+ "rules": {
21
+ "recommended": true,
22
+ "complexity": {
23
+ "useLiteralKeys": "off"
24
+ },
25
+ "suspicious": {
26
+ "noExplicitAny": "off"
27
+ },
28
+ "style": {
29
+ "noParameterAssign": "error",
30
+ "useAsConstAssertion": "error",
31
+ "useDefaultParameterLast": "error",
32
+ "useEnumInitializers": "error",
33
+ "useSelfClosingElements": "error",
34
+ "useSingleVarDeclarator": "error",
35
+ "noUnusedTemplateLiteral": "error",
36
+ "useNumberNamespace": "error",
37
+ "noInferrableTypes": "error",
38
+ "noUselessElse": "error"
39
+ }
40
+ }
41
+ },
42
+ "javascript": {
43
+ "formatter": {
44
+ "quoteStyle": "double",
45
+ "semicolons": "always",
46
+ "indentStyle": "space",
47
+ "indentWidth": 2
48
+ }
49
+ }
50
+ }
@@ -0,0 +1,9 @@
1
+ import { html } from "lit";
2
+
3
+ describe("<solid-boilerplate>", () => {
4
+ it("should mount", () => {
5
+ cy.mount(html`<solid-boilerplate></solid-boilerplate>`);
6
+
7
+ cy.get("solid-boilerplate").should("exist");
8
+ });
9
+ });
@@ -0,0 +1,12 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
6
+ <meta name="viewport" content="width=device-width,initial-scale=1.0" />
7
+ <title>Components App</title>
8
+ </head>
9
+ <body>
10
+ <div data-cy-root></div>
11
+ </body>
12
+ </html>
@@ -0,0 +1,17 @@
1
+ import { mount } from "cypress-ct-lit";
2
+ import "/src/index.ts";
3
+
4
+ declare global {
5
+ namespace Cypress {
6
+ interface Chainable {
7
+ /**
8
+ * Mount your template/component into Cypress sandbox
9
+ * @param template
10
+ * @param options render options for custom rendering
11
+ */
12
+ mount: typeof mount;
13
+ }
14
+ }
15
+ }
16
+
17
+ Cypress.Commands.add("mount", mount);
@@ -0,0 +1,11 @@
1
+ import { defineConfig } from "cypress";
2
+
3
+ export default defineConfig({
4
+ component: {
5
+ includeShadowDom: true,
6
+ devServer: {
7
+ framework: "cypress-ct-lit",
8
+ bundler: "vite",
9
+ },
10
+ },
11
+ });
@@ -0,0 +1 @@
1
+ @import"https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap";:root{--font-family:"Inter",sans-serif;--color-text:#181d27;--color-primary:#001aff;--color-secondary:#001aff;--color-third:#e4f0ff;--color-heading:#181d27;font-family:var(--font-family)}