stickyflow 0.10.0 → 0.11.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 +14 -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-5PJ55GPG.cjs → chunk-5G3BEXQU.cjs} +1069 -713
- package/dist/chunk-5G3BEXQU.cjs.map +1 -0
- package/dist/{chunk-EGUPN56K.js → chunk-BFQWCOEC.js} +3 -3
- package/dist/{chunk-EGUPN56K.js.map → chunk-BFQWCOEC.js.map} +1 -1
- package/dist/{chunk-KRSX4UZ7.cjs → chunk-F24JURN2.cjs} +293 -46
- package/dist/chunk-F24JURN2.cjs.map +1 -0
- package/dist/{chunk-TECWZVIM.cjs → chunk-FXGXUWSI.cjs} +23 -23
- package/dist/{chunk-TECWZVIM.cjs.map → chunk-FXGXUWSI.cjs.map} +1 -1
- package/dist/{chunk-HRU6VOEC.js → chunk-G6IW2IX3.js} +44 -7
- package/dist/chunk-G6IW2IX3.js.map +1 -0
- package/dist/{chunk-SDOHUNBW.js → chunk-Q6QLU6YQ.js} +428 -72
- package/dist/chunk-Q6QLU6YQ.js.map +1 -0
- package/dist/{chunk-VPNOVRWP.js → chunk-RQYZNW2I.js} +262 -15
- package/dist/chunk-RQYZNW2I.js.map +1 -0
- package/dist/{chunk-L7CEX5JV.js → chunk-UB2ANTWF.js} +4 -4
- package/dist/{chunk-L7CEX5JV.js.map → chunk-UB2ANTWF.js.map} +1 -1
- package/dist/{chunk-LSEMXRB5.cjs → chunk-UHKFJBY5.cjs} +44 -7
- package/dist/chunk-UHKFJBY5.cjs.map +1 -0
- package/dist/{chunk-SCD3AHMY.cjs → chunk-WZA3DJJH.cjs} +15 -15
- package/dist/{chunk-SCD3AHMY.cjs.map → chunk-WZA3DJJH.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 +240 -237
- package/dist/interaction/index.cjs.map +1 -1
- package/dist/interaction/index.d.cts +3 -3
- package/dist/interaction/index.d.ts +3 -3
- package/dist/interaction/index.js +6 -3
- package/dist/interaction/index.js.map +1 -1
- package/dist/{render-DU4lYbRl.d.cts → render-BDO4S5uF.d.cts} +16 -0
- package/dist/{render-DU4lYbRl.d.ts → render-BDO4S5uF.d.ts} +16 -0
- package/dist/{runtime-Bkv7QW7H.d.cts → runtime-C-C5v9po.d.cts} +2 -2
- package/dist/{runtime-DJ4K4_HZ.d.ts → runtime-lCAfU-1Q.d.ts} +2 -2
- package/dist/{runtimeTypes-C1shzoyr.d.ts → runtimeTypes-B7p6b1Bi.d.cts} +2 -2
- package/dist/{runtimeTypes-BvJBZLkr.d.cts → runtimeTypes-BDA_CfWh.d.ts} +2 -2
- package/dist/stickyflow-diagram.global.js +197 -44
- package/dist/stickyflow-diagram.global.js.map +1 -1
- package/dist/{types-B5jrEEcF.d.cts → types-CZJzycKw.d.cts} +1 -1
- package/dist/{types-B7IkZ0w4.d.ts → types-Dp8JVZLB.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-5PJ55GPG.cjs.map +0 -1
- package/dist/chunk-HRU6VOEC.js.map +0 -1
- package/dist/chunk-KRSX4UZ7.cjs.map +0 -1
- package/dist/chunk-LSEMXRB5.cjs.map +0 -1
- package/dist/chunk-SDOHUNBW.js.map +0 -1
- package/dist/chunk-VPNOVRWP.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunk5G3BEXQU_cjs = require('./chunk-5G3BEXQU.cjs');
|
|
4
|
+
var chunkUHKFJBY5_cjs = require('./chunk-UHKFJBY5.cjs');
|
|
5
5
|
|
|
6
6
|
// src/binding/types.ts
|
|
7
7
|
var DECLARED = {
|
|
@@ -102,10 +102,10 @@ function createDataSource(initial) {
|
|
|
102
102
|
// src/binding/componentBinding.ts
|
|
103
103
|
var BINDABLE_COMPONENT_PROPERTIES = ["value", "valueEnd", "disabled"];
|
|
104
104
|
function acceptsUserChange(componentType) {
|
|
105
|
-
return
|
|
105
|
+
return chunkUHKFJBY5_cjs.getComponentDescriptor(componentType)?.value?.writable === true;
|
|
106
106
|
}
|
|
107
107
|
function componentStateType(componentType, state) {
|
|
108
|
-
const descriptor =
|
|
108
|
+
const descriptor = chunkUHKFJBY5_cjs.getComponentDescriptor(componentType);
|
|
109
109
|
if (state === "focused") {
|
|
110
110
|
return "boolean";
|
|
111
111
|
}
|
|
@@ -119,9 +119,9 @@ function componentPropertyType(componentType, property) {
|
|
|
119
119
|
return "boolean";
|
|
120
120
|
}
|
|
121
121
|
if (property === "valueEnd") {
|
|
122
|
-
return
|
|
122
|
+
return chunkUHKFJBY5_cjs.getComponentDescriptor(componentType)?.properties.valueEnd?.type === "number" ? "number" : void 0;
|
|
123
123
|
}
|
|
124
|
-
return property === "value" ?
|
|
124
|
+
return property === "value" ? chunkUHKFJBY5_cjs.getComponentDescriptor(componentType)?.value?.type : void 0;
|
|
125
125
|
}
|
|
126
126
|
function twoWayTargetProblem(key, expr, contracts) {
|
|
127
127
|
const target = expr.kind === "ref" ? expr.path : void 0;
|
|
@@ -689,7 +689,7 @@ function interactiveElements(graph) {
|
|
|
689
689
|
collectRefs(binding.expr).forEach(note);
|
|
690
690
|
}
|
|
691
691
|
for (const [name, info] of graph.elements) {
|
|
692
|
-
const interaction =
|
|
692
|
+
const interaction = chunkUHKFJBY5_cjs.getComponentDescriptor(info.componentType)?.interaction;
|
|
693
693
|
if (info.kind === "Component" && interaction && OPERATED.has(interaction) && !graph.contracts.has(name)) {
|
|
694
694
|
pressable.add(name);
|
|
695
695
|
}
|
|
@@ -739,23 +739,23 @@ function writeComponentValue(input, id, value) {
|
|
|
739
739
|
if (!component) {
|
|
740
740
|
return;
|
|
741
741
|
}
|
|
742
|
-
component.value =
|
|
742
|
+
component.value = chunkUHKFJBY5_cjs.isGenericComponent(component) ? value : String(value);
|
|
743
743
|
}
|
|
744
744
|
function writeComponentValueEnd(input, id, value) {
|
|
745
745
|
const component = findComponent(input, id);
|
|
746
|
-
if (component &&
|
|
746
|
+
if (component && chunkUHKFJBY5_cjs.isGenericComponent(component)) {
|
|
747
747
|
component.properties.valueEnd = value;
|
|
748
748
|
}
|
|
749
749
|
}
|
|
750
750
|
function writeComponentDisabled(input, id, disabled) {
|
|
751
751
|
const component = findComponent(input, id);
|
|
752
|
-
if (component &&
|
|
752
|
+
if (component && chunkUHKFJBY5_cjs.isGenericComponent(component)) {
|
|
753
753
|
component.disabled = disabled;
|
|
754
754
|
}
|
|
755
755
|
}
|
|
756
756
|
function isComponentDisabled(input, id) {
|
|
757
757
|
const component = findComponent(input, id);
|
|
758
|
-
return component !== void 0 &&
|
|
758
|
+
return component !== void 0 && chunkUHKFJBY5_cjs.isGenericComponent(component) && component.disabled;
|
|
759
759
|
}
|
|
760
760
|
function setShape(input, path, change) {
|
|
761
761
|
const shape = input.shapes.find((candidate) => candidate.id === path[0]);
|
|
@@ -808,7 +808,7 @@ function applyShader(input, binding, value, ownerId) {
|
|
|
808
808
|
|
|
809
809
|
// src/binding/runtimeState.ts
|
|
810
810
|
function initialValue(input, id, componentType) {
|
|
811
|
-
const descriptor =
|
|
811
|
+
const descriptor = chunkUHKFJBY5_cjs.getComponentDescriptor(componentType);
|
|
812
812
|
const current = findComponent(input, id)?.value;
|
|
813
813
|
if (current === void 0) {
|
|
814
814
|
return descriptor?.value?.default ?? 0;
|
|
@@ -820,8 +820,8 @@ function initialValue(input, id, componentType) {
|
|
|
820
820
|
return current;
|
|
821
821
|
}
|
|
822
822
|
function createRuntimeState(sfl, options) {
|
|
823
|
-
const graph = buildBindingGraph(
|
|
824
|
-
const input = structuredClone(
|
|
823
|
+
const graph = buildBindingGraph(chunkUHKFJBY5_cjs.expandDocument(chunkUHKFJBY5_cjs.parseSource(sfl)));
|
|
824
|
+
const input = structuredClone(chunk5G3BEXQU_cjs.sflToRenderInput(sfl));
|
|
825
825
|
const elementState = /* @__PURE__ */ new Map();
|
|
826
826
|
for (const [name, info] of graph.elements) {
|
|
827
827
|
if (!graph.contracts.has(name)) {
|
|
@@ -881,7 +881,7 @@ function applyComponentValue(state, binding, value) {
|
|
|
881
881
|
element.value = value;
|
|
882
882
|
markDirty(state, id);
|
|
883
883
|
}
|
|
884
|
-
if (!
|
|
884
|
+
if (!chunkUHKFJBY5_cjs.isBuiltInComponentType(state.graph.elements.get(id)?.componentType)) {
|
|
885
885
|
return true;
|
|
886
886
|
}
|
|
887
887
|
announce(state, binding.id, { kind: "component", id, value });
|
|
@@ -966,7 +966,7 @@ function flush(state) {
|
|
|
966
966
|
if (!changed) {
|
|
967
967
|
return null;
|
|
968
968
|
}
|
|
969
|
-
const result =
|
|
969
|
+
const result = chunk5G3BEXQU_cjs.renderCanvas(state.input, { ...state.options.renderOptions, linkHitAreas: true });
|
|
970
970
|
for (const listener of [...state.listeners]) {
|
|
971
971
|
listener(result);
|
|
972
972
|
}
|
|
@@ -1049,7 +1049,7 @@ function setElementState(state, id, patch) {
|
|
|
1049
1049
|
// src/binding/userInput.ts
|
|
1050
1050
|
function descriptorOf(state, id) {
|
|
1051
1051
|
const info = state.graph.elements.get(id);
|
|
1052
|
-
return info?.kind === "Component" ?
|
|
1052
|
+
return info?.kind === "Component" ? chunkUHKFJBY5_cjs.getComponentDescriptor(info.componentType) : void 0;
|
|
1053
1053
|
}
|
|
1054
1054
|
function valueBinding(state, id, property = "value") {
|
|
1055
1055
|
return state.graph.bindings.find(
|
|
@@ -1069,7 +1069,7 @@ function writeBack(state, binding, value) {
|
|
|
1069
1069
|
}
|
|
1070
1070
|
function changeValueEnd(state, id, next) {
|
|
1071
1071
|
const component = findComponent(state.input, id);
|
|
1072
|
-
if (!component || !
|
|
1072
|
+
if (!component || !chunkUHKFJBY5_cjs.isGenericComponent(component) || component.properties.valueEnd === next || isComponentDisabled(state.input, id)) {
|
|
1073
1073
|
return false;
|
|
1074
1074
|
}
|
|
1075
1075
|
const binding = valueBinding(state, id, "valueEnd");
|
|
@@ -1121,7 +1121,7 @@ var within = (value) => Math.min(1, Math.max(0, value));
|
|
|
1121
1121
|
function slideAlong(properties, width, height, x, y) {
|
|
1122
1122
|
const vertical = properties.direction === "vertical";
|
|
1123
1123
|
const length = vertical ? height : width;
|
|
1124
|
-
const reach =
|
|
1124
|
+
const reach = chunk5G3BEXQU_cjs.sliderReach(properties.variant, vertical ? width : height);
|
|
1125
1125
|
const position = vertical ? 1 - y : x;
|
|
1126
1126
|
return length > reach * 2 ? within((position * length - reach) / (length - reach * 2)) : position;
|
|
1127
1127
|
}
|
|
@@ -1135,7 +1135,7 @@ function turnAlong(properties, width, height, x, y) {
|
|
|
1135
1135
|
}
|
|
1136
1136
|
function slideElement(state, id, x, y = 0) {
|
|
1137
1137
|
const component = findComponent(state.input, id);
|
|
1138
|
-
if (!component || !
|
|
1138
|
+
if (!component || !chunkUHKFJBY5_cjs.isGenericComponent(component)) {
|
|
1139
1139
|
return;
|
|
1140
1140
|
}
|
|
1141
1141
|
const kind = descriptorOf(state, id)?.interaction;
|
|
@@ -1309,7 +1309,7 @@ function renderBound(sfl, options = {}) {
|
|
|
1309
1309
|
runtime.registerSource(name, { get: () => rows, subscribe: () => () => void 0 });
|
|
1310
1310
|
}
|
|
1311
1311
|
runtime.flush();
|
|
1312
|
-
return
|
|
1312
|
+
return chunk5G3BEXQU_cjs.renderCanvas(runtime.input, renderOptions);
|
|
1313
1313
|
}
|
|
1314
1314
|
|
|
1315
1315
|
exports.buildBindingGraph = buildBindingGraph;
|
|
@@ -1318,5 +1318,5 @@ exports.createBindingRuntime = createBindingRuntime;
|
|
|
1318
1318
|
exports.createDataSource = createDataSource;
|
|
1319
1319
|
exports.interactiveElements = interactiveElements;
|
|
1320
1320
|
exports.renderBound = renderBound;
|
|
1321
|
-
//# sourceMappingURL=chunk-
|
|
1322
|
-
//# sourceMappingURL=chunk-
|
|
1321
|
+
//# sourceMappingURL=chunk-FXGXUWSI.cjs.map
|
|
1322
|
+
//# sourceMappingURL=chunk-FXGXUWSI.cjs.map
|