@supersoniks/concorde 3.1.57 → 3.1.59
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.
- package/build-infos.json +1 -1
- package/concorde-core.bundle.js +222 -187
- package/concorde-core.es.js +1555 -1445
- package/dist/concorde-core.bundle.js +222 -187
- package/dist/concorde-core.es.js +1555 -1445
- package/docs/assets/index-D9bBwsCn.js +4537 -0
- package/docs/assets/index-DCRPZO3x.css +1 -0
- package/docs/css/docs.css +0 -0
- package/docs/fonts/ClashGrotesk-Bold.eot +0 -0
- package/docs/fonts/ClashGrotesk-Bold.ttf +0 -0
- package/docs/fonts/ClashGrotesk-Bold.woff +0 -0
- package/docs/fonts/ClashGrotesk-Bold.woff2 +0 -0
- package/docs/fonts/ClashGrotesk-Extralight.eot +0 -0
- package/docs/fonts/ClashGrotesk-Extralight.ttf +0 -0
- package/docs/fonts/ClashGrotesk-Extralight.woff +0 -0
- package/docs/fonts/ClashGrotesk-Extralight.woff2 +0 -0
- package/docs/fonts/ClashGrotesk-Light.eot +0 -0
- package/docs/fonts/ClashGrotesk-Light.ttf +0 -0
- package/docs/fonts/ClashGrotesk-Light.woff +0 -0
- package/docs/fonts/ClashGrotesk-Light.woff2 +0 -0
- package/docs/fonts/ClashGrotesk-Medium.eot +0 -0
- package/docs/fonts/ClashGrotesk-Medium.ttf +0 -0
- package/docs/fonts/ClashGrotesk-Medium.woff +0 -0
- package/docs/fonts/ClashGrotesk-Medium.woff2 +0 -0
- package/docs/fonts/ClashGrotesk-Regular.eot +0 -0
- package/docs/fonts/ClashGrotesk-Regular.ttf +0 -0
- package/docs/fonts/ClashGrotesk-Regular.woff +0 -0
- package/docs/fonts/ClashGrotesk-Regular.woff2 +0 -0
- package/docs/fonts/ClashGrotesk-Semibold.eot +0 -0
- package/docs/fonts/ClashGrotesk-Semibold.ttf +0 -0
- package/docs/fonts/ClashGrotesk-Semibold.woff +0 -0
- package/docs/fonts/ClashGrotesk-Semibold.woff2 +0 -0
- package/docs/fonts/ClashGrotesk-Variable.eot +0 -0
- package/docs/fonts/ClashGrotesk-Variable.ttf +0 -0
- package/docs/fonts/ClashGrotesk-Variable.woff +0 -0
- package/docs/fonts/ClashGrotesk-Variable.woff2 +0 -0
- package/docs/img/concorde-icon.svg +5 -0
- package/docs/img/concorde-logo.svg +1 -0
- package/docs/img/concorde.png +0 -0
- package/docs/img/concorde_def.png +0 -0
- package/docs/img/concorde_seuil.png.webp +0 -0
- package/docs/img/concorde_seuil_invert.png +0 -0
- package/docs/img/paul_metrand.jpg +0 -0
- package/docs/img/paul_metrand_xs.jpg +0 -0
- package/docs/index.html +93 -0
- package/docs/src/core/components/functional/date/date.md +290 -0
- package/docs/src/core/components/functional/fetch/fetch.md +117 -0
- package/docs/src/core/components/functional/if/if.md +16 -0
- package/docs/src/core/components/functional/list/list.md +199 -0
- package/docs/src/core/components/functional/mix/mix.md +41 -0
- package/docs/src/core/components/functional/queue/queue.md +87 -0
- package/docs/src/core/components/functional/router/router.md +108 -0
- package/docs/src/core/components/functional/sdui/default-library.json +108 -0
- package/docs/src/core/components/functional/sdui/example.json +99 -0
- package/docs/src/core/components/functional/sdui/sdui.md +356 -0
- package/docs/src/core/components/functional/states/states.md +87 -0
- package/docs/src/core/components/functional/submit/submit.md +83 -0
- package/docs/src/core/components/functional/subscriber/subscriber.md +91 -0
- package/docs/src/core/components/functional/value/value.md +35 -0
- package/docs/src/core/components/ui/alert/alert.md +121 -0
- package/docs/src/core/components/ui/alert-messages/alert-messages.md +0 -0
- package/docs/src/core/components/ui/badge/badge.md +127 -0
- package/docs/src/core/components/ui/button/button.md +182 -0
- package/docs/src/core/components/ui/captcha/captcha.md +12 -0
- package/docs/src/core/components/ui/card/card.md +97 -0
- package/docs/src/core/components/ui/divider/divider.md +35 -0
- package/docs/src/core/components/ui/form/checkbox/checkbox.md +94 -0
- package/docs/src/core/components/ui/form/fieldset/fieldset.md +129 -0
- package/docs/src/core/components/ui/form/form-actions/form-actions.md +77 -0
- package/docs/src/core/components/ui/form/form-layout/form-layout.md +44 -0
- package/docs/src/core/components/ui/form/input/input.md +167 -0
- package/docs/src/core/components/ui/form/input-autocomplete/input-autocomplete.md +130 -0
- package/docs/src/core/components/ui/form/radio/radio.md +84 -0
- package/docs/src/core/components/ui/form/select/select.md +97 -0
- package/docs/src/core/components/ui/form/switch/switch.md +84 -0
- package/docs/src/core/components/ui/form/textarea/textarea.md +65 -0
- package/docs/src/core/components/ui/group/group.md +75 -0
- package/docs/src/core/components/ui/icon/icon.md +125 -0
- package/docs/src/core/components/ui/icon/icons.json +1 -0
- package/docs/src/core/components/ui/image/image.md +107 -0
- package/docs/src/core/components/ui/link/link.md +43 -0
- package/docs/src/core/components/ui/loader/loader.md +67 -0
- package/docs/src/core/components/ui/menu/menu.md +288 -0
- package/docs/src/core/components/ui/modal/modal.md +123 -0
- package/docs/src/core/components/ui/pop/pop.md +79 -0
- package/docs/src/core/components/ui/progress/progress.md +63 -0
- package/docs/src/core/components/ui/table/table.md +455 -0
- package/docs/src/core/components/ui/tooltip/tooltip.md +82 -0
- package/docs/src/docs/_core-concept/overview.md +57 -0
- package/docs/src/docs/_core-concept/subscriber.md +76 -0
- package/docs/src/docs/_getting-started/concorde-outside.md +143 -0
- package/docs/src/docs/_getting-started/create-a-component.md +137 -0
- package/docs/src/docs/_getting-started/my-first-subscriber.md +174 -0
- package/docs/src/docs/_getting-started/pubsub.md +150 -0
- package/docs/src/docs/_getting-started/start.md +39 -0
- package/docs/src/docs/_getting-started/theming.md +91 -0
- package/docs/src/docs/search/docs-search.json +3902 -0
- package/docs/src/tag-list.json +1 -0
- package/docs/src/tsconfig-model.json +23 -0
- package/docs/src/tsconfig.json +835 -0
- package/docs/svg/regular/plane.svg +1 -0
- package/docs/svg/solid/plane.svg +1 -0
- package/index.html +1 -1
- package/package.json +6 -2
- package/php/get-challenge.php +34 -0
- package/php/some-service.php +42 -0
- package/scripts/create-search.js +0 -0
- package/src/core/_types/types.ts +0 -5
- package/src/core/components/functional/date/date.ts +0 -0
- package/src/core/components/functional/functional.ts +0 -0
- package/src/core/components/functional/list/list.ts +72 -2
- package/src/core/components/functional/queue/queue.ts +19 -11
- package/src/core/components/functional/submit/submit.ts +41 -34
- package/src/core/components/functional/translation/translation.ts +0 -0
- package/src/core/components/ui/_css/scroll.ts +0 -0
- package/src/core/components/ui/_css/shadow.ts +0 -0
- package/src/core/components/ui/_css/size.ts +0 -0
- package/src/core/components/ui/_css/type.ts +0 -0
- package/src/core/components/ui/alert/alert.ts +0 -0
- package/src/core/components/ui/alert-messages/alert-messages.md +0 -0
- package/src/core/components/ui/badge/badge.ts +1 -1
- package/src/core/components/ui/button/button.ts +0 -0
- package/src/core/components/ui/captcha/captcha.md +13 -1
- package/src/core/components/ui/captcha/captcha.ts +96 -44
- package/src/core/components/ui/card/card-footer.ts +0 -0
- package/src/core/components/ui/card/card-header-descripton.ts +0 -0
- package/src/core/components/ui/card/card-header.ts +0 -0
- package/src/core/components/ui/card/card-main.ts +0 -0
- package/src/core/components/ui/card/card.md +0 -0
- package/src/core/components/ui/card/card.ts +0 -0
- package/src/core/components/ui/divider/divider.ts +0 -0
- package/src/core/components/ui/form/checkbox/checkbox.ts +0 -0
- package/src/core/components/ui/form/fieldset/legend-description.ts +0 -0
- package/src/core/components/ui/form/fieldset/legend.ts +0 -0
- package/src/core/components/ui/form/input/input.md +0 -0
- package/src/core/components/ui/form/input-autocomplete/input-autocomplete.ts +0 -0
- package/src/core/components/ui/form/radio/radio.ts +0 -0
- package/src/core/components/ui/form/select/select.ts +0 -0
- package/src/core/components/ui/form/switch/switch.md +0 -0
- package/src/core/components/ui/form/textarea/textarea.ts +0 -0
- package/src/core/components/ui/icon/icons.ts +0 -0
- package/src/core/components/ui/loader/loader.md +0 -0
- package/src/core/components/ui/loader/loader.ts +0 -0
- package/src/core/components/ui/loader/styles/fixed.ts +0 -0
- package/src/core/components/ui/loader/styles/inline.ts +0 -0
- package/src/core/components/ui/modal/modal-actions.ts +0 -0
- package/src/core/components/ui/modal/modal-subtitle.ts +0 -0
- package/src/core/components/ui/modal/modal-title.ts +0 -0
- package/src/core/components/ui/modal/modal.md +0 -0
- package/src/core/components/ui/modal/modal.ts +0 -0
- package/src/core/components/ui/pop/pop.ts +0 -0
- package/src/core/components/ui/progress/progress.ts +0 -0
- package/src/core/components/ui/table/table-tbody.ts +0 -0
- package/src/core/components/ui/table/table-th.ts +0 -0
- package/src/core/components/ui/table/table.ts +0 -0
- package/src/core/components/ui/theme/theme-collection/core-variables.ts +0 -0
- package/src/core/components/ui/theme/theme-collection/light.ts +0 -0
- package/src/core/components/ui/theme/theme.ts +0 -0
- package/src/core/components/ui/toast/toast-item.ts +0 -0
- package/src/core/components/ui/tooltip/tooltip.ts +0 -0
- package/src/core/components/ui/ui.ts +0 -0
- package/src/core/directives/DataProvider.ts +0 -0
- package/src/core/directives/Wording.ts +0 -0
- package/src/core/mixins/Fetcher.ts +30 -24
- package/src/core/mixins/FormElement.ts +0 -0
- package/src/core/mixins/Subscriber.ts +0 -0
- package/src/core/utils/Utils.ts +0 -0
- package/src/core/utils/aesCrypto.ts +129 -0
- package/src/docs/header/header.ts +0 -0
- package/src/docs/layout.ts +0 -0
- package/src/docs/navigation/navigation.ts +0 -0
- package/src/docs/search/docs-search.json +0 -0
- package/src/docs/search/search.ts +0 -0
- package/src/docs/tailwind/css/tailwind.css +0 -0
- package/src/index.ts +0 -0
- package/src/tsconfig.json +3 -0
- package/src/tsconfig.tsbuildinfo +1 -1
- package/tailwind.config.js +0 -0
- package/vite.config.mts +2 -0
- package/vite.config.mts.timestamp-1728318208370-f1724bcfd87d3.mjs +0 -85
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import { Subscriber } from "@supersoniks/concorde/mixins";
|
|
2
|
-
import { PublisherManager } from "@supersoniks/concorde/utils";
|
|
3
|
-
import { html, LitElement } from "lit";
|
|
2
|
+
import { HTML, PublisherManager } from "@supersoniks/concorde/utils";
|
|
3
|
+
import { css, html, LitElement, nothing } from "lit";
|
|
4
4
|
import { customElement, property } from "lit/decorators.js";
|
|
5
5
|
import { ConcordeWindow } from "@supersoniks/concorde/core/_types/types";
|
|
6
6
|
import Publisher from "@supersoniks/concorde/core/utils/PublisherProxy";
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
generateKey,
|
|
9
|
+
encryptToBase64,
|
|
10
|
+
} from "@supersoniks/concorde/core/utils/aesCrypto";
|
|
11
|
+
|
|
12
|
+
const PASS_PHRASE = "supersoniks_altcha";
|
|
13
|
+
const IV = "Si2\\]X8M4!n9DCLd";
|
|
14
|
+
|
|
15
|
+
let scriptAdded = false;
|
|
8
16
|
|
|
9
17
|
declare const window: ConcordeWindow;
|
|
10
18
|
const tagName = "sonic-captcha";
|
|
@@ -16,14 +24,34 @@ const tagName = "sonic-captcha";
|
|
|
16
24
|
*/
|
|
17
25
|
@customElement(tagName)
|
|
18
26
|
export class Captcha extends Subscriber(LitElement) {
|
|
27
|
+
static styles = [
|
|
28
|
+
css`
|
|
29
|
+
:host {
|
|
30
|
+
--altcha-border-width: var(--sc-border-width, 1px);
|
|
31
|
+
--altcha-border-radius: var(--sc-rounded);
|
|
32
|
+
--altcha-color-base: var(--sc-base);
|
|
33
|
+
--altcha-color-border: var(
|
|
34
|
+
--sc-input-border-color,
|
|
35
|
+
var(--sc-base-content, #000)
|
|
36
|
+
);
|
|
37
|
+
--altcha-color-text: currentColor;
|
|
38
|
+
--altcha-color-border-focus: currentColor;
|
|
39
|
+
--altcha-color-error-text: var(
|
|
40
|
+
--sc-danger,
|
|
41
|
+
var(--sc-base-content, #000)
|
|
42
|
+
);
|
|
43
|
+
--altcha-color-footer-bg: var(--sc-base-100);
|
|
44
|
+
--altcha-max-width: 260px;
|
|
45
|
+
}
|
|
46
|
+
`,
|
|
47
|
+
];
|
|
19
48
|
@property() key = "";
|
|
20
49
|
@property() action: string | null = null;
|
|
21
50
|
@property({ type: Number }) zIndex = 9999;
|
|
22
51
|
formPublisher?: {
|
|
23
52
|
needsCaptchaValidation: boolean;
|
|
53
|
+
captchaKey: string;
|
|
24
54
|
captchaToken: Publisher<string> | string;
|
|
25
|
-
captchaMethod?: { get: () => string };
|
|
26
|
-
captchaAction?: { get: () => string };
|
|
27
55
|
};
|
|
28
56
|
|
|
29
57
|
onCaptchaTokenChanged = (v: string) => {
|
|
@@ -33,27 +61,22 @@ export class Captcha extends Subscriber(LitElement) {
|
|
|
33
61
|
}
|
|
34
62
|
};
|
|
35
63
|
connectedCallback() {
|
|
36
|
-
|
|
37
|
-
if (!document.getElementById("captcha-" + this.key)) {
|
|
64
|
+
if (!scriptAdded) {
|
|
38
65
|
const script = document.createElement("script");
|
|
39
|
-
script.
|
|
40
|
-
|
|
66
|
+
script.type = "module";
|
|
67
|
+
this.setAttribute("async", "");
|
|
68
|
+
this.setAttribute("defer", "");
|
|
69
|
+
script.src = "https://eu.altcha.org/js/latest/altcha.min.js";
|
|
70
|
+
scriptAdded = true;
|
|
41
71
|
document.head.appendChild(script);
|
|
42
72
|
}
|
|
73
|
+
this.generateEncryptedKey();
|
|
43
74
|
super.connectedCallback();
|
|
44
75
|
this.formPublisher = PublisherManager.get(
|
|
45
76
|
this.getAncestorAttributeValue("headersDataProvider") ??
|
|
46
77
|
this.getAncestorAttributeValue("formDataProvider")
|
|
47
78
|
);
|
|
48
79
|
|
|
49
|
-
// add css to document to force z-index
|
|
50
|
-
if (!document.getElementById("concorde-recaptcha-css")) {
|
|
51
|
-
const style = document.createElement("style");
|
|
52
|
-
style.innerHTML = ".grecaptcha-badge {z-index: 9999;}";
|
|
53
|
-
style.id = "concorde-recaptcha-css";
|
|
54
|
-
document.head.appendChild(style);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
80
|
if (
|
|
58
81
|
this.formPublisher &&
|
|
59
82
|
!(this.formPublisher.captchaToken as Publisher<string>).get()
|
|
@@ -77,35 +100,64 @@ export class Captcha extends Subscriber(LitElement) {
|
|
|
77
100
|
requestToken() {
|
|
78
101
|
if (!this.formPublisher) return;
|
|
79
102
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
"submit"
|
|
86
|
-
).replace(/[^\w_/]/g, "_");
|
|
87
|
-
const method = (
|
|
88
|
-
this.formPublisher.captchaMethod?.get() ?? "POST"
|
|
89
|
-
).toUpperCase();
|
|
90
|
-
delete this.formPublisher.captchaAction;
|
|
91
|
-
delete this.formPublisher.captchaMethod;
|
|
92
|
-
if (!window.grecaptcha) {
|
|
93
|
-
log("grecaptcha not loaded");
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
window.grecaptcha.ready(() => {
|
|
97
|
-
if (!window.grecaptcha) return;
|
|
98
|
-
window.grecaptcha
|
|
99
|
-
.execute(this.key, { action: method + "//" + action })
|
|
100
|
-
.then((token: string) => {
|
|
101
|
-
if (this.formPublisher) {
|
|
102
|
-
this.formPublisher.captchaToken = token;
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
});
|
|
103
|
+
const form = this.shadowRoot.querySelector("form");
|
|
104
|
+
if (!form) return;
|
|
105
|
+
const formData = new FormData(form);
|
|
106
|
+
this.formPublisher.captchaKey = this.key;
|
|
107
|
+
this.formPublisher.captchaToken = formData.get("altcha")?.toString() || "";
|
|
106
108
|
}
|
|
107
109
|
|
|
110
|
+
async generateEncryptedKey() {
|
|
111
|
+
if (this.key) return;
|
|
112
|
+
const key = await generateKey();
|
|
113
|
+
const iv = new TextEncoder().encode(IV);
|
|
114
|
+
const encryptedBase64 = await encryptToBase64(PASS_PHRASE, key, iv);
|
|
115
|
+
this.key = encryptedBase64;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
maxNumber = 50000;
|
|
119
|
+
chalengeUrl = "https://altcha.supersoniks.org/get-challenge";
|
|
108
120
|
protected render() {
|
|
109
|
-
|
|
121
|
+
if (!this.key) {
|
|
122
|
+
return nothing;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const isFR = HTML.getLanguage().match("^fr\\b");
|
|
126
|
+
const labels = isFR
|
|
127
|
+
? {
|
|
128
|
+
aria: "Visitez altcha.org",
|
|
129
|
+
error: "La vérification a échoué, réessayez plus tard.",
|
|
130
|
+
expired: "La vérification a expiré, réessayez.",
|
|
131
|
+
footer: "Protégé par Altcha",
|
|
132
|
+
label: "Je ne suis pas un robot.",
|
|
133
|
+
verified: "Vérifié",
|
|
134
|
+
verifying: "Vérification en cours...",
|
|
135
|
+
wait: "Vérification en cours… Veuillez patienter.",
|
|
136
|
+
}
|
|
137
|
+
: {
|
|
138
|
+
aria: "Visit altcha.org",
|
|
139
|
+
error: "Verification failed, try again later.",
|
|
140
|
+
expired: "Verification expired, try again.",
|
|
141
|
+
footer: "Protected by Altcha",
|
|
142
|
+
label: "I'm not a robot.",
|
|
143
|
+
verified: "Verified",
|
|
144
|
+
verifying: "Verifying...",
|
|
145
|
+
wait: "Verifying... Please wait.",
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
return html`
|
|
149
|
+
<form>
|
|
150
|
+
<altcha-widget
|
|
151
|
+
challengeurl="${this.chalengeUrl}?key=${this.key}&maxNumber=${this
|
|
152
|
+
.maxNumber}"
|
|
153
|
+
maxnumber=${this.maxNumber}
|
|
154
|
+
hidelogo
|
|
155
|
+
hidefooter
|
|
156
|
+
auto="onfocus"
|
|
157
|
+
strings=${JSON.stringify(labels)}
|
|
158
|
+
></altcha-widget>
|
|
159
|
+
</form>
|
|
160
|
+
<slot></slot>
|
|
161
|
+
`;
|
|
110
162
|
}
|
|
111
163
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -39,20 +39,19 @@ const dispatchFetchError = (apiResponse: Response) => {
|
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
const fetchComponents = new Set<{_fetchData:()=>void}>();
|
|
42
|
+
const fetchComponents = new Set<{ _fetchData: () => void }>();
|
|
43
43
|
let languageChangeRequestId = 0;
|
|
44
|
-
detecHTMLLanguageChange(async ()=>{
|
|
44
|
+
detecHTMLLanguageChange(async () => {
|
|
45
45
|
//relaunch 4 fetchs then wait the result before launching the next 4 fetchs
|
|
46
46
|
languageChangeRequestId++;
|
|
47
47
|
const currentRequestId = languageChangeRequestId;
|
|
48
48
|
const fetchers = Array.from(fetchComponents);
|
|
49
|
-
while(fetchers.length>0){
|
|
50
|
-
if(currentRequestId!=languageChangeRequestId) return;
|
|
51
|
-
const fourFetchers = fetchers.splice(0,4);
|
|
52
|
-
await Promise.all(fourFetchers.map((fetcher)=>fetcher._fetchData()));
|
|
49
|
+
while (fetchers.length > 0) {
|
|
50
|
+
if (currentRequestId != languageChangeRequestId) return;
|
|
51
|
+
const fourFetchers = fetchers.splice(0, 4);
|
|
52
|
+
await Promise.all(fourFetchers.map((fetcher) => fetcher._fetchData()));
|
|
53
53
|
}
|
|
54
|
-
}
|
|
55
|
-
);
|
|
54
|
+
});
|
|
56
55
|
|
|
57
56
|
const Fetcher = <
|
|
58
57
|
T extends Constructor<SubscriberInterface<PropsType>>,
|
|
@@ -63,7 +62,6 @@ const Fetcher = <
|
|
|
63
62
|
) => {
|
|
64
63
|
propsType;
|
|
65
64
|
class FetcherElement extends superClass {
|
|
66
|
-
|
|
67
65
|
api: API | null = null;
|
|
68
66
|
/**
|
|
69
67
|
* Après le chargement des données on traverse l'objet reçu en fonctione de la cible exprimées dans cette propriété avec la dot syntaxe.
|
|
@@ -259,21 +257,26 @@ const Fetcher = <
|
|
|
259
257
|
/**
|
|
260
258
|
* Première update, le comportement de lazyload est géré ici a l'aide d'un intersection observer.
|
|
261
259
|
*/
|
|
262
|
-
|
|
260
|
+
lazyLoadPlaceHolder?: HTMLSpanElement;
|
|
263
261
|
handleLazyLoad() {
|
|
264
262
|
if (!this.lazyLoad) {
|
|
265
263
|
return;
|
|
266
264
|
}
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
265
|
+
/**
|
|
266
|
+
* Should not be required
|
|
267
|
+
* Todo : remove after success
|
|
268
|
+
* creates forced reflow
|
|
269
|
+
*/
|
|
270
|
+
// const rect = this.getBoundingClientRect();
|
|
271
|
+
// if (
|
|
272
|
+
// rect.x < window.innerWidth &&
|
|
273
|
+
// rect.right > 0 &&
|
|
274
|
+
// rect.y < window.innerHeight &&
|
|
275
|
+
// rect.right > 0
|
|
276
|
+
// ) {
|
|
277
|
+
// this._fetchData();
|
|
278
|
+
// return;
|
|
279
|
+
// }
|
|
277
280
|
|
|
278
281
|
const boundsRatio = parseFloat(
|
|
279
282
|
this.getAttribute("lazyBoundsRatio") || "1"
|
|
@@ -302,14 +305,17 @@ const Fetcher = <
|
|
|
302
305
|
(e) => e.nodeName.toLowerCase() != "style"
|
|
303
306
|
)[0] as HTMLElement;
|
|
304
307
|
if (!elt || elt.nodeName.toLocaleLowerCase() == "template") {
|
|
305
|
-
elt = document.createElement("
|
|
308
|
+
elt = document.createElement("div");
|
|
306
309
|
const style = elt.style;
|
|
307
310
|
/**
|
|
308
311
|
* !!! Pas de position absolute ici si on veut que le composant soit au bon endroit dans la page pour l'intersection observer
|
|
309
312
|
* En effest sinon il vpeut remonter en congugaison avec le style display="contents"
|
|
310
313
|
*/
|
|
311
314
|
style.pointerEvents = "none";
|
|
312
|
-
|
|
315
|
+
style.width = "1px";
|
|
316
|
+
style.height = "1px";
|
|
317
|
+
this.lazyLoadPlaceHolder = elt;
|
|
318
|
+
|
|
313
319
|
this.appendChild(elt);
|
|
314
320
|
}
|
|
315
321
|
if (elt) {
|
|
@@ -322,8 +328,8 @@ const Fetcher = <
|
|
|
322
328
|
for (const e of entries) {
|
|
323
329
|
if (e.isIntersecting && this.isFirstLoad) {
|
|
324
330
|
this._fetchData();
|
|
325
|
-
this.
|
|
326
|
-
this.
|
|
331
|
+
this.lazyLoadPlaceHolder?.remove();
|
|
332
|
+
this.lazyLoadPlaceHolder = undefined;
|
|
327
333
|
this.iObserver?.disconnect();
|
|
328
334
|
break;
|
|
329
335
|
}
|
|
File without changes
|
|
File without changes
|
package/src/core/utils/Utils.ts
CHANGED
|
File without changes
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
// Algorithme et configuration constants
|
|
2
|
+
const algorithm = "AES-CBC";
|
|
3
|
+
const keyLength = 256;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Génère une clé AES-256
|
|
7
|
+
*/
|
|
8
|
+
export async function generateKey(): Promise<CryptoKey> {
|
|
9
|
+
return crypto.subtle.generateKey(
|
|
10
|
+
{
|
|
11
|
+
name: algorithm,
|
|
12
|
+
length: keyLength,
|
|
13
|
+
},
|
|
14
|
+
true, // extractable
|
|
15
|
+
["encrypt", "decrypt"]
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Exporte une clé AES en format JSON Web Key (JWK)
|
|
21
|
+
*/
|
|
22
|
+
export async function exportKey(key: CryptoKey): Promise<JsonWebKey> {
|
|
23
|
+
return crypto.subtle.exportKey("jwk", key);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Importe une clé AES à partir d'un format JSON Web Key (JWK)
|
|
28
|
+
*/
|
|
29
|
+
export async function importKey(jwk: JsonWebKey): Promise<CryptoKey> {
|
|
30
|
+
return crypto.subtle.importKey(
|
|
31
|
+
"jwk",
|
|
32
|
+
jwk,
|
|
33
|
+
{ name: algorithm },
|
|
34
|
+
true, // extractable
|
|
35
|
+
["encrypt", "decrypt"]
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Encode les données en Base64
|
|
41
|
+
*/
|
|
42
|
+
function toBase64(buffer: ArrayBuffer): string {
|
|
43
|
+
return btoa(String.fromCharCode(...new Uint8Array(buffer)));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Décode les données en Base64
|
|
48
|
+
*/
|
|
49
|
+
function fromBase64(base64: string): ArrayBuffer {
|
|
50
|
+
const binaryString = atob(base64);
|
|
51
|
+
const bytes = new Uint8Array(binaryString.length);
|
|
52
|
+
for (let i = 0; i < binaryString.length; i++) {
|
|
53
|
+
bytes[i] = binaryString.charCodeAt(i);
|
|
54
|
+
}
|
|
55
|
+
return bytes.buffer;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Chiffre une donnée
|
|
60
|
+
* @param data - Les données à chiffrer
|
|
61
|
+
* @param key - La clé AES
|
|
62
|
+
* @param iv - Le vecteur d'initialisation
|
|
63
|
+
* @returns Une chaîne encodée en Base64
|
|
64
|
+
*/
|
|
65
|
+
export async function encryptToBase64(
|
|
66
|
+
data: string,
|
|
67
|
+
key: CryptoKey,
|
|
68
|
+
iv: Uint8Array
|
|
69
|
+
): Promise<string> {
|
|
70
|
+
const encodedData = new TextEncoder().encode(data);
|
|
71
|
+
const encrypted = await crypto.subtle.encrypt(
|
|
72
|
+
{
|
|
73
|
+
name: algorithm,
|
|
74
|
+
iv: iv,
|
|
75
|
+
},
|
|
76
|
+
key,
|
|
77
|
+
encodedData
|
|
78
|
+
);
|
|
79
|
+
return toBase64(encrypted);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Déchiffre une donnée
|
|
84
|
+
* @param base64Data - Les données chiffrées en Base64
|
|
85
|
+
* @param key - La clé AES
|
|
86
|
+
* @param iv - Le vecteur d'initialisation
|
|
87
|
+
* @returns Une chaîne déchiffrée
|
|
88
|
+
*/
|
|
89
|
+
export async function decryptFromBase64(
|
|
90
|
+
base64Data: string,
|
|
91
|
+
key: CryptoKey,
|
|
92
|
+
iv: Uint8Array
|
|
93
|
+
): Promise<string> {
|
|
94
|
+
const encryptedData = fromBase64(base64Data);
|
|
95
|
+
const decrypted = await crypto.subtle.decrypt(
|
|
96
|
+
{
|
|
97
|
+
name: algorithm,
|
|
98
|
+
iv: iv,
|
|
99
|
+
},
|
|
100
|
+
key,
|
|
101
|
+
encryptedData
|
|
102
|
+
);
|
|
103
|
+
return new TextDecoder().decode(decrypted);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* USAGE
|
|
108
|
+
|
|
109
|
+
import { generateKey, encryptToBase64, decryptFromBase64, exportKey, importKey } from './aesCrypto';
|
|
110
|
+
|
|
111
|
+
(async () => {
|
|
112
|
+
const key = await generateKey();
|
|
113
|
+
const iv = crypto.getRandomValues(new Uint8Array(16)); // Génère un IV aléatoire
|
|
114
|
+
|
|
115
|
+
const data = "Ceci est un secret!";
|
|
116
|
+
|
|
117
|
+
// Chiffrement
|
|
118
|
+
const encryptedBase64 = await encryptToBase64(data, key, iv);
|
|
119
|
+
|
|
120
|
+
// Déchiffrement
|
|
121
|
+
const decrypted = await decryptFromBase64(encryptedBase64, key, iv);
|
|
122
|
+
|
|
123
|
+
// Exporter et importer la clé
|
|
124
|
+
const exportedKey = await exportKey(key);
|
|
125
|
+
|
|
126
|
+
const importedKey = await importKey(exportedKey);
|
|
127
|
+
})();
|
|
128
|
+
|
|
129
|
+
*/
|
|
File without changes
|
package/src/docs/layout.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/index.ts
CHANGED
|
File without changes
|
package/src/tsconfig.json
CHANGED
package/src/tsconfig.tsbuildinfo
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["./components.ts","./concorde-loaded.ts","./decorators.ts","./directives.ts","./index.ts","./mixins.ts","./utils.ts","./core/core.ts","./core/_types/types.ts","./core/components/functional/functional.ts","./core/components/functional/date/date.ts","./core/components/functional/example/example.ts","./core/components/functional/fetch/fetch.ts","./core/components/functional/if/if.test.ts","./core/components/functional/if/if.ts","./core/components/functional/list/list.ts","./core/components/functional/mix/mix.ts","./core/components/functional/queue/queue.ts","./core/components/functional/router/redirect.ts","./core/components/functional/router/router.ts","./core/components/functional/sdui/SDUIDescriptorTransformer.ts","./core/components/functional/sdui/sdui-utils.ts","./core/components/functional/sdui/sdui.ts","./core/components/functional/sdui/types.ts","./core/components/functional/sonic-scope/sonic-scope.ts","./core/components/functional/states/states.ts","./core/components/functional/submit/submit.ts","./core/components/functional/subscriber/subscriber.ts","./core/components/functional/translation/translation.ts","./core/components/functional/value/value.ts","./core/components/ui/ui.ts","./core/components/ui/_css/scroll.ts","./core/components/ui/_css/shadow.ts","./core/components/ui/_css/size.ts","./core/components/ui/_css/type.ts","./core/components/ui/alert/alert.ts","./core/components/ui/alert-messages/alert-messages.ts","./core/components/ui/badge/badge.ts","./core/components/ui/button/button.ts","./core/components/ui/captcha/captcha.ts","./core/components/ui/card/card-footer.ts","./core/components/ui/card/card-header-descripton.ts","./core/components/ui/card/card-header.ts","./core/components/ui/card/card-main.ts","./core/components/ui/card/card.ts","./core/components/ui/divider/divider.ts","./core/components/ui/form/checkbox/checkbox.ts","./core/components/ui/form/css/form-control.ts","./core/components/ui/form/fieldset/fieldset.ts","./core/components/ui/form/fieldset/legend-description.ts","./core/components/ui/form/fieldset/legend.ts","./core/components/ui/form/form-actions/form-actions.ts","./core/components/ui/form/form-layout/form-layout.ts","./core/components/ui/form/input/input.ts","./core/components/ui/form/input/password-helper.ts","./core/components/ui/form/input/same-value-helper.ts","./core/components/ui/form/input-autocomplete/input-autocomplete.ts","./core/components/ui/form/radio/radio.ts","./core/components/ui/form/select/select.ts","./core/components/ui/form/switch/switch.ts","./core/components/ui/form/textarea/textarea.ts","./core/components/ui/group/group.ts","./core/components/ui/icon/icon.stories.ts","./core/components/ui/icon/icon.ts","./core/components/ui/icon/icons.ts","./core/components/ui/image/image.ts","./core/components/ui/link/link.ts","./core/components/ui/loader/loader.stories.ts","./core/components/ui/loader/loader.ts","./core/components/ui/loader/styles/fixed.ts","./core/components/ui/loader/styles/inline.ts","./core/components/ui/menu/menu-item.ts","./core/components/ui/menu/menu.ts","./core/components/ui/modal/modal-actions.ts","./core/components/ui/modal/modal-close.ts","./core/components/ui/modal/modal-content.ts","./core/components/ui/modal/modal-subtitle.ts","./core/components/ui/modal/modal-title.ts","./core/components/ui/modal/modal.stories.ts","./core/components/ui/modal/modal.ts","./core/components/ui/pop/pop.ts","./core/components/ui/progress/progress.ts","./core/components/ui/table/table-caption.ts","./core/components/ui/table/table-tbody.ts","./core/components/ui/table/table-td.ts","./core/components/ui/table/table-tfoot.ts","./core/components/ui/table/table-th.ts","./core/components/ui/table/table-thead.ts","./core/components/ui/table/table-tr.ts","./core/components/ui/table/table.ts","./core/components/ui/theme/theme.ts","./core/components/ui/theme/theme-collection/core-variables.ts","./core/components/ui/theme/theme-collection/dark.ts","./core/components/ui/theme/theme-collection/light.ts","./core/components/ui/toast/message-subscriber.stories.ts","./core/components/ui/toast/message-subscriber.ts","./core/components/ui/toast/toast-item.ts","./core/components/ui/toast/toast.ts","./core/components/ui/toast/types.ts","./core/components/ui/tooltip/tooltip.ts","./core/decorators/Subscriber.ts","./core/directives/DataProvider.ts","./core/directives/Wording.ts","./core/mixins/Fetcher.ts","./core/mixins/FormCheckable.ts","./core/mixins/FormElement.ts","./core/mixins/FormInput.ts","./core/mixins/Subscriber.ts","./core/mixins/TemplatesContainer.ts","./core/mixins/mixins.ts","./core/utils/Arrays.ts","./core/utils/DataBindObserver.ts","./core/utils/Electron.ts","./core/utils/Format.ts","./core/utils/HTML.ts","./core/utils/LocationHandler.ts","./core/utils/Objects.ts","./core/utils/PublisherProxy.ts","./core/utils/Utils.ts","./core/utils/api.ts","./core/utils/route.ts","./core/utils/url-pattern.ts","./test-utils/TestUtils.ts"],"version":"5.6.3"}
|
|
1
|
+
{"root":["./components.ts","./concorde-loaded.ts","./decorators.ts","./directives.ts","./index.ts","./mixins.ts","./utils.ts","./core/core.ts","./core/_types/types.ts","./core/components/functional/functional.ts","./core/components/functional/date/date.ts","./core/components/functional/example/example.ts","./core/components/functional/fetch/fetch.ts","./core/components/functional/if/if.test.ts","./core/components/functional/if/if.ts","./core/components/functional/list/list.ts","./core/components/functional/mix/mix.ts","./core/components/functional/queue/queue.ts","./core/components/functional/router/redirect.ts","./core/components/functional/router/router.ts","./core/components/functional/sdui/SDUIDescriptorTransformer.ts","./core/components/functional/sdui/sdui-utils.ts","./core/components/functional/sdui/sdui.ts","./core/components/functional/sdui/types.ts","./core/components/functional/sonic-scope/sonic-scope.ts","./core/components/functional/states/states.ts","./core/components/functional/submit/submit.ts","./core/components/functional/subscriber/subscriber.ts","./core/components/functional/translation/translation.ts","./core/components/functional/value/value.ts","./core/components/ui/ui.ts","./core/components/ui/_css/scroll.ts","./core/components/ui/_css/shadow.ts","./core/components/ui/_css/size.ts","./core/components/ui/_css/type.ts","./core/components/ui/alert/alert.ts","./core/components/ui/alert-messages/alert-messages.ts","./core/components/ui/badge/badge.ts","./core/components/ui/button/button.ts","./core/components/ui/captcha/captcha.ts","./core/components/ui/card/card-footer.ts","./core/components/ui/card/card-header-descripton.ts","./core/components/ui/card/card-header.ts","./core/components/ui/card/card-main.ts","./core/components/ui/card/card.ts","./core/components/ui/divider/divider.ts","./core/components/ui/form/checkbox/checkbox.ts","./core/components/ui/form/css/form-control.ts","./core/components/ui/form/fieldset/fieldset.ts","./core/components/ui/form/fieldset/legend-description.ts","./core/components/ui/form/fieldset/legend.ts","./core/components/ui/form/form-actions/form-actions.ts","./core/components/ui/form/form-layout/form-layout.ts","./core/components/ui/form/input/input.ts","./core/components/ui/form/input/password-helper.ts","./core/components/ui/form/input/same-value-helper.ts","./core/components/ui/form/input-autocomplete/input-autocomplete.ts","./core/components/ui/form/radio/radio.ts","./core/components/ui/form/select/select.ts","./core/components/ui/form/switch/switch.ts","./core/components/ui/form/textarea/textarea.ts","./core/components/ui/group/group.ts","./core/components/ui/icon/icon.stories.ts","./core/components/ui/icon/icon.ts","./core/components/ui/icon/icons.ts","./core/components/ui/image/image.ts","./core/components/ui/link/link.ts","./core/components/ui/loader/loader.stories.ts","./core/components/ui/loader/loader.ts","./core/components/ui/loader/styles/fixed.ts","./core/components/ui/loader/styles/inline.ts","./core/components/ui/menu/menu-item.ts","./core/components/ui/menu/menu.ts","./core/components/ui/modal/modal-actions.ts","./core/components/ui/modal/modal-close.ts","./core/components/ui/modal/modal-content.ts","./core/components/ui/modal/modal-subtitle.ts","./core/components/ui/modal/modal-title.ts","./core/components/ui/modal/modal.stories.ts","./core/components/ui/modal/modal.ts","./core/components/ui/pop/pop.ts","./core/components/ui/progress/progress.ts","./core/components/ui/table/table-caption.ts","./core/components/ui/table/table-tbody.ts","./core/components/ui/table/table-td.ts","./core/components/ui/table/table-tfoot.ts","./core/components/ui/table/table-th.ts","./core/components/ui/table/table-thead.ts","./core/components/ui/table/table-tr.ts","./core/components/ui/table/table.ts","./core/components/ui/theme/theme.ts","./core/components/ui/theme/theme-collection/core-variables.ts","./core/components/ui/theme/theme-collection/dark.ts","./core/components/ui/theme/theme-collection/light.ts","./core/components/ui/toast/message-subscriber.stories.ts","./core/components/ui/toast/message-subscriber.ts","./core/components/ui/toast/toast-item.ts","./core/components/ui/toast/toast.ts","./core/components/ui/toast/types.ts","./core/components/ui/tooltip/tooltip.ts","./core/decorators/Subscriber.ts","./core/directives/DataProvider.ts","./core/directives/Wording.ts","./core/mixins/Fetcher.ts","./core/mixins/FormCheckable.ts","./core/mixins/FormElement.ts","./core/mixins/FormInput.ts","./core/mixins/Subscriber.ts","./core/mixins/TemplatesContainer.ts","./core/mixins/mixins.ts","./core/utils/Arrays.ts","./core/utils/DataBindObserver.ts","./core/utils/Electron.ts","./core/utils/Format.ts","./core/utils/HTML.ts","./core/utils/LocationHandler.ts","./core/utils/Objects.ts","./core/utils/PublisherProxy.ts","./core/utils/Utils.ts","./core/utils/aesCrypto.ts","./core/utils/api.ts","./core/utils/route.ts","./core/utils/url-pattern.ts","./test-utils/TestUtils.ts"],"version":"5.6.3"}
|
package/tailwind.config.js
CHANGED
|
File without changes
|
package/vite.config.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import postcssLit from "rollup-plugin-postcss-lit";
|
|
2
|
+
import basicSsl from "@vitejs/plugin-basic-ssl";
|
|
2
3
|
|
|
3
4
|
// import minifyHTML from "rollup-plugin-minify-html-literals";
|
|
4
5
|
import { defineConfig } from "vite";
|
|
@@ -81,6 +82,7 @@ export default defineConfig({
|
|
|
81
82
|
},
|
|
82
83
|
build: build,
|
|
83
84
|
plugins: [
|
|
85
|
+
basicSsl(),
|
|
84
86
|
CustomHmr(),
|
|
85
87
|
postcssLit({
|
|
86
88
|
include: ["src/**/*.css", "src/**/*.css?*"],
|