@surdeddd/bottom-sheet 0.23.4 → 0.24.1
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 +513 -527
- package/README.ru.md +533 -545
- package/dist/{BottomSheetCore-C5tJYVMY.d.cts → BottomSheetCore-B_r4KCQL.d.cts} +48 -13
- package/dist/{BottomSheetCore-DxSrC4QC.d.ts → BottomSheetCore-B_r4KCQL.d.ts} +48 -13
- package/dist/{BottomSheetEngine-B3F9qukX.d.cts → BottomSheetEngine-0F7mjyvF.d.cts} +1 -1
- package/dist/{BottomSheetEngine-BchzgqGG.d.ts → BottomSheetEngine-CJV_DDrM.d.ts} +1 -1
- package/dist/core.cjs +810 -436
- package/dist/core.d.cts +2 -3
- package/dist/core.d.ts +2 -3
- package/dist/core.js +810 -436
- package/dist/debug.d.cts +0 -1
- package/dist/debug.d.ts +0 -1
- package/dist/{default-features-DwVTzDwP.d.ts → default-features-4Xwv6aVt.d.ts} +4 -2
- package/dist/{default-features-BGiCSmV1.d.cts → default-features-DX2NOxP6.d.cts} +4 -2
- package/dist/element.cjs +1421 -697
- package/dist/element.d.cts +11 -3
- package/dist/element.d.ts +11 -3
- package/dist/element.iife.global.js +2 -2
- package/dist/element.js +1421 -697
- package/dist/features.cjs +334 -190
- package/dist/features.d.cts +3 -4
- package/dist/features.d.ts +3 -4
- package/dist/features.js +334 -191
- package/dist/{index-C7TSQkVK.d.cts → index-2shlxhcG.d.cts} +1 -1
- package/dist/{index-CdM1tke5.d.ts → index-CNCRQnpc.d.ts} +1 -1
- package/dist/index.cjs +1129 -631
- package/dist/index.d.cts +11 -6
- package/dist/index.d.ts +11 -6
- package/dist/index.js +1129 -632
- package/dist/integrations/formik.cjs +21 -10
- package/dist/integrations/formik.d.cts +0 -1
- package/dist/integrations/formik.d.ts +0 -1
- package/dist/integrations/formik.js +22 -11
- package/dist/integrations/react-hook-form.cjs +21 -12
- package/dist/integrations/react-hook-form.d.cts +0 -1
- package/dist/integrations/react-hook-form.d.ts +0 -1
- package/dist/integrations/react-hook-form.js +21 -12
- package/dist/option-keys-DItuAjUw.d.cts +6 -0
- package/dist/option-keys-a5DYNwwO.d.ts +6 -0
- package/dist/overlay.cjs +386 -189
- package/dist/overlay.d.cts +1 -3
- package/dist/overlay.d.ts +1 -3
- package/dist/overlay.js +386 -189
- package/dist/preact.d.cts +3 -4
- package/dist/preact.d.ts +3 -4
- package/dist/qwik-lib/index.qwik.cjs +1306 -671
- package/dist/qwik-lib/index.qwik.mjs +1306 -671
- package/dist/qwik.cjs +1326 -701
- package/dist/qwik.d.cts +12 -30
- package/dist/qwik.d.ts +12 -30
- package/dist/qwik.js +1326 -701
- package/dist/react.cjs +1373 -750
- package/dist/react.d.cts +26 -12
- package/dist/react.d.ts +26 -12
- package/dist/react.js +1375 -752
- package/dist/solid.cjs +1332 -727
- package/dist/solid.d.cts +13 -438
- package/dist/solid.d.ts +13 -438
- package/dist/solid.js +1334 -729
- package/dist/solid.source.jsx +1374 -751
- package/dist/styles.css +20 -6
- package/dist/svelte-core.cjs +1209 -676
- package/dist/svelte-core.js +1207 -677
- package/dist/svelte-src/BottomSheet.svelte +101 -58
- package/dist/svelte.cjs +1323 -705
- package/dist/svelte.d.cts +45 -25
- package/dist/svelte.d.ts +45 -25
- package/dist/svelte.js +1323 -705
- package/dist/vue.cjs +1354 -773
- package/dist/vue.d.cts +20 -3
- package/dist/vue.d.ts +20 -3
- package/dist/vue.js +1354 -773
- package/dist/webgl.cjs +159 -53
- package/dist/webgl.d.cts +2 -2
- package/dist/webgl.d.ts +2 -2
- package/dist/webgl.js +159 -53
- package/llms.txt +330 -0
- package/package.json +42 -20
- package/dist/transform-jVfAikE9.d.cts +0 -3
- package/dist/transform-jVfAikE9.d.ts +0 -3
package/dist/webgl.cjs
CHANGED
|
@@ -9,6 +9,22 @@ var supportsHighpFragment = (gl) => {
|
|
|
9
9
|
return false;
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
|
+
var SOFTWARE = /swiftshader|llvmpipe|softpipe|software|basic render/i;
|
|
13
|
+
var MASKED = /^webkit webgl$/i;
|
|
14
|
+
var rendererName = (gl) => {
|
|
15
|
+
const plain = String(gl.getParameter(gl.RENDERER) ?? "");
|
|
16
|
+
if (plain && !MASKED.test(plain)) return plain;
|
|
17
|
+
const info = gl.getExtension("WEBGL_debug_renderer_info");
|
|
18
|
+
if (!info) return "";
|
|
19
|
+
return String(gl.getParameter(info.UNMASKED_RENDERER_WEBGL) ?? "");
|
|
20
|
+
};
|
|
21
|
+
var drawsOnCpu = (gl) => {
|
|
22
|
+
try {
|
|
23
|
+
return SOFTWARE.test(rendererName(gl));
|
|
24
|
+
} catch {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
12
28
|
var hasWebGL = () => {
|
|
13
29
|
if (typeof document === "undefined") return false;
|
|
14
30
|
if (typeof WebGLRenderingContext === "undefined" && typeof WebGL2RenderingContext === "undefined") {
|
|
@@ -34,14 +50,16 @@ var createGLHandle = (onLost) => {
|
|
|
34
50
|
canvas.style.position = "fixed";
|
|
35
51
|
canvas.style.left = "0";
|
|
36
52
|
canvas.style.top = "0";
|
|
53
|
+
canvas.style.width = "100%";
|
|
54
|
+
canvas.style.height = "100%";
|
|
37
55
|
canvas.style.pointerEvents = "none";
|
|
38
56
|
const attrs = {
|
|
39
57
|
alpha: true,
|
|
40
58
|
premultipliedAlpha: true,
|
|
41
|
-
antialias:
|
|
59
|
+
antialias: false,
|
|
42
60
|
depth: false,
|
|
43
61
|
stencil: false,
|
|
44
|
-
preserveDrawingBuffer:
|
|
62
|
+
preserveDrawingBuffer: true
|
|
45
63
|
};
|
|
46
64
|
let gl = null;
|
|
47
65
|
let isWebGL2 = false;
|
|
@@ -85,8 +103,6 @@ var resizeDrawingBuffer = (handle, cssWidth, cssHeight, dpr) => {
|
|
|
85
103
|
handle.canvas.width = w;
|
|
86
104
|
handle.canvas.height = h;
|
|
87
105
|
}
|
|
88
|
-
handle.canvas.style.width = `${cssWidth}px`;
|
|
89
|
-
handle.canvas.style.height = `${cssHeight}px`;
|
|
90
106
|
handle.gl.viewport(0, 0, w, h);
|
|
91
107
|
};
|
|
92
108
|
|
|
@@ -102,7 +118,7 @@ precision ${precision} float;
|
|
|
102
118
|
|
|
103
119
|
uniform vec2 u_resolution;
|
|
104
120
|
uniform vec4 u_rect;
|
|
105
|
-
uniform
|
|
121
|
+
uniform vec4 u_radius;
|
|
106
122
|
uniform vec4 u_color;
|
|
107
123
|
uniform float u_shadow;
|
|
108
124
|
uniform float u_bend;
|
|
@@ -115,7 +131,9 @@ uniform sampler2D u_scroll;
|
|
|
115
131
|
uniform vec4 u_scrollRect;
|
|
116
132
|
uniform vec2 u_scrollMap;
|
|
117
133
|
|
|
118
|
-
float roundedBoxSDF(vec2 p, vec2 halfSize,
|
|
134
|
+
float roundedBoxSDF(vec2 p, vec2 halfSize, vec4 radii) {
|
|
135
|
+
vec2 side = p.x < 0.0 ? radii.xw : radii.yz;
|
|
136
|
+
float r = min(p.y < 0.0 ? side.x : side.y, min(halfSize.x, halfSize.y));
|
|
119
137
|
vec2 q = abs(p) - halfSize + r;
|
|
120
138
|
return min(max(q.x, q.y), 0.0) + length(max(q, 0.0)) - r;
|
|
121
139
|
}
|
|
@@ -131,8 +149,7 @@ void main() {
|
|
|
131
149
|
vec2 p = frag - center;
|
|
132
150
|
p.y -= bend;
|
|
133
151
|
|
|
134
|
-
float
|
|
135
|
-
float d = roundedBoxSDF(p, halfSize, r);
|
|
152
|
+
float d = roundedBoxSDF(p, halfSize, u_radius);
|
|
136
153
|
float surface = 1.0 - smoothstep(-1.0, 1.0, d);
|
|
137
154
|
|
|
138
155
|
vec2 uv = (p + halfSize) / u_rect.zw;
|
|
@@ -256,7 +273,14 @@ var createSurfaceProgram = (gl, highp = true) => {
|
|
|
256
273
|
frame.width * dpr,
|
|
257
274
|
frame.height * dpr
|
|
258
275
|
);
|
|
259
|
-
|
|
276
|
+
const [topLeft, topRight, bottomRight, bottomLeft] = frame.radii;
|
|
277
|
+
gl.uniform4f(
|
|
278
|
+
uRadius,
|
|
279
|
+
topLeft * dpr,
|
|
280
|
+
topRight * dpr,
|
|
281
|
+
bottomRight * dpr,
|
|
282
|
+
bottomLeft * dpr
|
|
283
|
+
);
|
|
260
284
|
gl.uniform4f(uColor, ...frame.color);
|
|
261
285
|
gl.uniform1f(uShadow, frame.shadow);
|
|
262
286
|
gl.uniform1f(uBend, state.bend * dpr);
|
|
@@ -587,13 +611,36 @@ var BEND_DECAY_HELD = 0.86;
|
|
|
587
611
|
var BEND_DECAY_FREE = 0.62;
|
|
588
612
|
var BEND_REST = 0.35;
|
|
589
613
|
var prefersReducedMotion = () => typeof matchMedia === "function" && matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
614
|
+
var WHITE = [1, 1, 1, 1];
|
|
615
|
+
var SENTINEL = "#010203";
|
|
616
|
+
var colorProbe;
|
|
617
|
+
var readColor = (value) => {
|
|
618
|
+
if (colorProbe === void 0) {
|
|
619
|
+
const canvas = document.createElement("canvas");
|
|
620
|
+
canvas.width = 1;
|
|
621
|
+
canvas.height = 1;
|
|
622
|
+
colorProbe = canvas.getContext("2d", { willReadFrequently: true });
|
|
623
|
+
}
|
|
624
|
+
const probe = colorProbe;
|
|
625
|
+
if (!probe) return WHITE;
|
|
626
|
+
probe.fillStyle = SENTINEL;
|
|
627
|
+
probe.fillStyle = value;
|
|
628
|
+
if (probe.fillStyle === SENTINEL) return WHITE;
|
|
629
|
+
probe.clearRect(0, 0, 1, 1);
|
|
630
|
+
probe.fillRect(0, 0, 1, 1);
|
|
631
|
+
const [r = 255, g = 255, b = 255, a = 255] = probe.getImageData(0, 0, 1, 1).data;
|
|
632
|
+
return [r / 255, g / 255, b / 255, a / 255];
|
|
633
|
+
};
|
|
590
634
|
var parseColor = (value) => {
|
|
591
|
-
const
|
|
592
|
-
if (
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
635
|
+
const legacy = value.match(/^rgba?\(([^()]+)\)$/);
|
|
636
|
+
if (legacy && legacy[1].includes(",")) {
|
|
637
|
+
const parts = legacy[1].split(",").map((p) => parseFloat(p.trim()));
|
|
638
|
+
const [r = 255, g = 255, b = 255, a = 1] = parts;
|
|
639
|
+
return [r / 255, g / 255, b / 255, a];
|
|
640
|
+
}
|
|
641
|
+
return readColor(value);
|
|
596
642
|
};
|
|
643
|
+
var parentAcrossShadow = (node) => node.parentElement ?? node.getRootNode().host ?? null;
|
|
597
644
|
var parseRadius = (value) => {
|
|
598
645
|
const n = parseFloat(value);
|
|
599
646
|
return Number.isFinite(n) ? n : 0;
|
|
@@ -639,7 +686,12 @@ var webglRenderer = (options = {}) => ({
|
|
|
639
686
|
const cs = getComputedStyle(element);
|
|
640
687
|
return {
|
|
641
688
|
color: parseColor(cs.backgroundColor),
|
|
642
|
-
|
|
689
|
+
radii: [
|
|
690
|
+
parseRadius(cs.borderTopLeftRadius),
|
|
691
|
+
parseRadius(cs.borderTopRightRadius),
|
|
692
|
+
parseRadius(cs.borderBottomRightRadius),
|
|
693
|
+
parseRadius(cs.borderBottomLeftRadius)
|
|
694
|
+
]
|
|
643
695
|
};
|
|
644
696
|
};
|
|
645
697
|
let surfaceStyle = readSurfaceStyle();
|
|
@@ -674,6 +726,12 @@ var webglRenderer = (options = {}) => ({
|
|
|
674
726
|
bail("no-webgl");
|
|
675
727
|
return;
|
|
676
728
|
}
|
|
729
|
+
if (!options.allowSoftware && drawsOnCpu(handle.gl)) {
|
|
730
|
+
handle.destroy();
|
|
731
|
+
handle = null;
|
|
732
|
+
bail("software-renderer");
|
|
733
|
+
return;
|
|
734
|
+
}
|
|
677
735
|
program = createSurfaceProgram(handle.gl, handle.highp);
|
|
678
736
|
if (!program) {
|
|
679
737
|
handle.destroy();
|
|
@@ -683,23 +741,23 @@ var webglRenderer = (options = {}) => ({
|
|
|
683
741
|
}
|
|
684
742
|
const parent = element.parentElement ?? document.body;
|
|
685
743
|
parent.insertBefore(handle.canvas, element);
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
const
|
|
692
|
-
if (
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
shadow: shadowStrength
|
|
701
|
-
};
|
|
744
|
+
let canvasZ = "";
|
|
745
|
+
let canvasPosition = "fixed";
|
|
746
|
+
const followStack = () => {
|
|
747
|
+
if (!handle) return;
|
|
748
|
+
const cs = getComputedStyle(element);
|
|
749
|
+
const position = cs.position === "absolute" ? "absolute" : "fixed";
|
|
750
|
+
if (position !== canvasPosition) {
|
|
751
|
+
canvasPosition = position;
|
|
752
|
+
handle.canvas.style.position = position;
|
|
753
|
+
}
|
|
754
|
+
const next = cs.zIndex && cs.zIndex !== "auto" ? String(Number(cs.zIndex) - 1) : "0";
|
|
755
|
+
if (next === canvasZ) return;
|
|
756
|
+
canvasZ = next;
|
|
757
|
+
handle.canvas.style.zIndex = next;
|
|
702
758
|
};
|
|
759
|
+
followStack();
|
|
760
|
+
suppressDomPaint();
|
|
703
761
|
const dprOf = () => options.dpr ?? window.devicePixelRatio ?? 1;
|
|
704
762
|
const releaseCapture = () => {
|
|
705
763
|
releaseText?.();
|
|
@@ -723,41 +781,52 @@ var webglRenderer = (options = {}) => ({
|
|
|
723
781
|
capture = next;
|
|
724
782
|
releaseText = hideCapturedText(next.hiddenNodes);
|
|
725
783
|
};
|
|
726
|
-
const scrollLayer = (
|
|
784
|
+
const scrollLayer = (sheet) => {
|
|
727
785
|
const scroll = capture?.scroll;
|
|
728
786
|
const scroller = ctx.scrollContainer;
|
|
729
787
|
if (!scroll || !scroller) return null;
|
|
730
788
|
const box = scroller.getBoundingClientRect();
|
|
731
|
-
const left = box.left + scroller.clientLeft -
|
|
732
|
-
const top = box.top + scroller.clientTop -
|
|
789
|
+
const left = box.left + scroller.clientLeft - sheet.left;
|
|
790
|
+
const top = box.top + scroller.clientTop - sheet.top;
|
|
733
791
|
return {
|
|
734
792
|
texture: scroll.texture,
|
|
735
793
|
rect: [
|
|
736
|
-
left /
|
|
737
|
-
top /
|
|
738
|
-
(left + scroller.clientWidth) /
|
|
739
|
-
(top + scroller.clientHeight) /
|
|
794
|
+
left / sheet.width,
|
|
795
|
+
top / sheet.height,
|
|
796
|
+
(left + scroller.clientWidth) / sheet.width,
|
|
797
|
+
(top + scroller.clientHeight) / sheet.height
|
|
740
798
|
],
|
|
741
799
|
map: [
|
|
742
|
-
|
|
800
|
+
sheet.height / scroll.height,
|
|
743
801
|
(scroll.above + scroller.scrollTop - scroll.top) / scroll.height
|
|
744
802
|
]
|
|
745
803
|
};
|
|
746
804
|
};
|
|
747
805
|
const paint = () => {
|
|
748
806
|
if (disposed || !handle || !program) return;
|
|
749
|
-
const
|
|
750
|
-
|
|
807
|
+
const sheet = element.getBoundingClientRect();
|
|
808
|
+
const area = handle.canvas.getBoundingClientRect();
|
|
809
|
+
if (sheet.width <= 0 || sheet.height <= 0) return;
|
|
810
|
+
if (area.width <= 0 || area.height <= 0) return;
|
|
751
811
|
const dpr = dprOf();
|
|
752
|
-
resizeDrawingBuffer(handle,
|
|
812
|
+
resizeDrawingBuffer(handle, area.width, area.height, dpr);
|
|
753
813
|
const motion = Math.min(1, Math.abs(bend) / MAX_BEND_PX);
|
|
814
|
+
const frame = {
|
|
815
|
+
x: sheet.left - area.left,
|
|
816
|
+
y: sheet.top - area.top,
|
|
817
|
+
width: sheet.width,
|
|
818
|
+
height: sheet.height,
|
|
819
|
+
radii: surfaceStyle.radii,
|
|
820
|
+
color: surfaceStyle.color,
|
|
821
|
+
shadow: shadowStrength
|
|
822
|
+
};
|
|
754
823
|
program.draw(frame, {
|
|
755
824
|
bend,
|
|
756
825
|
dpr,
|
|
757
826
|
sheen: sheenStrength,
|
|
758
827
|
glass: glassStrength * motion,
|
|
759
828
|
content: capture?.texture ?? null,
|
|
760
|
-
scroll: scrollLayer(
|
|
829
|
+
scroll: scrollLayer(sheet)
|
|
761
830
|
});
|
|
762
831
|
};
|
|
763
832
|
const tick = () => {
|
|
@@ -776,6 +845,7 @@ var webglRenderer = (options = {}) => ({
|
|
|
776
845
|
paint();
|
|
777
846
|
running = false;
|
|
778
847
|
frameId = null;
|
|
848
|
+
queueRefresh();
|
|
779
849
|
return;
|
|
780
850
|
}
|
|
781
851
|
frameId = requestAnimationFrame(tick);
|
|
@@ -814,35 +884,71 @@ var webglRenderer = (options = {}) => ({
|
|
|
814
884
|
subtree: true,
|
|
815
885
|
characterData: true
|
|
816
886
|
});
|
|
817
|
-
const
|
|
887
|
+
const onGeometry = () => {
|
|
888
|
+
followStack();
|
|
818
889
|
if (!ctx.isDragging()) paint();
|
|
819
890
|
wake();
|
|
820
|
-
}
|
|
891
|
+
};
|
|
892
|
+
const geometryObserver = new MutationObserver(onGeometry);
|
|
821
893
|
geometryObserver.observe(element, {
|
|
822
894
|
attributes: true,
|
|
823
895
|
attributeFilter: ["style"]
|
|
824
896
|
});
|
|
825
897
|
const refreshSurfaceStyle = () => {
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
898
|
+
const moved = geometryObserver.takeRecords().length > 0;
|
|
899
|
+
const style = element.style;
|
|
900
|
+
const transition = style.transition;
|
|
901
|
+
style.transition = "none";
|
|
902
|
+
restoreDom();
|
|
903
|
+
const next = readSurfaceStyle();
|
|
904
|
+
suppressDomPaint();
|
|
905
|
+
void getComputedStyle(element).backgroundColor;
|
|
906
|
+
style.transition = transition;
|
|
907
|
+
geometryObserver.takeRecords();
|
|
908
|
+
const changed = next.radii.some((radius, i) => radius !== surfaceStyle.radii[i]) || next.color.some((channel, i) => channel !== surfaceStyle.color[i]);
|
|
909
|
+
surfaceStyle = next;
|
|
910
|
+
if (!moved) {
|
|
911
|
+
followStack();
|
|
912
|
+
return changed;
|
|
913
|
+
}
|
|
914
|
+
onGeometry();
|
|
915
|
+
return false;
|
|
916
|
+
};
|
|
917
|
+
let refreshQueued = false;
|
|
918
|
+
const queueRefresh = () => {
|
|
919
|
+
if (disposed || refreshQueued) return;
|
|
920
|
+
refreshQueued = true;
|
|
921
|
+
requestAnimationFrame(() => {
|
|
922
|
+
refreshQueued = false;
|
|
923
|
+
if (!disposed && refreshSurfaceStyle()) paint();
|
|
924
|
+
});
|
|
925
|
+
};
|
|
926
|
+
const onThemeSignal = () => {
|
|
927
|
+
if (!ctx.isDragging() && !ctx.isAnimating()) queueRefresh();
|
|
832
928
|
};
|
|
929
|
+
const themeObserver = new MutationObserver(onThemeSignal);
|
|
930
|
+
themeObserver.observe(element, {
|
|
931
|
+
attributes: true,
|
|
932
|
+
attributeFilter: ["class"]
|
|
933
|
+
});
|
|
934
|
+
for (let node = parentAcrossShadow(element); node; node = parentAcrossShadow(node)) {
|
|
935
|
+
themeObserver.observe(node, { attributes: true });
|
|
936
|
+
}
|
|
937
|
+
const scheme = typeof matchMedia === "function" ? matchMedia("(prefers-color-scheme: dark)") : null;
|
|
938
|
+
scheme?.addEventListener?.("change", onThemeSignal);
|
|
833
939
|
const onResize = () => {
|
|
834
940
|
if (disposed) return;
|
|
835
941
|
refreshSurfaceStyle();
|
|
836
942
|
paint();
|
|
837
943
|
};
|
|
838
944
|
window.addEventListener("resize", onResize, { passive: true });
|
|
839
|
-
window.addEventListener("scroll", onResize, { passive: true });
|
|
840
945
|
paint();
|
|
841
946
|
return () => {
|
|
842
947
|
contentObserver.disconnect();
|
|
843
948
|
geometryObserver.disconnect();
|
|
949
|
+
themeObserver.disconnect();
|
|
950
|
+
scheme?.removeEventListener?.("change", onThemeSignal);
|
|
844
951
|
window.removeEventListener("resize", onResize);
|
|
845
|
-
window.removeEventListener("scroll", onResize);
|
|
846
952
|
teardown();
|
|
847
953
|
};
|
|
848
954
|
}
|
package/dist/webgl.d.cts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { EngineFeature } from './core.cjs';
|
|
2
|
-
import './transform-jVfAikE9.cjs';
|
|
3
2
|
|
|
4
3
|
type WebGLRendererOptions = {
|
|
5
4
|
jelly?: number;
|
|
@@ -8,9 +7,10 @@ type WebGLRendererOptions = {
|
|
|
8
7
|
glass?: number;
|
|
9
8
|
liftContent?: boolean;
|
|
10
9
|
dpr?: number;
|
|
10
|
+
allowSoftware?: boolean;
|
|
11
11
|
onUnsupported?: (reason: WebGLUnsupportedReason) => void;
|
|
12
12
|
};
|
|
13
|
-
type WebGLUnsupportedReason = "no-document" | "no-webgl" | "reduced-motion" | "context-lost";
|
|
13
|
+
type WebGLUnsupportedReason = "no-document" | "no-webgl" | "software-renderer" | "reduced-motion" | "context-lost";
|
|
14
14
|
|
|
15
15
|
declare const webglRenderer: (options?: WebGLRendererOptions) => EngineFeature;
|
|
16
16
|
|
package/dist/webgl.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { EngineFeature } from './core.js';
|
|
2
|
-
import './transform-jVfAikE9.js';
|
|
3
2
|
|
|
4
3
|
type WebGLRendererOptions = {
|
|
5
4
|
jelly?: number;
|
|
@@ -8,9 +7,10 @@ type WebGLRendererOptions = {
|
|
|
8
7
|
glass?: number;
|
|
9
8
|
liftContent?: boolean;
|
|
10
9
|
dpr?: number;
|
|
10
|
+
allowSoftware?: boolean;
|
|
11
11
|
onUnsupported?: (reason: WebGLUnsupportedReason) => void;
|
|
12
12
|
};
|
|
13
|
-
type WebGLUnsupportedReason = "no-document" | "no-webgl" | "reduced-motion" | "context-lost";
|
|
13
|
+
type WebGLUnsupportedReason = "no-document" | "no-webgl" | "software-renderer" | "reduced-motion" | "context-lost";
|
|
14
14
|
|
|
15
15
|
declare const webglRenderer: (options?: WebGLRendererOptions) => EngineFeature;
|
|
16
16
|
|