stickyflow 0.9.0 → 0.9.2
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 +16 -0
- package/dist/binding/index.cjs +9 -9
- package/dist/binding/index.js +3 -3
- package/dist/{chunk-B3YRZVMR.cjs → chunk-2GKXPZRL.cjs} +23 -23
- package/dist/{chunk-B3YRZVMR.cjs.map → chunk-2GKXPZRL.cjs.map} +1 -1
- package/dist/{chunk-SQBF2BKT.cjs → chunk-3EOG34QN.cjs} +48 -44
- package/dist/chunk-3EOG34QN.cjs.map +1 -0
- package/dist/{chunk-CM35H45Z.js → chunk-AAP24GBG.js} +3 -3
- package/dist/{chunk-CM35H45Z.js.map → chunk-AAP24GBG.js.map} +1 -1
- package/dist/{chunk-QL7MNEMT.cjs → chunk-C25NWWIH.cjs} +48 -3
- package/dist/chunk-C25NWWIH.cjs.map +1 -0
- package/dist/{chunk-ZCGZJBAT.js → chunk-C3LVKPWQ.js} +19 -15
- package/dist/chunk-C3LVKPWQ.js.map +1 -0
- package/dist/{chunk-YSXD5IVZ.cjs → chunk-EURX7QT3.cjs} +672 -657
- package/dist/chunk-EURX7QT3.cjs.map +1 -0
- package/dist/{chunk-FS6L462E.js → chunk-G2N3KJYJ.js} +22 -7
- package/dist/chunk-G2N3KJYJ.js.map +1 -0
- package/dist/{chunk-OUWGWDJ2.cjs → chunk-MR32IJQO.cjs} +15 -15
- package/dist/{chunk-OUWGWDJ2.cjs.map → chunk-MR32IJQO.cjs.map} +1 -1
- package/dist/{chunk-D2266VBZ.js → chunk-Q6FBISNP.js} +48 -3
- package/dist/chunk-Q6FBISNP.js.map +1 -0
- package/dist/{chunk-BUVUJMWT.js → chunk-XNNNIOJU.js} +4 -4
- package/dist/{chunk-BUVUJMWT.js.map → chunk-XNNNIOJU.js.map} +1 -1
- package/dist/index.cjs +36 -36
- package/dist/index.js +5 -5
- package/dist/interaction/index.cjs +230 -230
- package/dist/interaction/index.js +2 -2
- package/dist/stickyflow-diagram.global.js +37 -37
- package/dist/stickyflow-diagram.global.js.map +1 -1
- package/dist/viewer/index.cjs +9 -9
- package/dist/viewer/index.js +4 -4
- package/dist/web-component/index.cjs +6 -6
- package/dist/web-component/index.js +4 -4
- package/package.json +1 -1
- package/dist/chunk-D2266VBZ.js.map +0 -1
- package/dist/chunk-FS6L462E.js.map +0 -1
- package/dist/chunk-QL7MNEMT.cjs.map +0 -1
- package/dist/chunk-SQBF2BKT.cjs.map +0 -1
- package/dist/chunk-YSXD5IVZ.cjs.map +0 -1
- package/dist/chunk-ZCGZJBAT.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -17,6 +17,22 @@ Two things count as breaking here that are easy to overlook:
|
|
|
17
17
|
|
|
18
18
|
## [Unreleased]
|
|
19
19
|
|
|
20
|
+
## [0.9.2] - 2026-10-28
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
|
|
24
|
+
- A document that uses one name for two objects, or two links, now has a `duplicate-name` warning. Two Repeat blocks that make blocks from templates of the same name cause it too, because each makes a block `name_0_0`.
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
|
|
28
|
+
- A document that has two blocks of the same name left the second of them behind in the viewer when the source was changed to another document, as ghost shapes that were not part of the new document. The viewer now matches elements of one id one by one, so every one is patched, kept or dropped, and what is on the canvas is always what a fresh render of the source has.
|
|
29
|
+
|
|
30
|
+
## [0.9.1] - 2026-10-28
|
|
31
|
+
|
|
32
|
+
### Fixed
|
|
33
|
+
|
|
34
|
+
- The view of a document that fits to its content no longer counts what a frame with `clip` cuts off. A poster in a clipping frame, with a scene that runs past its edge, was shown very small because the view was fitted to the whole scene. It is now fitted to the frame. A frame that is turned is not yet taken into account.
|
|
35
|
+
|
|
20
36
|
## [0.9.0] - 2026-10-28
|
|
21
37
|
|
|
22
38
|
### Added
|
package/dist/binding/index.cjs
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
5
|
-
require('../chunk-
|
|
3
|
+
var chunk2GKXPZRL_cjs = require('../chunk-2GKXPZRL.cjs');
|
|
4
|
+
require('../chunk-EURX7QT3.cjs');
|
|
5
|
+
require('../chunk-C25NWWIH.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "buildBindingGraph", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunk2GKXPZRL_cjs.buildBindingGraph; }
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "collectContracts", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunk2GKXPZRL_cjs.collectContracts; }
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "createBindingRuntime", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunk2GKXPZRL_cjs.createBindingRuntime; }
|
|
20
20
|
});
|
|
21
21
|
Object.defineProperty(exports, "createDataSource", {
|
|
22
22
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
23
|
+
get: function () { return chunk2GKXPZRL_cjs.createDataSource; }
|
|
24
24
|
});
|
|
25
25
|
Object.defineProperty(exports, "interactiveElements", {
|
|
26
26
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
27
|
+
get: function () { return chunk2GKXPZRL_cjs.interactiveElements; }
|
|
28
28
|
});
|
|
29
29
|
Object.defineProperty(exports, "renderBound", {
|
|
30
30
|
enumerable: true,
|
|
31
|
-
get: function () { return
|
|
31
|
+
get: function () { return chunk2GKXPZRL_cjs.renderBound; }
|
|
32
32
|
});
|
|
33
33
|
//# sourceMappingURL=index.cjs.map
|
|
34
34
|
//# sourceMappingURL=index.cjs.map
|
package/dist/binding/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { buildBindingGraph, collectContracts, createBindingRuntime, createDataSource, interactiveElements, renderBound } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
1
|
+
export { buildBindingGraph, collectContracts, createBindingRuntime, createDataSource, interactiveElements, renderBound } from '../chunk-XNNNIOJU.js';
|
|
2
|
+
import '../chunk-G2N3KJYJ.js';
|
|
3
|
+
import '../chunk-Q6FBISNP.js';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkEURX7QT3_cjs = require('./chunk-EURX7QT3.cjs');
|
|
4
|
+
var chunkC25NWWIH_cjs = require('./chunk-C25NWWIH.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 chunkC25NWWIH_cjs.getComponentDescriptor(componentType)?.value?.writable === true;
|
|
106
106
|
}
|
|
107
107
|
function componentStateType(componentType, state) {
|
|
108
|
-
const descriptor =
|
|
108
|
+
const descriptor = chunkC25NWWIH_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 chunkC25NWWIH_cjs.getComponentDescriptor(componentType)?.properties.valueEnd?.type === "number" ? "number" : void 0;
|
|
123
123
|
}
|
|
124
|
-
return property === "value" ?
|
|
124
|
+
return property === "value" ? chunkC25NWWIH_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 = chunkC25NWWIH_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 = chunkC25NWWIH_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 && chunkC25NWWIH_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 && chunkC25NWWIH_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 && chunkC25NWWIH_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 = chunkC25NWWIH_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(chunkC25NWWIH_cjs.expandRepeats(chunkC25NWWIH_cjs.parseSource(sfl)));
|
|
824
|
+
const input = structuredClone(chunkEURX7QT3_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 (!chunkC25NWWIH_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 = chunkEURX7QT3_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" ? chunkC25NWWIH_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 || !chunkC25NWWIH_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 = chunkEURX7QT3_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 || !chunkC25NWWIH_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 chunkEURX7QT3_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-2GKXPZRL.cjs.map
|
|
1322
|
+
//# sourceMappingURL=chunk-2GKXPZRL.cjs.map
|