@wpmoo/ui 2.0.0 → 2.1.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.
- package/README.md +7 -8
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/certification.json +1 -1
- package/dist/assets/css/moo-ui.css +20 -11
- package/dist/assets/css/moo-ui.min.css +2 -2
- package/dist/assets/css/moo.css +13 -4
- package/dist/assets/css/moo.min.css +2 -2
- package/dist/js/chart.js +1 -1
- package/dist/js/chart.min.js +1 -1
- package/dist/js/combobox.js +1 -1
- package/dist/js/context-menu.js +1 -1
- package/dist/js/datatable.js +1 -1
- package/dist/js/datepicker.js +1 -1
- package/dist/js/datepicker.min.js +1 -1
- package/dist/js/floating-panel.js +1 -1
- package/dist/js/moo-ui.js +1 -1
- package/dist/js/moo-ui.min.js +1 -1
- package/dist/js/overlay-scrollbar.js +1 -1
- package/dist/js/password-requirements.js +14 -5
- package/dist/js/sheet.js +1 -1
- package/dist/js/sidebar.js +1 -1
- package/dist/js/slider.js +1 -1
- package/dist/js/state.js +1 -1
- package/dist/js/table-of-contents.js +1 -1
- package/dist/js/toc.js +1 -1
- package/dist/release-manifest.json +4 -4
- package/package.json +1 -1
- package/scss/layouts/_app.scss +10 -0
- package/scss/mixins/_banner.scss +1 -1
- package/scss/settings/_palette.scss +2 -1
- package/scss/themes/_theme.scss +1 -0
package/dist/js/chart.js
CHANGED
package/dist/js/chart.min.js
CHANGED
package/dist/js/combobox.js
CHANGED
package/dist/js/context-menu.js
CHANGED
package/dist/js/datatable.js
CHANGED
package/dist/js/datepicker.js
CHANGED
package/dist/js/moo-ui.js
CHANGED
package/dist/js/moo-ui.min.js
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Moo UI password-requirements.js v2.
|
|
2
|
+
* Moo UI password-requirements.js v2.1.0 (https://wpmoo.org/)
|
|
3
3
|
* Copyright 2026 WPMoo Authors
|
|
4
4
|
* Licensed under MIT (https://github.com/wpmoo-org/ui/blob/main/LICENSE)
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
const instances = /* @__PURE__ */ new WeakMap();
|
|
8
|
+
const MESSAGES = {
|
|
9
|
+
met: "\u2713 %s",
|
|
10
|
+
missing: "\u2014 %s",
|
|
11
|
+
remaining: "Remaining: %s",
|
|
12
|
+
complete: "Shown checks met. Final validation happens on submit.",
|
|
13
|
+
analysis: "Host password analysis must pass."
|
|
14
|
+
};
|
|
15
|
+
const format = (message, value) => message.replace("%s", () => String(value));
|
|
8
16
|
function strip(value, characters) {
|
|
9
17
|
const points = Array.from(value);
|
|
10
18
|
let start = 0;
|
|
@@ -45,10 +53,11 @@ class PasswordRequirements {
|
|
|
45
53
|
const confirmation = configuration.confirmation && document.getElementById(configuration.confirmation);
|
|
46
54
|
const localControl = (node) => node?.matches('input[type="password"]') && node.closest(".moo-ui") === owner && node.form === element.closest("form");
|
|
47
55
|
const policy = configuration.policy;
|
|
48
|
-
if (!owner || !localControl(input) || configuration.confirmation && (!localControl(confirmation) || confirmation === input) || policy?.version !== 3 || !Number.isInteger(policy.minlength) || policy.minlength < 1 || !Number.isInteger(policy.maxlength) || policy.maxlength < policy.minlength || policy.maxlength > 128 || !Array.isArray(policy.rules) || !policy.rules.length || policy.rules.some((rule) => !["length", "case", "number", "symbol", "maximum"].includes(rule.key) || typeof rule.label !== "string" || rule.warning !== void 0 && typeof rule.warning !== "boolean") || new Set(policy.rules.map((rule) => rule.key)).size !== policy.rules.length || !["length", "maximum"].every((key) => policy.rules.some((rule) => rule.key === key)) || typeof policy.whitespace !== "string" || options.analyze !== void 0 && typeof options.analyze !== "function") {
|
|
56
|
+
if (!owner || !localControl(input) || configuration.confirmation && (!localControl(confirmation) || confirmation === input) || policy?.version !== 3 || !Number.isInteger(policy.minlength) || policy.minlength < 1 || !Number.isInteger(policy.maxlength) || policy.maxlength < policy.minlength || policy.maxlength > 128 || !Array.isArray(policy.rules) || !policy.rules.length || policy.rules.some((rule) => !["length", "case", "number", "symbol", "maximum"].includes(rule.key) || typeof rule.label !== "string" || rule.warning !== void 0 && typeof rule.warning !== "boolean") || new Set(policy.rules.map((rule) => rule.key)).size !== policy.rules.length || !["length", "maximum"].every((key) => policy.rules.some((rule) => rule.key === key)) || typeof policy.whitespace !== "string" || options.analyze !== void 0 && typeof options.analyze !== "function" || options.messages !== void 0 && (!options.messages || typeof options.messages !== "object" || Object.entries(options.messages).some(([key, value]) => !Object.hasOwn(MESSAGES, key) || typeof value !== "string"))) {
|
|
49
57
|
throw new TypeError("PasswordRequirements requires same-owner controls and a versioned public policy.");
|
|
50
58
|
}
|
|
51
59
|
this._element = element;
|
|
60
|
+
const messages = { ...MESSAGES, ...options.messages };
|
|
52
61
|
this._initialReady = element.getAttribute("data-requirements-ready");
|
|
53
62
|
this._originals = /* @__PURE__ */ new Map();
|
|
54
63
|
this._listeners = [];
|
|
@@ -137,7 +146,7 @@ class PasswordRequirements {
|
|
|
137
146
|
lastTitle = title;
|
|
138
147
|
};
|
|
139
148
|
const show = (node, label, met, warning = false, active = Boolean(input.value)) => {
|
|
140
|
-
node.textContent = warning ? label : (met ?
|
|
149
|
+
node.textContent = warning ? label : format(met ? messages.met : messages.missing, label);
|
|
141
150
|
node.hidden = warning && (!active || met);
|
|
142
151
|
node.classList.toggle("text-body", !warning && met);
|
|
143
152
|
node.classList.toggle("text-danger", warning);
|
|
@@ -161,7 +170,7 @@ class PasswordRequirements {
|
|
|
161
170
|
}
|
|
162
171
|
if (options.analyze) states.push({
|
|
163
172
|
key: "analysis",
|
|
164
|
-
label:
|
|
173
|
+
label: messages.analysis,
|
|
165
174
|
met: Boolean(analysis?.met),
|
|
166
175
|
warning: true
|
|
167
176
|
});
|
|
@@ -180,7 +189,7 @@ class PasswordRequirements {
|
|
|
180
189
|
);
|
|
181
190
|
const missing = states.filter((state) => !state.met).length;
|
|
182
191
|
const warnings = states.filter((state) => state.warning && !state.met).map((state) => state.label).join(" ");
|
|
183
|
-
const summaryText = !input.value ? this._originals.get(summary).text : missing ?
|
|
192
|
+
const summaryText = !input.value ? this._originals.get(summary).text : missing ? `${format(messages.remaining, missing)} ${warnings}`.trim() : messages.complete;
|
|
184
193
|
if (summary.textContent !== summaryText) summary.textContent = summaryText;
|
|
185
194
|
options.onChange?.(states.map(({ key, met }) => ({ key, met: Boolean(input.value) && met })), Boolean(input.value), analysis?.score ?? null);
|
|
186
195
|
updateSubmit(states);
|
package/dist/js/sheet.js
CHANGED
package/dist/js/sidebar.js
CHANGED
package/dist/js/slider.js
CHANGED
package/dist/js/state.js
CHANGED
package/dist/js/toc.js
CHANGED
|
@@ -3,22 +3,22 @@
|
|
|
3
3
|
{
|
|
4
4
|
"export": "./moo.css",
|
|
5
5
|
"path": "dist/assets/css/moo.css",
|
|
6
|
-
"sha256": "
|
|
6
|
+
"sha256": "b59eab8eb8321379f5995c831b17de2984cb90711dbe4fb4cf6ddc879962cb59"
|
|
7
7
|
},
|
|
8
8
|
{
|
|
9
9
|
"export": "./moo-ui.css",
|
|
10
10
|
"path": "dist/assets/css/moo-ui.css",
|
|
11
|
-
"sha256": "
|
|
11
|
+
"sha256": "2a898c1c05759626168d736cd999a9abc26ebc675e47187e70b5e0d84d91b85e"
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
14
|
"export": "./state.js",
|
|
15
15
|
"path": "dist/js/state.js",
|
|
16
|
-
"sha256": "
|
|
16
|
+
"sha256": "d02e78a71a624a0c8d36f33efc4b5a4fa0d2ac49b329e53994c20ff60c386713"
|
|
17
17
|
}
|
|
18
18
|
],
|
|
19
19
|
"package": {
|
|
20
20
|
"name": "@wpmoo/ui",
|
|
21
|
-
"version": "2.
|
|
21
|
+
"version": "2.1.0"
|
|
22
22
|
},
|
|
23
23
|
"schemaVersion": 1
|
|
24
24
|
}
|
package/package.json
CHANGED
package/scss/layouts/_app.scss
CHANGED
|
@@ -20,6 +20,12 @@
|
|
|
20
20
|
border-radius: var(--bs-border-radius-xl);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
.wrapper[data-layout="app"][data-shell-mode="document"] {
|
|
24
|
+
height: auto;
|
|
25
|
+
min-height: 100svh;
|
|
26
|
+
overflow: visible;
|
|
27
|
+
}
|
|
28
|
+
|
|
23
29
|
.wrapper[data-layout="app"] > [data-slot="page"] {
|
|
24
30
|
display: flex;
|
|
25
31
|
min-width: 0;
|
|
@@ -75,6 +81,10 @@
|
|
|
75
81
|
overflow-y: auto;
|
|
76
82
|
}
|
|
77
83
|
|
|
84
|
+
.wrapper[data-layout="app"][data-shell-mode="document"] > [data-slot="page"] > main {
|
|
85
|
+
overflow: visible;
|
|
86
|
+
}
|
|
87
|
+
|
|
78
88
|
.wrapper[data-layout="app"] > [data-slot="page"] > main > :is(
|
|
79
89
|
.container,
|
|
80
90
|
.container-sm,
|
package/scss/mixins/_banner.scss
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
$white: #fff !default;
|
|
2
2
|
$black: #0a0a0a !default;
|
|
3
3
|
|
|
4
|
-
$
|
|
4
|
+
$moo-heading-font-weight: 600 !default;
|
|
5
|
+
$headings-font-weight: var(--moo-heading-font-weight, #{$moo-heading-font-weight}) !default;
|
|
5
6
|
$lead-font-size: 1.125rem !default;
|
|
6
7
|
$lead-font-weight: 400 !default;
|
|
7
8
|
$display-font-sizes: (
|
package/scss/themes/_theme.scss
CHANGED
|
@@ -92,6 +92,7 @@ $moo-theme-colors-border-subtle-dark: (
|
|
|
92
92
|
--moo-chart-4: #{$moo-chart-4};
|
|
93
93
|
--moo-chart-5: #{$moo-chart-5};
|
|
94
94
|
--moo-heading-font-family: var(--#{$prefix}body-font-family);
|
|
95
|
+
--moo-heading-font-weight: #{$moo-heading-font-weight};
|
|
95
96
|
--moo-small-font-size: #{$moo-small-font-size};
|
|
96
97
|
--moo-paragraph-margin-top: #{$moo-paragraph-margin-top};
|
|
97
98
|
--moo-paragraph-margin-bottom: #{$paragraph-margin-bottom};
|