@neo-ui-kit/react 1.4.6 → 1.4.7
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
CHANGED
|
@@ -65,7 +65,7 @@ import "@neo-ui-kit/react/styles.css";
|
|
|
65
65
|
To test repository changes before publishing, run `npm run package` from the repository root and install the resulting archive in a separate application:
|
|
66
66
|
|
|
67
67
|
```bash
|
|
68
|
-
npm install /path/to/adui/release/neo-ui-kit-react-1.4.
|
|
68
|
+
npm install /path/to/adui/release/neo-ui-kit-react-1.4.7.tgz
|
|
69
69
|
```
|
|
70
70
|
|
|
71
71
|
Maintainers publish new versions from `Pro100Dimka/adui` using the `release.yml` GitHub Actions workflow, a matching `v<version>` tag, and the `npm-publication` environment. npm trusts its OIDC identity; no `NPM_TOKEN` is required. The workflow checks the project and packed consumer before publishing the tested archive. Published `1.0.0` cannot be overwritten: code and README changes in npm require a new package version. See the [repository release instructions](https://github.com/Pro100Dimka/adui#npm-пакет).
|
|
@@ -406,7 +406,7 @@ function createBorderWorker(item) {
|
|
|
406
406
|
}
|
|
407
407
|
async function update() {
|
|
408
408
|
const dpr = devicePixelRatio || 1;
|
|
409
|
-
const width = item.
|
|
409
|
+
const width = item.width + 32, height = item.height + 32;
|
|
410
410
|
const radius = item.lights[0].radius;
|
|
411
411
|
const styles = groups.map((group) => ({
|
|
412
412
|
mask: group.style.maskImage,
|
|
@@ -1155,6 +1155,7 @@ function tick(now) {
|
|
|
1155
1155
|
}
|
|
1156
1156
|
if (needsScan || now - lastScan > 400) scan(now);
|
|
1157
1157
|
const deadline = performance.now() + 8;
|
|
1158
|
+
const updates = [];
|
|
1158
1159
|
for (const item of measurements) {
|
|
1159
1160
|
if (!item.element.isConnected) {
|
|
1160
1161
|
measurements.delete(item);
|
|
@@ -1163,8 +1164,9 @@ function tick(now) {
|
|
|
1163
1164
|
if (item.element._adInView === false) continue;
|
|
1164
1165
|
if (performance.now() >= deadline) break;
|
|
1165
1166
|
measurements.delete(item);
|
|
1166
|
-
item.
|
|
1167
|
+
updates.push(item.measure());
|
|
1167
1168
|
}
|
|
1169
|
+
for (const update of updates) update?.();
|
|
1168
1170
|
if (now - last >= FRAME - 6) {
|
|
1169
1171
|
if (FRAME > 1e3 / 60)
|
|
1170
1172
|
for (const animation of active) animation.currentTime = now - animation.__adStart;
|
|
@@ -1503,7 +1505,7 @@ U.attachBorder = (element, { shell = false, round = false, scope, defer = false
|
|
|
1503
1505
|
for (const spot of light.spots) spot.style.transform = transform;
|
|
1504
1506
|
}
|
|
1505
1507
|
};
|
|
1506
|
-
item.
|
|
1508
|
+
item.measure = () => {
|
|
1507
1509
|
const computed = getComputedStyle(element);
|
|
1508
1510
|
const sides = ["Top", "Right", "Bottom", "Left"];
|
|
1509
1511
|
const borderWidths = sides.map((side) => parseFloat(computed[`border${side}Width`]) || 0);
|
|
@@ -1512,10 +1514,7 @@ U.attachBorder = (element, { shell = false, round = false, scope, defer = false
|
|
|
1512
1514
|
return Number.isFinite(value) ? value + (computed.boxSizing === "border-box" ? 0 : [start, end].reduce((sum, side) => sum + borderWidths[side] + (parseFloat(computed[`padding${sides[side]}`]) || 0), 0)) : element[fallback];
|
|
1513
1515
|
});
|
|
1514
1516
|
if (!w || !h) return;
|
|
1515
|
-
|
|
1516
|
-
item.patchedPosition = true;
|
|
1517
|
-
element.style.position = "relative";
|
|
1518
|
-
}
|
|
1517
|
+
const patchPosition = computed.position === "static";
|
|
1519
1518
|
const corners = ["TopLeft", "TopRight", "BottomRight", "BottomLeft"].map((corner) => {
|
|
1520
1519
|
const values = (computed[`border${corner}Radius`] || computed.borderTopLeftRadius).split(/\s+/);
|
|
1521
1520
|
return [w, h].map((size, axis) => {
|
|
@@ -1525,35 +1524,44 @@ U.attachBorder = (element, { shell = false, round = false, scope, defer = false
|
|
|
1525
1524
|
});
|
|
1526
1525
|
const geometry = `${w},${h},${corners},${borderWidths}`;
|
|
1527
1526
|
if (item.geometry === geometry) return;
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
item.contour = U.roundedPath(w, h, corners);
|
|
1533
|
-
const { d } = item.contour;
|
|
1534
|
-
edge.setAttribute("viewBox", `0 0 ${w} ${h}`);
|
|
1535
|
-
path.setAttribute("d", d);
|
|
1536
|
-
for (const [node, strokes] of [[aura, AURA], [core, [[shell ? 1.9 : 1.35, 1]]]]) {
|
|
1537
|
-
const mask = ringMask(w, h, d, strokes);
|
|
1538
|
-
node.style.maskImage = mask;
|
|
1539
|
-
node.style.webkitMaskImage = mask;
|
|
1540
|
-
}
|
|
1541
|
-
item.length = item.contour.length;
|
|
1542
|
-
radius = round ? 28 : Math.min(260, Math.max(42, item.length * 0.153));
|
|
1543
|
-
for (const light of lights) {
|
|
1544
|
-
light.radius = radius;
|
|
1545
|
-
for (const spot of light.spots) {
|
|
1546
|
-
spot.style.width = `${radius * 2}px`;
|
|
1547
|
-
spot.style.height = `${radius * 2}px`;
|
|
1527
|
+
return () => {
|
|
1528
|
+
if (patchPosition) {
|
|
1529
|
+
item.patchedPosition = true;
|
|
1530
|
+
element.style.position = "relative";
|
|
1548
1531
|
}
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1532
|
+
item.geometry = geometry;
|
|
1533
|
+
item.width = Math.round(w);
|
|
1534
|
+
item.height = Math.round(h);
|
|
1535
|
+
overlay.style.inset = borderWidths.map((width) => `${-width}px`).join(" ");
|
|
1536
|
+
overlay.style.width = `calc(100% + ${borderWidths[1] + borderWidths[3]}px)`;
|
|
1537
|
+
overlay.style.height = `calc(100% + ${borderWidths[0] + borderWidths[2]}px)`;
|
|
1538
|
+
item.contour = U.roundedPath(w, h, corners);
|
|
1539
|
+
const { d } = item.contour;
|
|
1540
|
+
edge.setAttribute("viewBox", `0 0 ${w} ${h}`);
|
|
1541
|
+
path.setAttribute("d", d);
|
|
1542
|
+
for (const [node, strokes] of [[aura, AURA], [core, [[shell ? 1.9 : 1.35, 1]]]]) {
|
|
1543
|
+
const mask = ringMask(w, h, d, strokes);
|
|
1544
|
+
node.style.maskImage = mask;
|
|
1545
|
+
node.style.webkitMaskImage = mask;
|
|
1546
|
+
}
|
|
1547
|
+
item.length = item.contour.length;
|
|
1548
|
+
radius = round ? 28 : Math.min(260, Math.max(42, item.length * 0.153));
|
|
1549
|
+
for (const light of lights) {
|
|
1550
|
+
light.radius = radius;
|
|
1551
|
+
for (const spot of light.spots) {
|
|
1552
|
+
spot.style.width = `${radius * 2}px`;
|
|
1553
|
+
spot.style.height = `${radius * 2}px`;
|
|
1554
|
+
}
|
|
1555
|
+
}
|
|
1556
|
+
item.paint(scope?.time || 0);
|
|
1557
|
+
if (scope) {
|
|
1558
|
+
item.worker ??= createBorderWorker(item);
|
|
1559
|
+
item.worker?.update();
|
|
1560
|
+
}
|
|
1561
|
+
if (!item.worker) overlay.setAttribute("data-ready", "");
|
|
1562
|
+
};
|
|
1556
1563
|
};
|
|
1564
|
+
item.sync = () => item.measure()?.();
|
|
1557
1565
|
const queueMeasurement = () => {
|
|
1558
1566
|
if (item.destroyed) return;
|
|
1559
1567
|
measurements.add(item);
|
package/dist/core.js
CHANGED
package/dist/forms.js
CHANGED
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
defaultFieldRegistry,
|
|
5
5
|
useForm,
|
|
6
6
|
useFormContext
|
|
7
|
-
} from "./chunks/chunk-
|
|
8
|
-
import "./chunks/chunk-
|
|
7
|
+
} from "./chunks/chunk-VRD5EAQ4.js";
|
|
8
|
+
import "./chunks/chunk-5KH4JI2K.js";
|
|
9
9
|
import "./chunks/chunk-BJSFN52W.js";
|
|
10
10
|
import "./chunks/chunk-FCOU3ODR.js";
|
|
11
11
|
export {
|
package/dist/index.js
CHANGED
|
@@ -62,7 +62,7 @@ import {
|
|
|
62
62
|
useSvgId,
|
|
63
63
|
variantMaterial,
|
|
64
64
|
vectorElement
|
|
65
|
-
} from "./chunks/chunk-
|
|
65
|
+
} from "./chunks/chunk-VRD5EAQ4.js";
|
|
66
66
|
import {
|
|
67
67
|
ThemeProvider,
|
|
68
68
|
createNeonRenderer,
|
|
@@ -79,7 +79,7 @@ import {
|
|
|
79
79
|
useTabShape,
|
|
80
80
|
useThemePalette,
|
|
81
81
|
useTick
|
|
82
|
-
} from "./chunks/chunk-
|
|
82
|
+
} from "./chunks/chunk-5KH4JI2K.js";
|
|
83
83
|
import {
|
|
84
84
|
LocaleProvider,
|
|
85
85
|
addMessages,
|