stickyflow 0.7.0 → 0.9.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/CHANGELOG.md +23 -0
- package/README.md +1 -1
- package/dist/binding/index.cjs +9 -9
- package/dist/binding/index.d.cts +4 -4
- package/dist/binding/index.d.ts +4 -4
- package/dist/binding/index.js +3 -3
- package/dist/{chunk-OWNVXKXN.cjs → chunk-B3YRZVMR.cjs} +23 -23
- package/dist/chunk-B3YRZVMR.cjs.map +1 -0
- package/dist/{chunk-JCRPLPKV.js → chunk-BUVUJMWT.js} +5 -5
- package/dist/chunk-BUVUJMWT.js.map +1 -0
- package/dist/{chunk-ZNHYW47T.js → chunk-CM35H45Z.js} +3 -3
- package/dist/{chunk-ZNHYW47T.js.map → chunk-CM35H45Z.js.map} +1 -1
- package/dist/{chunk-JQK4IGXJ.js → chunk-D2266VBZ.js} +440 -8
- package/dist/chunk-D2266VBZ.js.map +1 -0
- package/dist/{chunk-SDMQRSRW.js → chunk-FS6L462E.js} +455 -136
- package/dist/chunk-FS6L462E.js.map +1 -0
- package/dist/{chunk-EKAWJFJQ.cjs → chunk-OUWGWDJ2.cjs} +15 -15
- package/dist/{chunk-EKAWJFJQ.cjs.map → chunk-OUWGWDJ2.cjs.map} +1 -1
- package/dist/{chunk-KXYSO6GC.cjs → chunk-QL7MNEMT.cjs} +444 -7
- package/dist/chunk-QL7MNEMT.cjs.map +1 -0
- package/dist/{chunk-BUOWM3LC.cjs → chunk-SQBF2BKT.cjs} +382 -73
- package/dist/chunk-SQBF2BKT.cjs.map +1 -0
- package/dist/{chunk-A73UJ5AQ.cjs → chunk-YSXD5IVZ.cjs} +1074 -755
- package/dist/chunk-YSXD5IVZ.cjs.map +1 -0
- package/dist/{chunk-MUKIGLR5.js → chunk-ZCGZJBAT.js} +353 -44
- package/dist/chunk-ZCGZJBAT.js.map +1 -0
- package/dist/index.cjs +36 -36
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +5 -5
- package/dist/interaction/index.cjs +268 -235
- package/dist/interaction/index.cjs.map +1 -1
- package/dist/interaction/index.d.cts +2 -2
- package/dist/interaction/index.d.ts +2 -2
- package/dist/interaction/index.js +44 -11
- package/dist/interaction/index.js.map +1 -1
- package/dist/{render-BU2uYzjG.d.cts → render-DU4lYbRl.d.cts} +29 -11
- package/dist/{render-BU2uYzjG.d.ts → render-DU4lYbRl.d.ts} +29 -11
- package/dist/{runtime-B7KiTmn8.d.cts → runtime-DG8X3Fwf.d.cts} +2 -2
- package/dist/{runtime-BPzyD-Nd.d.ts → runtime-kqD1RS17.d.ts} +2 -2
- package/dist/{runtimeTypes-DalvhScn.d.ts → runtimeTypes-CvjlBZds.d.cts} +7 -3
- package/dist/{runtimeTypes-BIP70z72.d.cts → runtimeTypes-vRaHOIHi.d.ts} +7 -3
- package/dist/stickyflow-diagram.global.js +294 -39
- package/dist/stickyflow-diagram.global.js.map +1 -1
- package/dist/{types-D_2NZ6lL.d.cts → types-B5jrEEcF.d.cts} +1 -1
- package/dist/{types-DMWs27Hn.d.ts → types-B7IkZ0w4.d.ts} +1 -1
- package/dist/viewer/index.cjs +9 -9
- package/dist/viewer/index.d.cts +4 -4
- package/dist/viewer/index.d.ts +4 -4
- package/dist/viewer/index.js +4 -4
- package/dist/web-component/index.cjs +6 -6
- package/dist/web-component/index.d.cts +2 -2
- package/dist/web-component/index.d.ts +2 -2
- package/dist/web-component/index.js +4 -4
- package/package.json +1 -1
- package/dist/chunk-A73UJ5AQ.cjs.map +0 -1
- package/dist/chunk-BUOWM3LC.cjs.map +0 -1
- package/dist/chunk-JCRPLPKV.js.map +0 -1
- package/dist/chunk-JQK4IGXJ.js.map +0 -1
- package/dist/chunk-KXYSO6GC.cjs.map +0 -1
- package/dist/chunk-MUKIGLR5.js.map +0 -1
- package/dist/chunk-OWNVXKXN.cjs.map +0 -1
- package/dist/chunk-SDMQRSRW.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkYSXD5IVZ_cjs = require('./chunk-YSXD5IVZ.cjs');
|
|
4
|
+
var chunkOUWGWDJ2_cjs = require('./chunk-OUWGWDJ2.cjs');
|
|
5
|
+
var chunkQL7MNEMT_cjs = require('./chunk-QL7MNEMT.cjs');
|
|
6
6
|
|
|
7
7
|
// src/runtime/viewer/components/rollingNumberDom.ts
|
|
8
8
|
var HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
|
|
@@ -162,12 +162,12 @@ function componentDigits(surface) {
|
|
|
162
162
|
function componentStyle(surface) {
|
|
163
163
|
const encoded = surface.getAttribute("data-sf-widget-style");
|
|
164
164
|
if (!encoded) {
|
|
165
|
-
return
|
|
165
|
+
return chunkQL7MNEMT_cjs.DEFAULT_ROLLING_NUMBER_STYLE;
|
|
166
166
|
}
|
|
167
167
|
try {
|
|
168
|
-
return { ...
|
|
168
|
+
return { ...chunkQL7MNEMT_cjs.DEFAULT_ROLLING_NUMBER_STYLE, ...JSON.parse(encoded) };
|
|
169
169
|
} catch {
|
|
170
|
-
return
|
|
170
|
+
return chunkQL7MNEMT_cjs.DEFAULT_ROLLING_NUMBER_STYLE;
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
function positiveInteger(value) {
|
|
@@ -191,7 +191,7 @@ function setRollingNumber(surface, value, animate) {
|
|
|
191
191
|
return false;
|
|
192
192
|
}
|
|
193
193
|
const previousValue = surface.getAttribute("data-sf-widget-value") ?? "";
|
|
194
|
-
const nextValue =
|
|
194
|
+
const nextValue = chunkQL7MNEMT_cjs.formatRollingNumber(value, positiveInteger(surface.getAttribute("data-sf-widget-digits")));
|
|
195
195
|
if (previousValue === nextValue) {
|
|
196
196
|
return true;
|
|
197
197
|
}
|
|
@@ -667,7 +667,7 @@ function mountDisplay(container, svgString) {
|
|
|
667
667
|
}
|
|
668
668
|
|
|
669
669
|
// src/runtime/viewer/events.ts
|
|
670
|
-
var Emitter2 = class extends
|
|
670
|
+
var Emitter2 = class extends chunkOUWGWDJ2_cjs.Emitter {
|
|
671
671
|
};
|
|
672
672
|
|
|
673
673
|
// src/runtime/viewer/export/raster.ts
|
|
@@ -757,11 +757,11 @@ function svgElement(document, name, attributes) {
|
|
|
757
757
|
function readComponentStyle(surface) {
|
|
758
758
|
try {
|
|
759
759
|
return {
|
|
760
|
-
...
|
|
760
|
+
...chunkQL7MNEMT_cjs.DEFAULT_ROLLING_NUMBER_STYLE,
|
|
761
761
|
...JSON.parse(surface.getAttribute("data-sf-widget-style") ?? "{}")
|
|
762
762
|
};
|
|
763
763
|
} catch {
|
|
764
|
-
return
|
|
764
|
+
return chunkQL7MNEMT_cjs.DEFAULT_ROLLING_NUMBER_STYLE;
|
|
765
765
|
}
|
|
766
766
|
}
|
|
767
767
|
function cellsOf(box, plain, fontSize = 0) {
|
|
@@ -901,7 +901,7 @@ function serializeSvgSnapshot(svg, captures) {
|
|
|
901
901
|
// src/runtime/viewer/interaction/changeFlash.ts
|
|
902
902
|
function createChangeFlash(svg) {
|
|
903
903
|
const timers = /* @__PURE__ */ new Map();
|
|
904
|
-
const flash = (ownerIds, color2 =
|
|
904
|
+
const flash = (ownerIds, color2 = chunkOUWGWDJ2_cjs.CHANGE_COLOR) => {
|
|
905
905
|
const ids = [...new Set(ownerIds)];
|
|
906
906
|
if (ids.length === 0) {
|
|
907
907
|
return;
|
|
@@ -909,7 +909,7 @@ function createChangeFlash(svg) {
|
|
|
909
909
|
const doc = svg.ownerDocument;
|
|
910
910
|
const reducedMotion = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? false;
|
|
911
911
|
for (const id of ids) {
|
|
912
|
-
const primary =
|
|
912
|
+
const primary = chunkOUWGWDJ2_cjs.findOwnerNode(svg, id, chunkOUWGWDJ2_cjs.isPrimary);
|
|
913
913
|
if (!primary) {
|
|
914
914
|
continue;
|
|
915
915
|
}
|
|
@@ -920,10 +920,10 @@ function createChangeFlash(svg) {
|
|
|
920
920
|
for (const stale of svg.querySelectorAll(`[data-sf-change-overlay="${CSS.escape(id)}"]`)) {
|
|
921
921
|
stale.remove();
|
|
922
922
|
}
|
|
923
|
-
const overlay = primary.getAttribute("data-sf-role") === "link" ?
|
|
923
|
+
const overlay = primary.getAttribute("data-sf-role") === "link" ? chunkOUWGWDJ2_cjs.linkChangeOverlay(doc, primary, id, color2) : chunkOUWGWDJ2_cjs.shapeChangeOverlay(doc, primary, id, color2);
|
|
924
924
|
svg.appendChild(overlay);
|
|
925
|
-
|
|
926
|
-
const duration = reducedMotion ?
|
|
925
|
+
chunkOUWGWDJ2_cjs.startChangeFade(overlay, reducedMotion);
|
|
926
|
+
const duration = reducedMotion ? chunkOUWGWDJ2_cjs.REDUCED_MOTION_DURATION_MS : chunkOUWGWDJ2_cjs.FLASH_DURATION_MS;
|
|
927
927
|
timers.set(
|
|
928
928
|
id,
|
|
929
929
|
setTimeout(() => {
|
|
@@ -1010,7 +1010,7 @@ var OwnerPointerController = class {
|
|
|
1010
1010
|
this.#selection = selection;
|
|
1011
1011
|
}
|
|
1012
1012
|
hover(event) {
|
|
1013
|
-
const owner =
|
|
1013
|
+
const owner = chunkOUWGWDJ2_cjs.resolveOwner(event.target);
|
|
1014
1014
|
this.#emitter.emit(
|
|
1015
1015
|
"ownerHover",
|
|
1016
1016
|
owner ? { diagramId: this.#diagramId, owner, modifiers: modifiersOf(event) } : { diagramId: this.#diagramId, owner: null }
|
|
@@ -1018,7 +1018,7 @@ var OwnerPointerController = class {
|
|
|
1018
1018
|
}
|
|
1019
1019
|
select(event) {
|
|
1020
1020
|
const target = event.target;
|
|
1021
|
-
const owner =
|
|
1021
|
+
const owner = chunkOUWGWDJ2_cjs.resolveOwner(target);
|
|
1022
1022
|
if (!owner) {
|
|
1023
1023
|
this.#clearWhenOutsideOverlay(target);
|
|
1024
1024
|
return;
|
|
@@ -1039,7 +1039,7 @@ var OwnerPointerController = class {
|
|
|
1039
1039
|
owner,
|
|
1040
1040
|
modifiers
|
|
1041
1041
|
});
|
|
1042
|
-
const node =
|
|
1042
|
+
const node = chunkOUWGWDJ2_cjs.findOwnerNode(this.#svg, owner.id, chunkOUWGWDJ2_cjs.isPrimary);
|
|
1043
1043
|
if (node && !node.hasAttribute("tabindex")) {
|
|
1044
1044
|
node.setAttribute("tabindex", "-1");
|
|
1045
1045
|
}
|
|
@@ -1067,12 +1067,12 @@ var PointerInteractionSession = class {
|
|
|
1067
1067
|
}
|
|
1068
1068
|
#onPointerDown = (event) => {
|
|
1069
1069
|
const target = event.target;
|
|
1070
|
-
const overContent = Boolean(
|
|
1070
|
+
const overContent = Boolean(chunkOUWGWDJ2_cjs.resolveOwner(target)) || isSelectionOverlayControl(target);
|
|
1071
1071
|
this.#down = {
|
|
1072
1072
|
x: event.clientX,
|
|
1073
1073
|
y: event.clientY,
|
|
1074
1074
|
moved: false,
|
|
1075
|
-
panable:
|
|
1075
|
+
panable: chunkOUWGWDJ2_cjs.isCameraGesture(event) || !overContent
|
|
1076
1076
|
};
|
|
1077
1077
|
};
|
|
1078
1078
|
#onPointerMove = (event) => {
|
|
@@ -1100,7 +1100,7 @@ var PointerInteractionSession = class {
|
|
|
1100
1100
|
if (!this.#down.moved) {
|
|
1101
1101
|
return false;
|
|
1102
1102
|
}
|
|
1103
|
-
if (this.#down.panable &&
|
|
1103
|
+
if (this.#down.panable && chunkOUWGWDJ2_cjs.isCameraGesture(event)) {
|
|
1104
1104
|
this.#display.panBy(event.movementX, event.movementY);
|
|
1105
1105
|
}
|
|
1106
1106
|
return true;
|
|
@@ -1124,15 +1124,15 @@ function paintSelectionOverlays(svg, selectedIds, owners) {
|
|
|
1124
1124
|
}
|
|
1125
1125
|
const document = svg.ownerDocument;
|
|
1126
1126
|
for (const id of selectedIds) {
|
|
1127
|
-
const primary =
|
|
1127
|
+
const primary = chunkOUWGWDJ2_cjs.findOwnerNode(svg, id, chunkOUWGWDJ2_cjs.isPrimary);
|
|
1128
1128
|
if (!primary) {
|
|
1129
1129
|
continue;
|
|
1130
1130
|
}
|
|
1131
1131
|
const owner = owners.get(id);
|
|
1132
|
-
const overlay = owner?.role === "link" ?
|
|
1132
|
+
const overlay = owner?.role === "link" ? chunkOUWGWDJ2_cjs.linkSelectionOverlay(document, primary, id, svg) : owner?.role === "path" ? chunkOUWGWDJ2_cjs.pathSelectionOverlay(document, primary, id, svg) : owner?.role === "isometric" ? chunkOUWGWDJ2_cjs.isometricSelectionOverlay(document, primary, id, svg) : chunkOUWGWDJ2_cjs.shapeSelectionOverlay(document, primary, id, svg, owner ? chunkOUWGWDJ2_cjs.DERIVED_HEIGHT_ROLES.has(owner.role) : false);
|
|
1133
1133
|
svg.appendChild(overlay);
|
|
1134
1134
|
if (owner?.role === "shape" && selectedIds.size === 1) {
|
|
1135
|
-
svg.appendChild(
|
|
1135
|
+
svg.appendChild(chunkOUWGWDJ2_cjs.quickDuplicateBubbles(document, primary, id, svg));
|
|
1136
1136
|
}
|
|
1137
1137
|
}
|
|
1138
1138
|
}
|
|
@@ -1171,7 +1171,7 @@ var SelectionController = class {
|
|
|
1171
1171
|
selectIds(ids) {
|
|
1172
1172
|
for (const id of ids) {
|
|
1173
1173
|
const element = this.#svg.querySelector(`[data-sf-id="${CSS.escape(id)}"]`);
|
|
1174
|
-
const owner =
|
|
1174
|
+
const owner = chunkOUWGWDJ2_cjs.resolveOwner(element);
|
|
1175
1175
|
if (owner) {
|
|
1176
1176
|
this.remember(owner);
|
|
1177
1177
|
}
|
|
@@ -1183,7 +1183,7 @@ var SelectionController = class {
|
|
|
1183
1183
|
// src/runtime/viewer/interaction/wheel.ts
|
|
1184
1184
|
function bindWheelZoom(display, selection) {
|
|
1185
1185
|
const onWheel = (event) => {
|
|
1186
|
-
if (!
|
|
1186
|
+
if (!chunkOUWGWDJ2_cjs.isCameraGesture(event)) {
|
|
1187
1187
|
return;
|
|
1188
1188
|
}
|
|
1189
1189
|
event.preventDefault();
|
|
@@ -1657,10 +1657,191 @@ var emberSlitsProgram = {
|
|
|
1657
1657
|
fragmentSource: fragmentSource6
|
|
1658
1658
|
};
|
|
1659
1659
|
|
|
1660
|
-
// src/runtime/viewer/shaders/builtins/
|
|
1660
|
+
// src/runtime/viewer/shaders/builtins/glassDots.ts
|
|
1661
1661
|
var fragmentSource7 = `
|
|
1662
1662
|
precision highp float;
|
|
1663
1663
|
|
|
1664
|
+
uniform vec2 uResolution;
|
|
1665
|
+
uniform float uTime;
|
|
1666
|
+
uniform float uSpeed;
|
|
1667
|
+
uniform float uIntensity;
|
|
1668
|
+
uniform float uDots;
|
|
1669
|
+
uniform float uDotSize;
|
|
1670
|
+
uniform float uStagger;
|
|
1671
|
+
uniform float uSphere;
|
|
1672
|
+
uniform float uAngle;
|
|
1673
|
+
uniform float uSpread;
|
|
1674
|
+
uniform float uWarp;
|
|
1675
|
+
uniform float uGlow;
|
|
1676
|
+
uniform float uRound;
|
|
1677
|
+
uniform float uScatter;
|
|
1678
|
+
uniform float uLens;
|
|
1679
|
+
uniform float uGrain;
|
|
1680
|
+
uniform vec3 uBaseColor;
|
|
1681
|
+
uniform vec3 uColorA;
|
|
1682
|
+
uniform vec3 uColorB;
|
|
1683
|
+
uniform vec3 uColorC;
|
|
1684
|
+
uniform vec3 uColorD;
|
|
1685
|
+
uniform vec3 uRimColor;
|
|
1686
|
+
varying vec2 vUv;
|
|
1687
|
+
|
|
1688
|
+
float hash(vec2 p) {
|
|
1689
|
+
return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1692
|
+
float noise(vec2 p) {
|
|
1693
|
+
vec2 i = floor(p);
|
|
1694
|
+
vec2 f = fract(p);
|
|
1695
|
+
vec2 u = f * f * (3.0 - 2.0 * f);
|
|
1696
|
+
return mix(mix(hash(i), hash(i + vec2(1.0, 0.0)), u.x), mix(hash(i + vec2(0.0, 1.0)), hash(i + vec2(1.0, 1.0)), u.x), u.y);
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
float fbm(vec2 p) {
|
|
1700
|
+
return 0.5 * noise(p) + 0.25 * noise(p * 2.03 + 3.1) + 0.125 * noise(p * 4.01 + 7.7);
|
|
1701
|
+
}
|
|
1702
|
+
|
|
1703
|
+
vec2 turn(vec2 point, float angle) {
|
|
1704
|
+
float c = cos(angle);
|
|
1705
|
+
float s = sin(angle);
|
|
1706
|
+
return vec2(c * point.x - s * point.y, s * point.x + c * point.y);
|
|
1707
|
+
}
|
|
1708
|
+
|
|
1709
|
+
// How far the grid is stretched at a distance r from the middle; with sphere the dots follow the surface of a ball.
|
|
1710
|
+
float stretch(float r, float sphere) {
|
|
1711
|
+
float rr = clamp(r, 0.0001, 0.9999);
|
|
1712
|
+
return mix(1.0, asin(rr) / rr, sphere);
|
|
1713
|
+
}
|
|
1714
|
+
|
|
1715
|
+
// The color under the dots: an uneven cloud of color whose edge bleeds out into the dark, with a red glow around it.
|
|
1716
|
+
// body is how much of the cloud is there, from 1 inside to 0 far outside.
|
|
1717
|
+
vec3 field(vec2 q, float angle, float t, out float body, out float distance) {
|
|
1718
|
+
vec2 p = turn(q, -angle);
|
|
1719
|
+
vec2 bend = vec2(fbm(p * 2.2 + vec2(t * 0.3, 1.7)), fbm(p * 2.2 + vec2(8.3, -t * 0.25))) - 0.35;
|
|
1720
|
+
vec2 w = p + bend * max(uWarp, 0.0) * 0.4;
|
|
1721
|
+
float rr = length(w) / max(uSpread, 0.2);
|
|
1722
|
+
distance = rr;
|
|
1723
|
+
body = 1.0 - smoothstep(0.78, 1.22, rr);
|
|
1724
|
+
|
|
1725
|
+
vec3 c = uColorB;
|
|
1726
|
+
c = mix(c, uColorA, smoothstep(-0.1, 0.95, dot(w, normalize(vec2(-0.6, 0.7)))) * 0.95);
|
|
1727
|
+
c = mix(c, uColorC, smoothstep(-0.05, 0.6, dot(w, normalize(vec2(0.7, -0.45)))) * 0.9);
|
|
1728
|
+
c = mix(c, uColorD, smoothstep(0.18, 0.85, dot(w, normalize(vec2(0.85, -0.55)))) * 0.97);
|
|
1729
|
+
float ring = smoothstep(0.8, 1.05, rr) * max(uGlow, 0.0);
|
|
1730
|
+
c = mix(c, uRimColor, clamp(ring, 0.0, 1.0));
|
|
1731
|
+
return mix(uBaseColor, c, body);
|
|
1732
|
+
}
|
|
1733
|
+
|
|
1734
|
+
void main() {
|
|
1735
|
+
float side = min(uResolution.x, uResolution.y);
|
|
1736
|
+
vec2 q = (vUv * uResolution - uResolution * 0.5) / (side * 0.5);
|
|
1737
|
+
float r = length(q);
|
|
1738
|
+
// On a circle the picture ends at its edge; on a rectangle the dots run on over the whole surface and may lie beyond the cloud.
|
|
1739
|
+
float edge = uRound > 0.5 ? 1.0 - smoothstep(0.985, 1.0, r) : 1.0;
|
|
1740
|
+
if (edge <= 0.0) discard;
|
|
1741
|
+
|
|
1742
|
+
float t = uTime * max(uSpeed, 0.0);
|
|
1743
|
+
float angle = radians(uAngle);
|
|
1744
|
+
float cells = max(uDots, 2.0) * 0.5;
|
|
1745
|
+
vec2 g = q * stretch(r, uSphere) * cells;
|
|
1746
|
+
|
|
1747
|
+
// The dot that is nearest wins, so dots that lie close cut each other along a straight line.
|
|
1748
|
+
float stagger = clamp(uStagger, 0.0, 1.0);
|
|
1749
|
+
vec2 cell = floor(g);
|
|
1750
|
+
float best = 1e9;
|
|
1751
|
+
vec2 centre = vec2(0.0);
|
|
1752
|
+
for (int j = -1; j <= 1; j++) {
|
|
1753
|
+
for (int i = -1; i <= 1; i++) {
|
|
1754
|
+
vec2 c = cell + vec2(float(i), float(j));
|
|
1755
|
+
float shift = stagger * 0.5 * mod(c.y, 2.0);
|
|
1756
|
+
vec2 mid = vec2(c.x + 0.5 + shift, c.y + 0.5);
|
|
1757
|
+
float d = length(g - mid);
|
|
1758
|
+
if (d < best) {
|
|
1759
|
+
best = d;
|
|
1760
|
+
centre = mid;
|
|
1761
|
+
}
|
|
1762
|
+
}
|
|
1763
|
+
}
|
|
1764
|
+
|
|
1765
|
+
// Where the middle of that dot lies on the screen, found by running the stretch backwards.
|
|
1766
|
+
vec2 gc = centre / cells;
|
|
1767
|
+
float gl = length(gc);
|
|
1768
|
+
float rc = gl;
|
|
1769
|
+
for (int k = 0; k < 5; k++) {
|
|
1770
|
+
rc = gl / stretch(rc, uSphere);
|
|
1771
|
+
}
|
|
1772
|
+
rc = clamp(rc, 0.0, 1.0);
|
|
1773
|
+
vec2 qc = gl > 0.0001 ? gc / gl * rc : vec2(0.0);
|
|
1774
|
+
|
|
1775
|
+
float radius = clamp(uDotSize, 0.2, 0.9);
|
|
1776
|
+
float aa = 1.6 / side * cells * 2.0;
|
|
1777
|
+
float inside = 1.0 - smoothstep(radius - aa, radius + aa, best);
|
|
1778
|
+
|
|
1779
|
+
float bodyHere;
|
|
1780
|
+
float bodyDot;
|
|
1781
|
+
float farHere;
|
|
1782
|
+
float farDot;
|
|
1783
|
+
vec3 colorHere = field(q, angle, t, bodyHere, farHere);
|
|
1784
|
+
field(qc, angle, t, bodyDot, farDot);
|
|
1785
|
+
|
|
1786
|
+
// Between the dots the cloud is darker, so the dots read as glass lying on it.
|
|
1787
|
+
vec3 gap = colorHere * mix(0.3, 0.9, bodyHere);
|
|
1788
|
+
|
|
1789
|
+
// Every dot is a lens with a gradient of its own: lighter on the side that faces the middle, dark on the side that faces out.
|
|
1790
|
+
// The darker side grows toward the edge of the cloud, until the dots there are nearly black.
|
|
1791
|
+
vec2 e = (g - centre) / max(radius, 0.001);
|
|
1792
|
+
vec2 outward = length(qc) > 0.0001 ? normalize(qc) : vec2(0.0, 1.0);
|
|
1793
|
+
vec2 outwardGrid = outward;
|
|
1794
|
+
float along = clamp(dot(e, outwardGrid), -1.0, 1.0);
|
|
1795
|
+
float edgeness = 1.0 - smoothstep(0.1, 0.9, bodyDot);
|
|
1796
|
+
float lens = clamp(uLens, 0.0, 1.5);
|
|
1797
|
+
float darken = lens * (0.1 + 0.9 * edgeness) * smoothstep(-0.55, 1.0, along);
|
|
1798
|
+
float lift = lens * 0.09 * (1.0 - edgeness) * (-along);
|
|
1799
|
+
vec3 glass = colorHere * (1.0 + lift) * (1.0 - clamp(darken, 0.0, 0.96));
|
|
1800
|
+
|
|
1801
|
+
// A dot beyond the cloud is drawn in the dark glow color when the dice fall that way, more of them close to the cloud than far from it.
|
|
1802
|
+
float luck = hash(centre + 17.0);
|
|
1803
|
+
float shown = step(luck, clamp(uScatter, 0.0, 1.0) * (1.0 - smoothstep(1.0, 2.0, farDot))) * (1.0 - bodyDot);
|
|
1804
|
+
vec3 outer = mix(uRimColor, mix(uColorD, uColorC, hash(centre + 5.0)), 0.35 * hash(centre + 9.0)) * (0.25 + 0.4 * hash(centre + 3.0));
|
|
1805
|
+
outer *= 1.0 - 0.8 * smoothstep(-0.55, 1.0, along);
|
|
1806
|
+
glass = mix(glass, outer, shown);
|
|
1807
|
+
|
|
1808
|
+
vec3 color = mix(gap, glass, inside);
|
|
1809
|
+
color *= max(uIntensity, 0.0);
|
|
1810
|
+
color += (hash(gl_FragCoord.xy + t) - 0.5) * max(uGrain, 0.0);
|
|
1811
|
+
gl_FragColor = vec4(clamp(color, 0.0, 1.0), edge);
|
|
1812
|
+
}
|
|
1813
|
+
`;
|
|
1814
|
+
var glassDotsProgram = {
|
|
1815
|
+
name: "glassDots",
|
|
1816
|
+
fragmentSource: fragmentSource7,
|
|
1817
|
+
defaultParameters: {
|
|
1818
|
+
speed: 0,
|
|
1819
|
+
intensity: 1,
|
|
1820
|
+
dots: 13,
|
|
1821
|
+
dotSize: 0.5,
|
|
1822
|
+
stagger: 0,
|
|
1823
|
+
sphere: 0,
|
|
1824
|
+
angle: 0,
|
|
1825
|
+
spread: 0.86,
|
|
1826
|
+
warp: 1,
|
|
1827
|
+
glow: 0.75,
|
|
1828
|
+
round: 0,
|
|
1829
|
+
scatter: 0.45,
|
|
1830
|
+
lens: 0.75,
|
|
1831
|
+
grain: 0.06,
|
|
1832
|
+
baseColor: "#121212",
|
|
1833
|
+
colorA: "#f4b49c",
|
|
1834
|
+
colorB: "#4a9c93",
|
|
1835
|
+
colorC: "#34559c",
|
|
1836
|
+
colorD: "#ec3f93",
|
|
1837
|
+
rimColor: "#d93a24"
|
|
1838
|
+
}
|
|
1839
|
+
};
|
|
1840
|
+
|
|
1841
|
+
// src/runtime/viewer/shaders/builtins/glassRefraction.ts
|
|
1842
|
+
var fragmentSource8 = `
|
|
1843
|
+
precision highp float;
|
|
1844
|
+
|
|
1664
1845
|
uniform sampler2D uBackdrop;
|
|
1665
1846
|
uniform vec2 uBackdropOrigin;
|
|
1666
1847
|
uniform vec2 uBackdropScale;
|
|
@@ -1763,12 +1944,138 @@ void main() {
|
|
|
1763
1944
|
`;
|
|
1764
1945
|
var glassRefractionProgram = {
|
|
1765
1946
|
name: "glassRefraction",
|
|
1766
|
-
fragmentSource:
|
|
1947
|
+
fragmentSource: fragmentSource8,
|
|
1767
1948
|
usesBackdrop: true
|
|
1768
1949
|
};
|
|
1769
1950
|
|
|
1951
|
+
// src/runtime/viewer/shaders/builtins/glowCard.ts
|
|
1952
|
+
var fragmentSource9 = `
|
|
1953
|
+
precision highp float;
|
|
1954
|
+
|
|
1955
|
+
uniform vec2 uResolution;
|
|
1956
|
+
uniform float uTime;
|
|
1957
|
+
uniform float uSpeed;
|
|
1958
|
+
uniform float uIntensity;
|
|
1959
|
+
uniform float uGlowHeight;
|
|
1960
|
+
uniform float uGlowSpread;
|
|
1961
|
+
uniform float uCore;
|
|
1962
|
+
uniform float uRim;
|
|
1963
|
+
uniform float uGrain;
|
|
1964
|
+
uniform float uWarp;
|
|
1965
|
+
uniform float uAngle;
|
|
1966
|
+
uniform float uCornerRadius;
|
|
1967
|
+
uniform vec3 uBaseColor;
|
|
1968
|
+
uniform vec3 uColorA;
|
|
1969
|
+
uniform vec3 uColorB;
|
|
1970
|
+
uniform vec3 uColorC;
|
|
1971
|
+
varying vec2 vUv;
|
|
1972
|
+
|
|
1973
|
+
float hash(vec2 p) {
|
|
1974
|
+
return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);
|
|
1975
|
+
}
|
|
1976
|
+
|
|
1977
|
+
float blob(vec2 p, vec2 center, vec2 size) {
|
|
1978
|
+
vec2 d = (p - center) / size;
|
|
1979
|
+
return exp(-dot(d, d));
|
|
1980
|
+
}
|
|
1981
|
+
|
|
1982
|
+
float noise(vec2 p) {
|
|
1983
|
+
vec2 i = floor(p);
|
|
1984
|
+
vec2 f = fract(p);
|
|
1985
|
+
vec2 u = f * f * (3.0 - 2.0 * f);
|
|
1986
|
+
return mix(mix(hash(i), hash(i + vec2(1.0, 0.0)), u.x), mix(hash(i + vec2(0.0, 1.0)), hash(i + vec2(1.0, 1.0)), u.x), u.y);
|
|
1987
|
+
}
|
|
1988
|
+
|
|
1989
|
+
float fbm(vec2 p) {
|
|
1990
|
+
return 0.5 * noise(p) + 0.25 * noise(p * 2.03 + 3.1) + 0.125 * noise(p * 4.01 + 7.7);
|
|
1991
|
+
}
|
|
1992
|
+
|
|
1993
|
+
void main() {
|
|
1994
|
+
vec2 size = max(uResolution, vec2(1.0));
|
|
1995
|
+
float radius = uCornerRadius * min(size.x, size.y);
|
|
1996
|
+
vec2 q = abs(vUv * size - size * 0.5) - size * 0.5 + radius;
|
|
1997
|
+
float distance = length(max(q, 0.0)) + min(max(q.x, q.y), 0.0) - radius;
|
|
1998
|
+
float shape = 1.0 - smoothstep(-1.0, 1.0, distance);
|
|
1999
|
+
if (shape <= 0.0) discard;
|
|
2000
|
+
|
|
2001
|
+
// The light comes from one side. Angle 0 is the bottom edge, and it turns clockwise: 90 is the left, 180 the top, 270 the right.
|
|
2002
|
+
// depth is 0 at the edge the light comes from and 1 at the far side, side runs along that edge.
|
|
2003
|
+
float turn = radians(uAngle);
|
|
2004
|
+
vec2 toward = vec2(-sin(turn), -cos(turn));
|
|
2005
|
+
vec2 across = vec2(-toward.y, toward.x);
|
|
2006
|
+
vec2 offset = (vUv - 0.5) * size;
|
|
2007
|
+
float reachAlong = 0.5 * (abs(toward.x) * size.x + abs(toward.y) * size.y);
|
|
2008
|
+
float reachAcross = 0.5 * (abs(across.x) * size.x + abs(across.y) * size.y);
|
|
2009
|
+
float depth = clamp(0.5 - dot(offset, toward) / (2.0 * reachAlong), 0.0, 1.0);
|
|
2010
|
+
float side = clamp(0.5 + dot(offset, across) / (2.0 * reachAcross), 0.0, 1.0);
|
|
2011
|
+
float aspect = reachAcross / reachAlong;
|
|
2012
|
+
|
|
2013
|
+
float t = uTime * max(uSpeed, 0.0);
|
|
2014
|
+
float height = clamp(uGlowHeight, 0.05, 1.0);
|
|
2015
|
+
float spread = max(uGlowSpread, 0.05);
|
|
2016
|
+
// The body is the base color with a faint lift toward the far side, like glass that catches the light.
|
|
2017
|
+
vec3 color = uBaseColor + vec3(0.035) * smoothstep(0.55, 1.0, 1.0 - depth);
|
|
2018
|
+
|
|
2019
|
+
// Three soft lights sit low in the card and drift slowly; the middle one is the broadest.
|
|
2020
|
+
vec2 p = vec2(side * aspect, depth);
|
|
2021
|
+
// The lights are bent by slow noise, so their edges curl like smoke instead of staying round.
|
|
2022
|
+
vec2 bend = vec2(fbm(p * 2.6 + vec2(t * 0.6, 0.0)), fbm(p * 2.6 + vec2(5.2, -t * 0.5))) - 0.35;
|
|
2023
|
+
p += bend * max(uWarp, 0.0) * 0.45;
|
|
2024
|
+
float wander = 0.05 * sin(t);
|
|
2025
|
+
float a = blob(p, vec2((0.18 + wander) * aspect, 0.0), vec2(0.5 * spread * aspect, 0.42 * height));
|
|
2026
|
+
float b = blob(p, vec2((0.52 - wander) * aspect, -0.04), vec2(0.62 * spread * aspect, 0.5 * height));
|
|
2027
|
+
float c = blob(p, vec2((0.86 + wander * 0.6) * aspect, 0.02), vec2(0.5 * spread * aspect, 0.44 * height));
|
|
2028
|
+
// Each light is thicker in some places than in others, so the colors mix unevenly.
|
|
2029
|
+
float patchy = fbm(p * 4.0 + 11.0);
|
|
2030
|
+
a *= 0.55 + 0.9 * patchy;
|
|
2031
|
+
b *= 0.55 + 0.9 * (1.0 - patchy);
|
|
2032
|
+
c *= 0.55 + 0.9 * fbm(p * 4.0 + 23.0);
|
|
2033
|
+
vec3 glow = uColorA * a + uColorB * b + uColorC * c;
|
|
2034
|
+
|
|
2035
|
+
// A haze reaches higher than the lights, so the color fades out into the body.
|
|
2036
|
+
float haze = smoothstep(height, 0.0, depth);
|
|
2037
|
+
glow += mix(uColorB, uColorA, side) * haze * haze * 0.35;
|
|
2038
|
+
color += glow * max(uIntensity, 0.0);
|
|
2039
|
+
|
|
2040
|
+
// Near the exit edge the lights are so strong that they turn white.
|
|
2041
|
+
float hot = smoothstep(height * 0.38, 0.0, depth) * (a + b + c) * clamp(uCore, 0.0, 1.0);
|
|
2042
|
+
color = mix(color, vec3(0.93, 0.95, 1.0), clamp(hot, 0.0, 1.0));
|
|
2043
|
+
|
|
2044
|
+
// A thin rim along the edge, strongest on the side away from the light.
|
|
2045
|
+
float rim = (1.0 - smoothstep(0.0, 1.6, -distance)) * smoothstep(0.0, 1.0, -distance + 1.0);
|
|
2046
|
+
color += vec3(0.62, 0.66, 0.78) * rim * max(uRim, 0.0) * (0.35 + 0.65 * smoothstep(0.2, 1.0, 1.0 - depth));
|
|
2047
|
+
|
|
2048
|
+
// The grit sits in the lit parts and fades in the dark body, as on film.
|
|
2049
|
+
float lit = clamp(dot(glow, vec3(0.45)) * max(uIntensity, 0.0) + hot, 0.0, 1.0);
|
|
2050
|
+
float grit = hash(gl_FragCoord.xy) - 0.5;
|
|
2051
|
+
grit += 0.5 * (hash(floor(gl_FragCoord.xy * 0.5) + 17.0) - 0.5);
|
|
2052
|
+
color += grit * max(uGrain, 0.0) * (0.3 + 2.2 * lit * (1.0 - 0.5 * lit));
|
|
2053
|
+
gl_FragColor = vec4(clamp(color, 0.0, 1.0), shape);
|
|
2054
|
+
}
|
|
2055
|
+
`;
|
|
2056
|
+
var glowCardProgram = {
|
|
2057
|
+
name: "glowCard",
|
|
2058
|
+
fragmentSource: fragmentSource9,
|
|
2059
|
+
defaultParameters: {
|
|
2060
|
+
speed: 0.12,
|
|
2061
|
+
intensity: 1,
|
|
2062
|
+
glowHeight: 0.55,
|
|
2063
|
+
glowSpread: 1,
|
|
2064
|
+
core: 0.7,
|
|
2065
|
+
rim: 0.55,
|
|
2066
|
+
grain: 0.12,
|
|
2067
|
+
warp: 1,
|
|
2068
|
+
angle: 0,
|
|
2069
|
+
cornerRadius: 0.08,
|
|
2070
|
+
baseColor: "#0b0b12",
|
|
2071
|
+
colorA: "#2f6bff",
|
|
2072
|
+
colorB: "#9d5cff",
|
|
2073
|
+
colorC: "#34d3c4"
|
|
2074
|
+
}
|
|
2075
|
+
};
|
|
2076
|
+
|
|
1770
2077
|
// src/runtime/viewer/shaders/builtins/halftoneHalo.ts
|
|
1771
|
-
var
|
|
2078
|
+
var fragmentSource10 = `
|
|
1772
2079
|
precision highp float;
|
|
1773
2080
|
|
|
1774
2081
|
uniform vec2 uResolution;
|
|
@@ -1847,11 +2154,11 @@ void main() {
|
|
|
1847
2154
|
`;
|
|
1848
2155
|
var halftoneHaloProgram = {
|
|
1849
2156
|
name: "halftoneHalo",
|
|
1850
|
-
fragmentSource:
|
|
2157
|
+
fragmentSource: fragmentSource10
|
|
1851
2158
|
};
|
|
1852
2159
|
|
|
1853
2160
|
// src/runtime/viewer/shaders/builtins/halo.ts
|
|
1854
|
-
var
|
|
2161
|
+
var fragmentSource11 = `
|
|
1855
2162
|
precision highp float;
|
|
1856
2163
|
|
|
1857
2164
|
uniform vec2 uResolution;
|
|
@@ -1926,11 +2233,11 @@ void main() {
|
|
|
1926
2233
|
`;
|
|
1927
2234
|
var haloProgram = {
|
|
1928
2235
|
name: "halo",
|
|
1929
|
-
fragmentSource:
|
|
2236
|
+
fragmentSource: fragmentSource11
|
|
1930
2237
|
};
|
|
1931
2238
|
|
|
1932
2239
|
// src/runtime/viewer/shaders/builtins/ledMatrix.ts
|
|
1933
|
-
var
|
|
2240
|
+
var fragmentSource12 = `
|
|
1934
2241
|
precision highp float;
|
|
1935
2242
|
|
|
1936
2243
|
uniform vec2 uResolution;
|
|
@@ -2046,7 +2353,7 @@ void main() {
|
|
|
2046
2353
|
`;
|
|
2047
2354
|
var ledMatrixProgram = {
|
|
2048
2355
|
name: "ledMatrix",
|
|
2049
|
-
fragmentSource:
|
|
2356
|
+
fragmentSource: fragmentSource12,
|
|
2050
2357
|
defaultParameters: {
|
|
2051
2358
|
speed: 0.25,
|
|
2052
2359
|
intensity: 1,
|
|
@@ -2077,7 +2384,7 @@ var ledMatrixProgram = {
|
|
|
2077
2384
|
};
|
|
2078
2385
|
|
|
2079
2386
|
// src/runtime/viewer/shaders/builtins/lightBand.ts
|
|
2080
|
-
var
|
|
2387
|
+
var fragmentSource13 = `
|
|
2081
2388
|
precision highp float;
|
|
2082
2389
|
|
|
2083
2390
|
uniform vec2 uResolution;
|
|
@@ -2137,7 +2444,7 @@ void main() {
|
|
|
2137
2444
|
`;
|
|
2138
2445
|
var lightBandProgram = {
|
|
2139
2446
|
name: "lightBand",
|
|
2140
|
-
fragmentSource:
|
|
2447
|
+
fragmentSource: fragmentSource13,
|
|
2141
2448
|
defaultParameters: {
|
|
2142
2449
|
speed: 0.3,
|
|
2143
2450
|
intensity: 1,
|
|
@@ -2154,7 +2461,7 @@ var lightBandProgram = {
|
|
|
2154
2461
|
};
|
|
2155
2462
|
|
|
2156
2463
|
// src/runtime/viewer/shaders/builtins/lumenPortal.ts
|
|
2157
|
-
var
|
|
2464
|
+
var fragmentSource14 = `
|
|
2158
2465
|
precision highp float;
|
|
2159
2466
|
|
|
2160
2467
|
uniform float uTime;
|
|
@@ -2212,11 +2519,11 @@ void main() {
|
|
|
2212
2519
|
`;
|
|
2213
2520
|
var lumenPortalProgram = {
|
|
2214
2521
|
name: "lumenPortal",
|
|
2215
|
-
fragmentSource:
|
|
2522
|
+
fragmentSource: fragmentSource14
|
|
2216
2523
|
};
|
|
2217
2524
|
|
|
2218
2525
|
// src/runtime/viewer/shaders/builtins/lumenPortalLight.ts
|
|
2219
|
-
var
|
|
2526
|
+
var fragmentSource15 = `
|
|
2220
2527
|
precision highp float;
|
|
2221
2528
|
|
|
2222
2529
|
uniform float uTime;
|
|
@@ -2275,11 +2582,11 @@ void main() {
|
|
|
2275
2582
|
`;
|
|
2276
2583
|
var lumenPortalLightProgram = {
|
|
2277
2584
|
name: "lumenPortalLight",
|
|
2278
|
-
fragmentSource:
|
|
2585
|
+
fragmentSource: fragmentSource15
|
|
2279
2586
|
};
|
|
2280
2587
|
|
|
2281
2588
|
// src/runtime/viewer/shaders/builtins/orb.ts
|
|
2282
|
-
var
|
|
2589
|
+
var fragmentSource16 = `
|
|
2283
2590
|
precision highp float;
|
|
2284
2591
|
|
|
2285
2592
|
uniform vec2 uResolution;
|
|
@@ -2315,11 +2622,11 @@ void main() {
|
|
|
2315
2622
|
`;
|
|
2316
2623
|
var orbProgram = {
|
|
2317
2624
|
name: "orb",
|
|
2318
|
-
fragmentSource:
|
|
2625
|
+
fragmentSource: fragmentSource16
|
|
2319
2626
|
};
|
|
2320
2627
|
|
|
2321
2628
|
// src/runtime/viewer/shaders/builtins/pixelConstellation.ts
|
|
2322
|
-
var
|
|
2629
|
+
var fragmentSource17 = `
|
|
2323
2630
|
precision highp float;
|
|
2324
2631
|
|
|
2325
2632
|
uniform float uTime;
|
|
@@ -2419,11 +2726,11 @@ void main() {
|
|
|
2419
2726
|
`;
|
|
2420
2727
|
var pixelConstellationProgram = {
|
|
2421
2728
|
name: "pixelConstellation",
|
|
2422
|
-
fragmentSource:
|
|
2729
|
+
fragmentSource: fragmentSource17
|
|
2423
2730
|
};
|
|
2424
2731
|
|
|
2425
2732
|
// src/runtime/viewer/shaders/builtins/plasmaGauge.ts
|
|
2426
|
-
var
|
|
2733
|
+
var fragmentSource18 = `
|
|
2427
2734
|
precision highp float;
|
|
2428
2735
|
|
|
2429
2736
|
uniform vec2 uResolution;
|
|
@@ -2525,12 +2832,12 @@ void main() {
|
|
|
2525
2832
|
`;
|
|
2526
2833
|
var plasmaGaugeProgram = {
|
|
2527
2834
|
name: "plasmaGauge",
|
|
2528
|
-
fragmentSource:
|
|
2835
|
+
fragmentSource: fragmentSource18,
|
|
2529
2836
|
replacesBaseFill: true
|
|
2530
2837
|
};
|
|
2531
2838
|
|
|
2532
2839
|
// src/runtime/viewer/shaders/builtins/prismSlats.ts
|
|
2533
|
-
var
|
|
2840
|
+
var fragmentSource19 = `
|
|
2534
2841
|
precision highp float;
|
|
2535
2842
|
|
|
2536
2843
|
uniform vec2 uResolution;
|
|
@@ -2605,11 +2912,11 @@ void main() {
|
|
|
2605
2912
|
`;
|
|
2606
2913
|
var prismSlatsProgram = {
|
|
2607
2914
|
name: "prismSlats",
|
|
2608
|
-
fragmentSource:
|
|
2915
|
+
fragmentSource: fragmentSource19
|
|
2609
2916
|
};
|
|
2610
2917
|
|
|
2611
2918
|
// src/runtime/viewer/shaders/builtins/reactivePanel.ts
|
|
2612
|
-
var
|
|
2919
|
+
var fragmentSource20 = `
|
|
2613
2920
|
precision highp float;
|
|
2614
2921
|
|
|
2615
2922
|
uniform float uTime;
|
|
@@ -2711,7 +3018,7 @@ void main() {
|
|
|
2711
3018
|
`;
|
|
2712
3019
|
var reactivePanelProgram = {
|
|
2713
3020
|
name: "reactivePanel",
|
|
2714
|
-
fragmentSource:
|
|
3021
|
+
fragmentSource: fragmentSource20,
|
|
2715
3022
|
defaultParameters: {
|
|
2716
3023
|
intensity: 0.5,
|
|
2717
3024
|
speed: 0.18,
|
|
@@ -2734,7 +3041,7 @@ var reactivePanelProgram = {
|
|
|
2734
3041
|
};
|
|
2735
3042
|
|
|
2736
3043
|
// src/runtime/viewer/shaders/builtins/ruler.ts
|
|
2737
|
-
var
|
|
3044
|
+
var fragmentSource21 = `
|
|
2738
3045
|
precision highp float;
|
|
2739
3046
|
|
|
2740
3047
|
uniform vec2 uResolution;
|
|
@@ -2839,12 +3146,12 @@ void main() {
|
|
|
2839
3146
|
`;
|
|
2840
3147
|
var rulerProgram = {
|
|
2841
3148
|
name: "ruler",
|
|
2842
|
-
fragmentSource:
|
|
3149
|
+
fragmentSource: fragmentSource21,
|
|
2843
3150
|
replacesBaseFill: true
|
|
2844
3151
|
};
|
|
2845
3152
|
|
|
2846
3153
|
// src/runtime/viewer/shaders/builtins/silkFolds.ts
|
|
2847
|
-
var
|
|
3154
|
+
var fragmentSource22 = `
|
|
2848
3155
|
precision highp float;
|
|
2849
3156
|
|
|
2850
3157
|
uniform vec2 uResolution;
|
|
@@ -2929,7 +3236,7 @@ void main() {
|
|
|
2929
3236
|
`;
|
|
2930
3237
|
var silkFoldsProgram = {
|
|
2931
3238
|
name: "silkFolds",
|
|
2932
|
-
fragmentSource:
|
|
3239
|
+
fragmentSource: fragmentSource22,
|
|
2933
3240
|
defaultParameters: {
|
|
2934
3241
|
speed: 0.2,
|
|
2935
3242
|
intensity: 1,
|
|
@@ -2952,7 +3259,7 @@ var silkFoldsProgram = {
|
|
|
2952
3259
|
};
|
|
2953
3260
|
|
|
2954
3261
|
// src/runtime/viewer/shaders/builtins/smearOrb.ts
|
|
2955
|
-
var
|
|
3262
|
+
var fragmentSource23 = `
|
|
2956
3263
|
precision highp float;
|
|
2957
3264
|
|
|
2958
3265
|
uniform vec2 uResolution;
|
|
@@ -3028,12 +3335,12 @@ void main() {
|
|
|
3028
3335
|
`;
|
|
3029
3336
|
var smearOrbProgram = {
|
|
3030
3337
|
name: "smearOrb",
|
|
3031
|
-
fragmentSource:
|
|
3338
|
+
fragmentSource: fragmentSource23,
|
|
3032
3339
|
replacesBaseFill: true
|
|
3033
3340
|
};
|
|
3034
3341
|
|
|
3035
3342
|
// src/runtime/viewer/shaders/builtins/tickScale.ts
|
|
3036
|
-
var
|
|
3343
|
+
var fragmentSource24 = `
|
|
3037
3344
|
precision highp float;
|
|
3038
3345
|
|
|
3039
3346
|
uniform vec2 uResolution;
|
|
@@ -3092,12 +3399,12 @@ void main() {
|
|
|
3092
3399
|
`;
|
|
3093
3400
|
var tickScaleProgram = {
|
|
3094
3401
|
name: "tickScale",
|
|
3095
|
-
fragmentSource:
|
|
3402
|
+
fragmentSource: fragmentSource24,
|
|
3096
3403
|
replacesBaseFill: true
|
|
3097
3404
|
};
|
|
3098
3405
|
|
|
3099
3406
|
// src/runtime/viewer/shaders/builtins/violetGlass.ts
|
|
3100
|
-
var
|
|
3407
|
+
var fragmentSource25 = `
|
|
3101
3408
|
precision highp float;
|
|
3102
3409
|
|
|
3103
3410
|
uniform float uTime;
|
|
@@ -3177,11 +3484,11 @@ void main() {
|
|
|
3177
3484
|
`;
|
|
3178
3485
|
var violetGlassProgram = {
|
|
3179
3486
|
name: "violetGlass",
|
|
3180
|
-
fragmentSource:
|
|
3487
|
+
fragmentSource: fragmentSource25
|
|
3181
3488
|
};
|
|
3182
3489
|
|
|
3183
3490
|
// src/runtime/viewer/shaders/builtins/violetGlassLight.ts
|
|
3184
|
-
var
|
|
3491
|
+
var fragmentSource26 = `
|
|
3185
3492
|
precision highp float;
|
|
3186
3493
|
|
|
3187
3494
|
uniform float uTime;
|
|
@@ -3251,7 +3558,7 @@ void main() {
|
|
|
3251
3558
|
`;
|
|
3252
3559
|
var violetGlassLightProgram = {
|
|
3253
3560
|
name: "violetGlassLight",
|
|
3254
|
-
fragmentSource:
|
|
3561
|
+
fragmentSource: fragmentSource26
|
|
3255
3562
|
};
|
|
3256
3563
|
|
|
3257
3564
|
// src/runtime/viewer/shaders/programs.ts
|
|
@@ -3279,7 +3586,9 @@ var builtins = [
|
|
|
3279
3586
|
reactivePanelProgram,
|
|
3280
3587
|
ledMatrixProgram,
|
|
3281
3588
|
lightBandProgram,
|
|
3282
|
-
silkFoldsProgram
|
|
3589
|
+
silkFoldsProgram,
|
|
3590
|
+
glowCardProgram,
|
|
3591
|
+
glassDotsProgram
|
|
3283
3592
|
];
|
|
3284
3593
|
var programs = new Map(builtins.map((program) => [program.name, program]));
|
|
3285
3594
|
function registerShaderProgram(program) {
|
|
@@ -3460,9 +3769,9 @@ function compile(gl, type, source) {
|
|
|
3460
3769
|
}
|
|
3461
3770
|
return shader;
|
|
3462
3771
|
}
|
|
3463
|
-
function linkProgram(gl,
|
|
3772
|
+
function linkProgram(gl, fragmentSource27) {
|
|
3464
3773
|
const vertex = compile(gl, gl.VERTEX_SHADER, VERTEX_SOURCE);
|
|
3465
|
-
const fragment = compile(gl, gl.FRAGMENT_SHADER,
|
|
3774
|
+
const fragment = compile(gl, gl.FRAGMENT_SHADER, fragmentSource27);
|
|
3466
3775
|
if (!vertex || !fragment) {
|
|
3467
3776
|
if (vertex) {
|
|
3468
3777
|
gl.deleteShader(vertex);
|
|
@@ -4023,21 +4332,21 @@ function mountShaderSurfaces(svg) {
|
|
|
4023
4332
|
|
|
4024
4333
|
// src/runtime/viewer/source.ts
|
|
4025
4334
|
function renderViewerSource(next, defaultRenderOptions) {
|
|
4026
|
-
const svg = next.svg ?? (next.source != null ?
|
|
4335
|
+
const svg = next.svg ?? (next.source != null ? chunkYSXD5IVZ_cjs.render(next.source, { ...next.renderOptions ?? defaultRenderOptions, linkHitAreas: true }).svg : null);
|
|
4027
4336
|
if (svg == null) {
|
|
4028
4337
|
throw new Error("createViewer: provide either `source` (SFL) or `svg`.");
|
|
4029
4338
|
}
|
|
4030
4339
|
return svg;
|
|
4031
4340
|
}
|
|
4032
4341
|
function assertCreateViewerContract(svg) {
|
|
4033
|
-
const version =
|
|
4034
|
-
if (!
|
|
4342
|
+
const version = chunkOUWGWDJ2_cjs.parseContractVersion(svg);
|
|
4343
|
+
if (!chunkOUWGWDJ2_cjs.isContractCompatible(version)) {
|
|
4035
4344
|
throw new Error(`createViewer: incompatible DOM contract (svg=${version}). Renderer and viewer versions differ.`);
|
|
4036
4345
|
}
|
|
4037
4346
|
}
|
|
4038
4347
|
function assertViewerUpdateContract(svg) {
|
|
4039
|
-
const version =
|
|
4040
|
-
if (!
|
|
4348
|
+
const version = chunkOUWGWDJ2_cjs.parseContractVersion(svg);
|
|
4349
|
+
if (!chunkOUWGWDJ2_cjs.isContractCompatible(version)) {
|
|
4041
4350
|
throw new Error(`viewer.update: incompatible DOM contract (svg=${version}). Renderer and viewer versions differ.`);
|
|
4042
4351
|
}
|
|
4043
4352
|
}
|
|
@@ -4271,7 +4580,7 @@ function trackScales(wiring, event) {
|
|
|
4271
4580
|
}
|
|
4272
4581
|
function driveValue(wiring, id, event) {
|
|
4273
4582
|
const { runtime, svg } = wiring;
|
|
4274
|
-
const kind =
|
|
4583
|
+
const kind = chunkQL7MNEMT_cjs.getComponentDescriptor(runtime.graph.elements.get(id)?.componentType)?.interaction;
|
|
4275
4584
|
if (kind !== "slide" && kind !== "pick" && kind !== "turn" && kind !== "range") {
|
|
4276
4585
|
return;
|
|
4277
4586
|
}
|
|
@@ -4410,5 +4719,5 @@ exports.connectInteraction = connectInteraction;
|
|
|
4410
4719
|
exports.createViewer = createViewer;
|
|
4411
4720
|
exports.registerShaderProgram = registerShaderProgram;
|
|
4412
4721
|
exports.shaderProgram = shaderProgram;
|
|
4413
|
-
//# sourceMappingURL=chunk-
|
|
4414
|
-
//# sourceMappingURL=chunk-
|
|
4722
|
+
//# sourceMappingURL=chunk-SQBF2BKT.cjs.map
|
|
4723
|
+
//# sourceMappingURL=chunk-SQBF2BKT.cjs.map
|