stickyflow 0.7.0 → 0.8.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 +12 -0
- 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-JCRPLPKV.js → chunk-CZW3ARXQ.js} +4 -4
- package/dist/{chunk-JCRPLPKV.js.map → chunk-CZW3ARXQ.js.map} +1 -1
- package/dist/{chunk-MUKIGLR5.js → chunk-EDOPENSE.js} +169 -42
- package/dist/chunk-EDOPENSE.js.map +1 -0
- package/dist/{chunk-EKAWJFJQ.cjs → chunk-FQ7GMLCM.cjs} +15 -15
- package/dist/{chunk-EKAWJFJQ.cjs.map → chunk-FQ7GMLCM.cjs.map} +1 -1
- package/dist/{chunk-JQK4IGXJ.js → chunk-GLZVHUSW.js} +50 -6
- package/dist/chunk-GLZVHUSW.js.map +1 -0
- package/dist/{chunk-BUOWM3LC.cjs → chunk-IR2T47NW.cjs} +198 -71
- package/dist/chunk-IR2T47NW.cjs.map +1 -0
- package/dist/{chunk-ZNHYW47T.js → chunk-LFEGZJWC.js} +3 -3
- package/dist/{chunk-ZNHYW47T.js.map → chunk-LFEGZJWC.js.map} +1 -1
- package/dist/{chunk-KXYSO6GC.cjs → chunk-LNW5VIEA.cjs} +53 -5
- package/dist/chunk-LNW5VIEA.cjs.map +1 -0
- package/dist/{chunk-SDMQRSRW.js → chunk-MAPNY7MJ.js} +331 -125
- package/dist/chunk-MAPNY7MJ.js.map +1 -0
- package/dist/{chunk-A73UJ5AQ.cjs → chunk-VOYX6JMW.cjs} +950 -744
- package/dist/chunk-VOYX6JMW.cjs.map +1 -0
- package/dist/{chunk-OWNVXKXN.cjs → chunk-XPM3E7NV.cjs} +23 -23
- package/dist/{chunk-OWNVXKXN.cjs.map → chunk-XPM3E7NV.cjs.map} +1 -1
- 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 +266 -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 +42 -11
- package/dist/interaction/index.js.map +1 -1
- package/dist/{render-BU2uYzjG.d.cts → render-Bp2FLEzv.d.cts} +10 -0
- package/dist/{render-BU2uYzjG.d.ts → render-Bp2FLEzv.d.ts} +10 -0
- package/dist/{runtime-BPzyD-Nd.d.ts → runtime-CWIGxRcL.d.ts} +2 -2
- package/dist/{runtime-B7KiTmn8.d.cts → runtime-DIag-XBa.d.cts} +2 -2
- package/dist/{runtimeTypes-BIP70z72.d.cts → runtimeTypes-BYODuxHk.d.cts} +1 -1
- package/dist/{runtimeTypes-DalvhScn.d.ts → runtimeTypes-C7sSLfOK.d.ts} +1 -1
- package/dist/stickyflow-diagram.global.js +141 -38
- package/dist/stickyflow-diagram.global.js.map +1 -1
- package/dist/{types-DMWs27Hn.d.ts → types-B9QM_H3R.d.ts} +1 -1
- package/dist/{types-D_2NZ6lL.d.cts → types-D2w6D_wG.d.cts} +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-JQK4IGXJ.js.map +0 -1
- package/dist/chunk-KXYSO6GC.cjs.map +0 -1
- package/dist/chunk-MUKIGLR5.js.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 chunkVOYX6JMW_cjs = require('./chunk-VOYX6JMW.cjs');
|
|
4
|
+
var chunkFQ7GMLCM_cjs = require('./chunk-FQ7GMLCM.cjs');
|
|
5
|
+
var chunkLNW5VIEA_cjs = require('./chunk-LNW5VIEA.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 chunkLNW5VIEA_cjs.DEFAULT_ROLLING_NUMBER_STYLE;
|
|
166
166
|
}
|
|
167
167
|
try {
|
|
168
|
-
return { ...
|
|
168
|
+
return { ...chunkLNW5VIEA_cjs.DEFAULT_ROLLING_NUMBER_STYLE, ...JSON.parse(encoded) };
|
|
169
169
|
} catch {
|
|
170
|
-
return
|
|
170
|
+
return chunkLNW5VIEA_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 = chunkLNW5VIEA_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 chunkFQ7GMLCM_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
|
+
...chunkLNW5VIEA_cjs.DEFAULT_ROLLING_NUMBER_STYLE,
|
|
761
761
|
...JSON.parse(surface.getAttribute("data-sf-widget-style") ?? "{}")
|
|
762
762
|
};
|
|
763
763
|
} catch {
|
|
764
|
-
return
|
|
764
|
+
return chunkLNW5VIEA_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 = chunkFQ7GMLCM_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 = chunkFQ7GMLCM_cjs.findOwnerNode(svg, id, chunkFQ7GMLCM_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" ? chunkFQ7GMLCM_cjs.linkChangeOverlay(doc, primary, id, color2) : chunkFQ7GMLCM_cjs.shapeChangeOverlay(doc, primary, id, color2);
|
|
924
924
|
svg.appendChild(overlay);
|
|
925
|
-
|
|
926
|
-
const duration = reducedMotion ?
|
|
925
|
+
chunkFQ7GMLCM_cjs.startChangeFade(overlay, reducedMotion);
|
|
926
|
+
const duration = reducedMotion ? chunkFQ7GMLCM_cjs.REDUCED_MOTION_DURATION_MS : chunkFQ7GMLCM_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 = chunkFQ7GMLCM_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 = chunkFQ7GMLCM_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 = chunkFQ7GMLCM_cjs.findOwnerNode(this.#svg, owner.id, chunkFQ7GMLCM_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(chunkFQ7GMLCM_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: chunkFQ7GMLCM_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 && chunkFQ7GMLCM_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 = chunkFQ7GMLCM_cjs.findOwnerNode(svg, id, chunkFQ7GMLCM_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" ? chunkFQ7GMLCM_cjs.linkSelectionOverlay(document, primary, id, svg) : owner?.role === "path" ? chunkFQ7GMLCM_cjs.pathSelectionOverlay(document, primary, id, svg) : owner?.role === "isometric" ? chunkFQ7GMLCM_cjs.isometricSelectionOverlay(document, primary, id, svg) : chunkFQ7GMLCM_cjs.shapeSelectionOverlay(document, primary, id, svg, owner ? chunkFQ7GMLCM_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(chunkFQ7GMLCM_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 = chunkFQ7GMLCM_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 (!chunkFQ7GMLCM_cjs.isCameraGesture(event)) {
|
|
1187
1187
|
return;
|
|
1188
1188
|
}
|
|
1189
1189
|
event.preventDefault();
|
|
@@ -1767,10 +1767,136 @@ var glassRefractionProgram = {
|
|
|
1767
1767
|
usesBackdrop: true
|
|
1768
1768
|
};
|
|
1769
1769
|
|
|
1770
|
-
// src/runtime/viewer/shaders/builtins/
|
|
1770
|
+
// src/runtime/viewer/shaders/builtins/glowCard.ts
|
|
1771
1771
|
var fragmentSource8 = `
|
|
1772
1772
|
precision highp float;
|
|
1773
1773
|
|
|
1774
|
+
uniform vec2 uResolution;
|
|
1775
|
+
uniform float uTime;
|
|
1776
|
+
uniform float uSpeed;
|
|
1777
|
+
uniform float uIntensity;
|
|
1778
|
+
uniform float uGlowHeight;
|
|
1779
|
+
uniform float uGlowSpread;
|
|
1780
|
+
uniform float uCore;
|
|
1781
|
+
uniform float uRim;
|
|
1782
|
+
uniform float uGrain;
|
|
1783
|
+
uniform float uWarp;
|
|
1784
|
+
uniform float uAngle;
|
|
1785
|
+
uniform float uCornerRadius;
|
|
1786
|
+
uniform vec3 uBaseColor;
|
|
1787
|
+
uniform vec3 uColorA;
|
|
1788
|
+
uniform vec3 uColorB;
|
|
1789
|
+
uniform vec3 uColorC;
|
|
1790
|
+
varying vec2 vUv;
|
|
1791
|
+
|
|
1792
|
+
float hash(vec2 p) {
|
|
1793
|
+
return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);
|
|
1794
|
+
}
|
|
1795
|
+
|
|
1796
|
+
float blob(vec2 p, vec2 center, vec2 size) {
|
|
1797
|
+
vec2 d = (p - center) / size;
|
|
1798
|
+
return exp(-dot(d, d));
|
|
1799
|
+
}
|
|
1800
|
+
|
|
1801
|
+
float noise(vec2 p) {
|
|
1802
|
+
vec2 i = floor(p);
|
|
1803
|
+
vec2 f = fract(p);
|
|
1804
|
+
vec2 u = f * f * (3.0 - 2.0 * f);
|
|
1805
|
+
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);
|
|
1806
|
+
}
|
|
1807
|
+
|
|
1808
|
+
float fbm(vec2 p) {
|
|
1809
|
+
return 0.5 * noise(p) + 0.25 * noise(p * 2.03 + 3.1) + 0.125 * noise(p * 4.01 + 7.7);
|
|
1810
|
+
}
|
|
1811
|
+
|
|
1812
|
+
void main() {
|
|
1813
|
+
vec2 size = max(uResolution, vec2(1.0));
|
|
1814
|
+
float radius = uCornerRadius * min(size.x, size.y);
|
|
1815
|
+
vec2 q = abs(vUv * size - size * 0.5) - size * 0.5 + radius;
|
|
1816
|
+
float distance = length(max(q, 0.0)) + min(max(q.x, q.y), 0.0) - radius;
|
|
1817
|
+
float shape = 1.0 - smoothstep(-1.0, 1.0, distance);
|
|
1818
|
+
if (shape <= 0.0) discard;
|
|
1819
|
+
|
|
1820
|
+
// 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.
|
|
1821
|
+
// depth is 0 at the edge the light comes from and 1 at the far side, side runs along that edge.
|
|
1822
|
+
float turn = radians(uAngle);
|
|
1823
|
+
vec2 toward = vec2(-sin(turn), -cos(turn));
|
|
1824
|
+
vec2 across = vec2(-toward.y, toward.x);
|
|
1825
|
+
vec2 offset = (vUv - 0.5) * size;
|
|
1826
|
+
float reachAlong = 0.5 * (abs(toward.x) * size.x + abs(toward.y) * size.y);
|
|
1827
|
+
float reachAcross = 0.5 * (abs(across.x) * size.x + abs(across.y) * size.y);
|
|
1828
|
+
float depth = clamp(0.5 - dot(offset, toward) / (2.0 * reachAlong), 0.0, 1.0);
|
|
1829
|
+
float side = clamp(0.5 + dot(offset, across) / (2.0 * reachAcross), 0.0, 1.0);
|
|
1830
|
+
float aspect = reachAcross / reachAlong;
|
|
1831
|
+
|
|
1832
|
+
float t = uTime * max(uSpeed, 0.0);
|
|
1833
|
+
float height = clamp(uGlowHeight, 0.05, 1.0);
|
|
1834
|
+
float spread = max(uGlowSpread, 0.05);
|
|
1835
|
+
// The body is the base color with a faint lift toward the far side, like glass that catches the light.
|
|
1836
|
+
vec3 color = uBaseColor + vec3(0.035) * smoothstep(0.55, 1.0, 1.0 - depth);
|
|
1837
|
+
|
|
1838
|
+
// Three soft lights sit low in the card and drift slowly; the middle one is the broadest.
|
|
1839
|
+
vec2 p = vec2(side * aspect, depth);
|
|
1840
|
+
// The lights are bent by slow noise, so their edges curl like smoke instead of staying round.
|
|
1841
|
+
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;
|
|
1842
|
+
p += bend * max(uWarp, 0.0) * 0.45;
|
|
1843
|
+
float wander = 0.05 * sin(t);
|
|
1844
|
+
float a = blob(p, vec2((0.18 + wander) * aspect, 0.0), vec2(0.5 * spread * aspect, 0.42 * height));
|
|
1845
|
+
float b = blob(p, vec2((0.52 - wander) * aspect, -0.04), vec2(0.62 * spread * aspect, 0.5 * height));
|
|
1846
|
+
float c = blob(p, vec2((0.86 + wander * 0.6) * aspect, 0.02), vec2(0.5 * spread * aspect, 0.44 * height));
|
|
1847
|
+
// Each light is thicker in some places than in others, so the colors mix unevenly.
|
|
1848
|
+
float patchy = fbm(p * 4.0 + 11.0);
|
|
1849
|
+
a *= 0.55 + 0.9 * patchy;
|
|
1850
|
+
b *= 0.55 + 0.9 * (1.0 - patchy);
|
|
1851
|
+
c *= 0.55 + 0.9 * fbm(p * 4.0 + 23.0);
|
|
1852
|
+
vec3 glow = uColorA * a + uColorB * b + uColorC * c;
|
|
1853
|
+
|
|
1854
|
+
// A haze reaches higher than the lights, so the color fades out into the body.
|
|
1855
|
+
float haze = smoothstep(height, 0.0, depth);
|
|
1856
|
+
glow += mix(uColorB, uColorA, side) * haze * haze * 0.35;
|
|
1857
|
+
color += glow * max(uIntensity, 0.0);
|
|
1858
|
+
|
|
1859
|
+
// Near the exit edge the lights are so strong that they turn white.
|
|
1860
|
+
float hot = smoothstep(height * 0.38, 0.0, depth) * (a + b + c) * clamp(uCore, 0.0, 1.0);
|
|
1861
|
+
color = mix(color, vec3(0.93, 0.95, 1.0), clamp(hot, 0.0, 1.0));
|
|
1862
|
+
|
|
1863
|
+
// A thin rim along the edge, strongest on the side away from the light.
|
|
1864
|
+
float rim = (1.0 - smoothstep(0.0, 1.6, -distance)) * smoothstep(0.0, 1.0, -distance + 1.0);
|
|
1865
|
+
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));
|
|
1866
|
+
|
|
1867
|
+
// The grit sits in the lit parts and fades in the dark body, as on film.
|
|
1868
|
+
float lit = clamp(dot(glow, vec3(0.45)) * max(uIntensity, 0.0) + hot, 0.0, 1.0);
|
|
1869
|
+
float grit = hash(gl_FragCoord.xy) - 0.5;
|
|
1870
|
+
grit += 0.5 * (hash(floor(gl_FragCoord.xy * 0.5) + 17.0) - 0.5);
|
|
1871
|
+
color += grit * max(uGrain, 0.0) * (0.3 + 2.2 * lit * (1.0 - 0.5 * lit));
|
|
1872
|
+
gl_FragColor = vec4(clamp(color, 0.0, 1.0), shape);
|
|
1873
|
+
}
|
|
1874
|
+
`;
|
|
1875
|
+
var glowCardProgram = {
|
|
1876
|
+
name: "glowCard",
|
|
1877
|
+
fragmentSource: fragmentSource8,
|
|
1878
|
+
defaultParameters: {
|
|
1879
|
+
speed: 0.12,
|
|
1880
|
+
intensity: 1,
|
|
1881
|
+
glowHeight: 0.55,
|
|
1882
|
+
glowSpread: 1,
|
|
1883
|
+
core: 0.7,
|
|
1884
|
+
rim: 0.55,
|
|
1885
|
+
grain: 0.12,
|
|
1886
|
+
warp: 1,
|
|
1887
|
+
angle: 0,
|
|
1888
|
+
cornerRadius: 0.08,
|
|
1889
|
+
baseColor: "#0b0b12",
|
|
1890
|
+
colorA: "#2f6bff",
|
|
1891
|
+
colorB: "#9d5cff",
|
|
1892
|
+
colorC: "#34d3c4"
|
|
1893
|
+
}
|
|
1894
|
+
};
|
|
1895
|
+
|
|
1896
|
+
// src/runtime/viewer/shaders/builtins/halftoneHalo.ts
|
|
1897
|
+
var fragmentSource9 = `
|
|
1898
|
+
precision highp float;
|
|
1899
|
+
|
|
1774
1900
|
uniform vec2 uResolution;
|
|
1775
1901
|
uniform float uTime;
|
|
1776
1902
|
uniform float uSpeed;
|
|
@@ -1847,11 +1973,11 @@ void main() {
|
|
|
1847
1973
|
`;
|
|
1848
1974
|
var halftoneHaloProgram = {
|
|
1849
1975
|
name: "halftoneHalo",
|
|
1850
|
-
fragmentSource:
|
|
1976
|
+
fragmentSource: fragmentSource9
|
|
1851
1977
|
};
|
|
1852
1978
|
|
|
1853
1979
|
// src/runtime/viewer/shaders/builtins/halo.ts
|
|
1854
|
-
var
|
|
1980
|
+
var fragmentSource10 = `
|
|
1855
1981
|
precision highp float;
|
|
1856
1982
|
|
|
1857
1983
|
uniform vec2 uResolution;
|
|
@@ -1926,11 +2052,11 @@ void main() {
|
|
|
1926
2052
|
`;
|
|
1927
2053
|
var haloProgram = {
|
|
1928
2054
|
name: "halo",
|
|
1929
|
-
fragmentSource:
|
|
2055
|
+
fragmentSource: fragmentSource10
|
|
1930
2056
|
};
|
|
1931
2057
|
|
|
1932
2058
|
// src/runtime/viewer/shaders/builtins/ledMatrix.ts
|
|
1933
|
-
var
|
|
2059
|
+
var fragmentSource11 = `
|
|
1934
2060
|
precision highp float;
|
|
1935
2061
|
|
|
1936
2062
|
uniform vec2 uResolution;
|
|
@@ -2046,7 +2172,7 @@ void main() {
|
|
|
2046
2172
|
`;
|
|
2047
2173
|
var ledMatrixProgram = {
|
|
2048
2174
|
name: "ledMatrix",
|
|
2049
|
-
fragmentSource:
|
|
2175
|
+
fragmentSource: fragmentSource11,
|
|
2050
2176
|
defaultParameters: {
|
|
2051
2177
|
speed: 0.25,
|
|
2052
2178
|
intensity: 1,
|
|
@@ -2077,7 +2203,7 @@ var ledMatrixProgram = {
|
|
|
2077
2203
|
};
|
|
2078
2204
|
|
|
2079
2205
|
// src/runtime/viewer/shaders/builtins/lightBand.ts
|
|
2080
|
-
var
|
|
2206
|
+
var fragmentSource12 = `
|
|
2081
2207
|
precision highp float;
|
|
2082
2208
|
|
|
2083
2209
|
uniform vec2 uResolution;
|
|
@@ -2137,7 +2263,7 @@ void main() {
|
|
|
2137
2263
|
`;
|
|
2138
2264
|
var lightBandProgram = {
|
|
2139
2265
|
name: "lightBand",
|
|
2140
|
-
fragmentSource:
|
|
2266
|
+
fragmentSource: fragmentSource12,
|
|
2141
2267
|
defaultParameters: {
|
|
2142
2268
|
speed: 0.3,
|
|
2143
2269
|
intensity: 1,
|
|
@@ -2154,7 +2280,7 @@ var lightBandProgram = {
|
|
|
2154
2280
|
};
|
|
2155
2281
|
|
|
2156
2282
|
// src/runtime/viewer/shaders/builtins/lumenPortal.ts
|
|
2157
|
-
var
|
|
2283
|
+
var fragmentSource13 = `
|
|
2158
2284
|
precision highp float;
|
|
2159
2285
|
|
|
2160
2286
|
uniform float uTime;
|
|
@@ -2212,11 +2338,11 @@ void main() {
|
|
|
2212
2338
|
`;
|
|
2213
2339
|
var lumenPortalProgram = {
|
|
2214
2340
|
name: "lumenPortal",
|
|
2215
|
-
fragmentSource:
|
|
2341
|
+
fragmentSource: fragmentSource13
|
|
2216
2342
|
};
|
|
2217
2343
|
|
|
2218
2344
|
// src/runtime/viewer/shaders/builtins/lumenPortalLight.ts
|
|
2219
|
-
var
|
|
2345
|
+
var fragmentSource14 = `
|
|
2220
2346
|
precision highp float;
|
|
2221
2347
|
|
|
2222
2348
|
uniform float uTime;
|
|
@@ -2275,11 +2401,11 @@ void main() {
|
|
|
2275
2401
|
`;
|
|
2276
2402
|
var lumenPortalLightProgram = {
|
|
2277
2403
|
name: "lumenPortalLight",
|
|
2278
|
-
fragmentSource:
|
|
2404
|
+
fragmentSource: fragmentSource14
|
|
2279
2405
|
};
|
|
2280
2406
|
|
|
2281
2407
|
// src/runtime/viewer/shaders/builtins/orb.ts
|
|
2282
|
-
var
|
|
2408
|
+
var fragmentSource15 = `
|
|
2283
2409
|
precision highp float;
|
|
2284
2410
|
|
|
2285
2411
|
uniform vec2 uResolution;
|
|
@@ -2315,11 +2441,11 @@ void main() {
|
|
|
2315
2441
|
`;
|
|
2316
2442
|
var orbProgram = {
|
|
2317
2443
|
name: "orb",
|
|
2318
|
-
fragmentSource:
|
|
2444
|
+
fragmentSource: fragmentSource15
|
|
2319
2445
|
};
|
|
2320
2446
|
|
|
2321
2447
|
// src/runtime/viewer/shaders/builtins/pixelConstellation.ts
|
|
2322
|
-
var
|
|
2448
|
+
var fragmentSource16 = `
|
|
2323
2449
|
precision highp float;
|
|
2324
2450
|
|
|
2325
2451
|
uniform float uTime;
|
|
@@ -2419,11 +2545,11 @@ void main() {
|
|
|
2419
2545
|
`;
|
|
2420
2546
|
var pixelConstellationProgram = {
|
|
2421
2547
|
name: "pixelConstellation",
|
|
2422
|
-
fragmentSource:
|
|
2548
|
+
fragmentSource: fragmentSource16
|
|
2423
2549
|
};
|
|
2424
2550
|
|
|
2425
2551
|
// src/runtime/viewer/shaders/builtins/plasmaGauge.ts
|
|
2426
|
-
var
|
|
2552
|
+
var fragmentSource17 = `
|
|
2427
2553
|
precision highp float;
|
|
2428
2554
|
|
|
2429
2555
|
uniform vec2 uResolution;
|
|
@@ -2525,12 +2651,12 @@ void main() {
|
|
|
2525
2651
|
`;
|
|
2526
2652
|
var plasmaGaugeProgram = {
|
|
2527
2653
|
name: "plasmaGauge",
|
|
2528
|
-
fragmentSource:
|
|
2654
|
+
fragmentSource: fragmentSource17,
|
|
2529
2655
|
replacesBaseFill: true
|
|
2530
2656
|
};
|
|
2531
2657
|
|
|
2532
2658
|
// src/runtime/viewer/shaders/builtins/prismSlats.ts
|
|
2533
|
-
var
|
|
2659
|
+
var fragmentSource18 = `
|
|
2534
2660
|
precision highp float;
|
|
2535
2661
|
|
|
2536
2662
|
uniform vec2 uResolution;
|
|
@@ -2605,11 +2731,11 @@ void main() {
|
|
|
2605
2731
|
`;
|
|
2606
2732
|
var prismSlatsProgram = {
|
|
2607
2733
|
name: "prismSlats",
|
|
2608
|
-
fragmentSource:
|
|
2734
|
+
fragmentSource: fragmentSource18
|
|
2609
2735
|
};
|
|
2610
2736
|
|
|
2611
2737
|
// src/runtime/viewer/shaders/builtins/reactivePanel.ts
|
|
2612
|
-
var
|
|
2738
|
+
var fragmentSource19 = `
|
|
2613
2739
|
precision highp float;
|
|
2614
2740
|
|
|
2615
2741
|
uniform float uTime;
|
|
@@ -2711,7 +2837,7 @@ void main() {
|
|
|
2711
2837
|
`;
|
|
2712
2838
|
var reactivePanelProgram = {
|
|
2713
2839
|
name: "reactivePanel",
|
|
2714
|
-
fragmentSource:
|
|
2840
|
+
fragmentSource: fragmentSource19,
|
|
2715
2841
|
defaultParameters: {
|
|
2716
2842
|
intensity: 0.5,
|
|
2717
2843
|
speed: 0.18,
|
|
@@ -2734,7 +2860,7 @@ var reactivePanelProgram = {
|
|
|
2734
2860
|
};
|
|
2735
2861
|
|
|
2736
2862
|
// src/runtime/viewer/shaders/builtins/ruler.ts
|
|
2737
|
-
var
|
|
2863
|
+
var fragmentSource20 = `
|
|
2738
2864
|
precision highp float;
|
|
2739
2865
|
|
|
2740
2866
|
uniform vec2 uResolution;
|
|
@@ -2839,12 +2965,12 @@ void main() {
|
|
|
2839
2965
|
`;
|
|
2840
2966
|
var rulerProgram = {
|
|
2841
2967
|
name: "ruler",
|
|
2842
|
-
fragmentSource:
|
|
2968
|
+
fragmentSource: fragmentSource20,
|
|
2843
2969
|
replacesBaseFill: true
|
|
2844
2970
|
};
|
|
2845
2971
|
|
|
2846
2972
|
// src/runtime/viewer/shaders/builtins/silkFolds.ts
|
|
2847
|
-
var
|
|
2973
|
+
var fragmentSource21 = `
|
|
2848
2974
|
precision highp float;
|
|
2849
2975
|
|
|
2850
2976
|
uniform vec2 uResolution;
|
|
@@ -2929,7 +3055,7 @@ void main() {
|
|
|
2929
3055
|
`;
|
|
2930
3056
|
var silkFoldsProgram = {
|
|
2931
3057
|
name: "silkFolds",
|
|
2932
|
-
fragmentSource:
|
|
3058
|
+
fragmentSource: fragmentSource21,
|
|
2933
3059
|
defaultParameters: {
|
|
2934
3060
|
speed: 0.2,
|
|
2935
3061
|
intensity: 1,
|
|
@@ -2952,7 +3078,7 @@ var silkFoldsProgram = {
|
|
|
2952
3078
|
};
|
|
2953
3079
|
|
|
2954
3080
|
// src/runtime/viewer/shaders/builtins/smearOrb.ts
|
|
2955
|
-
var
|
|
3081
|
+
var fragmentSource22 = `
|
|
2956
3082
|
precision highp float;
|
|
2957
3083
|
|
|
2958
3084
|
uniform vec2 uResolution;
|
|
@@ -3028,12 +3154,12 @@ void main() {
|
|
|
3028
3154
|
`;
|
|
3029
3155
|
var smearOrbProgram = {
|
|
3030
3156
|
name: "smearOrb",
|
|
3031
|
-
fragmentSource:
|
|
3157
|
+
fragmentSource: fragmentSource22,
|
|
3032
3158
|
replacesBaseFill: true
|
|
3033
3159
|
};
|
|
3034
3160
|
|
|
3035
3161
|
// src/runtime/viewer/shaders/builtins/tickScale.ts
|
|
3036
|
-
var
|
|
3162
|
+
var fragmentSource23 = `
|
|
3037
3163
|
precision highp float;
|
|
3038
3164
|
|
|
3039
3165
|
uniform vec2 uResolution;
|
|
@@ -3092,12 +3218,12 @@ void main() {
|
|
|
3092
3218
|
`;
|
|
3093
3219
|
var tickScaleProgram = {
|
|
3094
3220
|
name: "tickScale",
|
|
3095
|
-
fragmentSource:
|
|
3221
|
+
fragmentSource: fragmentSource23,
|
|
3096
3222
|
replacesBaseFill: true
|
|
3097
3223
|
};
|
|
3098
3224
|
|
|
3099
3225
|
// src/runtime/viewer/shaders/builtins/violetGlass.ts
|
|
3100
|
-
var
|
|
3226
|
+
var fragmentSource24 = `
|
|
3101
3227
|
precision highp float;
|
|
3102
3228
|
|
|
3103
3229
|
uniform float uTime;
|
|
@@ -3177,11 +3303,11 @@ void main() {
|
|
|
3177
3303
|
`;
|
|
3178
3304
|
var violetGlassProgram = {
|
|
3179
3305
|
name: "violetGlass",
|
|
3180
|
-
fragmentSource:
|
|
3306
|
+
fragmentSource: fragmentSource24
|
|
3181
3307
|
};
|
|
3182
3308
|
|
|
3183
3309
|
// src/runtime/viewer/shaders/builtins/violetGlassLight.ts
|
|
3184
|
-
var
|
|
3310
|
+
var fragmentSource25 = `
|
|
3185
3311
|
precision highp float;
|
|
3186
3312
|
|
|
3187
3313
|
uniform float uTime;
|
|
@@ -3251,7 +3377,7 @@ void main() {
|
|
|
3251
3377
|
`;
|
|
3252
3378
|
var violetGlassLightProgram = {
|
|
3253
3379
|
name: "violetGlassLight",
|
|
3254
|
-
fragmentSource:
|
|
3380
|
+
fragmentSource: fragmentSource25
|
|
3255
3381
|
};
|
|
3256
3382
|
|
|
3257
3383
|
// src/runtime/viewer/shaders/programs.ts
|
|
@@ -3279,7 +3405,8 @@ var builtins = [
|
|
|
3279
3405
|
reactivePanelProgram,
|
|
3280
3406
|
ledMatrixProgram,
|
|
3281
3407
|
lightBandProgram,
|
|
3282
|
-
silkFoldsProgram
|
|
3408
|
+
silkFoldsProgram,
|
|
3409
|
+
glowCardProgram
|
|
3283
3410
|
];
|
|
3284
3411
|
var programs = new Map(builtins.map((program) => [program.name, program]));
|
|
3285
3412
|
function registerShaderProgram(program) {
|
|
@@ -3460,9 +3587,9 @@ function compile(gl, type, source) {
|
|
|
3460
3587
|
}
|
|
3461
3588
|
return shader;
|
|
3462
3589
|
}
|
|
3463
|
-
function linkProgram(gl,
|
|
3590
|
+
function linkProgram(gl, fragmentSource26) {
|
|
3464
3591
|
const vertex = compile(gl, gl.VERTEX_SHADER, VERTEX_SOURCE);
|
|
3465
|
-
const fragment = compile(gl, gl.FRAGMENT_SHADER,
|
|
3592
|
+
const fragment = compile(gl, gl.FRAGMENT_SHADER, fragmentSource26);
|
|
3466
3593
|
if (!vertex || !fragment) {
|
|
3467
3594
|
if (vertex) {
|
|
3468
3595
|
gl.deleteShader(vertex);
|
|
@@ -4023,21 +4150,21 @@ function mountShaderSurfaces(svg) {
|
|
|
4023
4150
|
|
|
4024
4151
|
// src/runtime/viewer/source.ts
|
|
4025
4152
|
function renderViewerSource(next, defaultRenderOptions) {
|
|
4026
|
-
const svg = next.svg ?? (next.source != null ?
|
|
4153
|
+
const svg = next.svg ?? (next.source != null ? chunkVOYX6JMW_cjs.render(next.source, { ...next.renderOptions ?? defaultRenderOptions, linkHitAreas: true }).svg : null);
|
|
4027
4154
|
if (svg == null) {
|
|
4028
4155
|
throw new Error("createViewer: provide either `source` (SFL) or `svg`.");
|
|
4029
4156
|
}
|
|
4030
4157
|
return svg;
|
|
4031
4158
|
}
|
|
4032
4159
|
function assertCreateViewerContract(svg) {
|
|
4033
|
-
const version =
|
|
4034
|
-
if (!
|
|
4160
|
+
const version = chunkFQ7GMLCM_cjs.parseContractVersion(svg);
|
|
4161
|
+
if (!chunkFQ7GMLCM_cjs.isContractCompatible(version)) {
|
|
4035
4162
|
throw new Error(`createViewer: incompatible DOM contract (svg=${version}). Renderer and viewer versions differ.`);
|
|
4036
4163
|
}
|
|
4037
4164
|
}
|
|
4038
4165
|
function assertViewerUpdateContract(svg) {
|
|
4039
|
-
const version =
|
|
4040
|
-
if (!
|
|
4166
|
+
const version = chunkFQ7GMLCM_cjs.parseContractVersion(svg);
|
|
4167
|
+
if (!chunkFQ7GMLCM_cjs.isContractCompatible(version)) {
|
|
4041
4168
|
throw new Error(`viewer.update: incompatible DOM contract (svg=${version}). Renderer and viewer versions differ.`);
|
|
4042
4169
|
}
|
|
4043
4170
|
}
|
|
@@ -4271,7 +4398,7 @@ function trackScales(wiring, event) {
|
|
|
4271
4398
|
}
|
|
4272
4399
|
function driveValue(wiring, id, event) {
|
|
4273
4400
|
const { runtime, svg } = wiring;
|
|
4274
|
-
const kind =
|
|
4401
|
+
const kind = chunkLNW5VIEA_cjs.getComponentDescriptor(runtime.graph.elements.get(id)?.componentType)?.interaction;
|
|
4275
4402
|
if (kind !== "slide" && kind !== "pick" && kind !== "turn" && kind !== "range") {
|
|
4276
4403
|
return;
|
|
4277
4404
|
}
|
|
@@ -4410,5 +4537,5 @@ exports.connectInteraction = connectInteraction;
|
|
|
4410
4537
|
exports.createViewer = createViewer;
|
|
4411
4538
|
exports.registerShaderProgram = registerShaderProgram;
|
|
4412
4539
|
exports.shaderProgram = shaderProgram;
|
|
4413
|
-
//# sourceMappingURL=chunk-
|
|
4414
|
-
//# sourceMappingURL=chunk-
|
|
4540
|
+
//# sourceMappingURL=chunk-IR2T47NW.cjs.map
|
|
4541
|
+
//# sourceMappingURL=chunk-IR2T47NW.cjs.map
|