stickyflow 0.5.0 → 0.6.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 +16 -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-IEHE6WVN.js → chunk-4G2R7PEL.js} +319 -45
- package/dist/chunk-4G2R7PEL.js.map +1 -0
- package/dist/{chunk-L3VJXZFD.cjs → chunk-4LENHH6C.cjs} +15 -15
- package/dist/{chunk-L3VJXZFD.cjs.map → chunk-4LENHH6C.cjs.map} +1 -1
- package/dist/{chunk-LTGF5OHP.js → chunk-FVHVOJS2.js} +395 -89
- package/dist/chunk-FVHVOJS2.js.map +1 -0
- package/dist/{chunk-TWDLOXRM.cjs → chunk-JIJMZMGY.cjs} +18 -18
- package/dist/{chunk-TWDLOXRM.cjs.map → chunk-JIJMZMGY.cjs.map} +1 -1
- package/dist/{chunk-VK3T6O5Z.cjs → chunk-KTNCDNDB.cjs} +33 -33
- package/dist/{chunk-VK3T6O5Z.cjs.map → chunk-KTNCDNDB.cjs.map} +1 -1
- package/dist/{chunk-BODZN3ZI.js → chunk-MFNUJA26.js} +4 -4
- package/dist/{chunk-BODZN3ZI.js.map → chunk-MFNUJA26.js.map} +1 -1
- package/dist/{chunk-7VW2XKVB.js → chunk-ULQZ6CZW.js} +3 -3
- package/dist/{chunk-7VW2XKVB.js.map → chunk-ULQZ6CZW.js.map} +1 -1
- package/dist/{chunk-ZMLQIMJK.cjs → chunk-WQRT5PVT.cjs} +993 -687
- package/dist/chunk-WQRT5PVT.cjs.map +1 -0
- package/dist/{chunk-G7NRK5AG.js → chunk-WRDVNMFS.js} +5 -5
- package/dist/{chunk-G7NRK5AG.js.map → chunk-WRDVNMFS.js.map} +1 -1
- package/dist/{chunk-XY2GZUHC.cjs → chunk-XJ4W6TW4.cjs} +326 -44
- package/dist/chunk-XJ4W6TW4.cjs.map +1 -0
- package/dist/index.cjs +49 -29
- package/dist/index.d.cts +52 -7
- package/dist/index.d.ts +52 -7
- package/dist/index.js +5 -5
- package/dist/interaction/index.cjs +245 -235
- package/dist/interaction/index.cjs.map +1 -1
- package/dist/interaction/index.d.cts +3 -2
- package/dist/interaction/index.d.ts +3 -2
- package/dist/interaction/index.js +17 -7
- package/dist/interaction/index.js.map +1 -1
- package/dist/{render-CgX_y15a.d.ts → render-Db0eSz_s.d.cts} +36 -15
- package/dist/{render-CgX_y15a.d.cts → render-Db0eSz_s.d.ts} +36 -15
- package/dist/{runtime-reWgr7MP.d.cts → runtime-BhivvBeL.d.cts} +2 -2
- package/dist/{runtime-DnUxca3Y.d.ts → runtime-n2yG-_j-.d.ts} +2 -2
- package/dist/{runtimeTypes-D60w6nyF.d.cts → runtimeTypes-CrkMHvVi.d.cts} +2 -2
- package/dist/{runtimeTypes-CEBGueYM.d.ts → runtimeTypes-DnI7mRF5.d.ts} +2 -2
- package/dist/stickyflow-diagram.global.js +35 -35
- package/dist/stickyflow-diagram.global.js.map +1 -1
- package/dist/{types-DvhMpqrL.d.cts → types-BHfUKT4s.d.cts} +1 -1
- package/dist/{types-DYLC_lsk.d.ts → types-D4cH4f1a.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-IEHE6WVN.js.map +0 -1
- package/dist/chunk-LTGF5OHP.js.map +0 -1
- package/dist/chunk-XY2GZUHC.cjs.map +0 -1
- package/dist/chunk-ZMLQIMJK.cjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkWQRT5PVT_cjs = require('./chunk-WQRT5PVT.cjs');
|
|
4
|
+
var chunkXJ4W6TW4_cjs = require('./chunk-XJ4W6TW4.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", "disabled"];
|
|
104
104
|
function acceptsUserChange(componentType) {
|
|
105
|
-
return
|
|
105
|
+
return chunkXJ4W6TW4_cjs.getComponentDescriptor(componentType)?.value?.writable === true;
|
|
106
106
|
}
|
|
107
107
|
function componentStateType(componentType, state) {
|
|
108
|
-
const descriptor =
|
|
108
|
+
const descriptor = chunkXJ4W6TW4_cjs.getComponentDescriptor(componentType);
|
|
109
109
|
if (state === "focused") {
|
|
110
110
|
return "boolean";
|
|
111
111
|
}
|
|
@@ -118,7 +118,7 @@ function componentPropertyType(componentType, property) {
|
|
|
118
118
|
if (property === "disabled") {
|
|
119
119
|
return "boolean";
|
|
120
120
|
}
|
|
121
|
-
return property === "value" ?
|
|
121
|
+
return property === "value" ? chunkXJ4W6TW4_cjs.getComponentDescriptor(componentType)?.value?.type : void 0;
|
|
122
122
|
}
|
|
123
123
|
function twoWayTargetProblem(key, expr, contracts) {
|
|
124
124
|
const target = expr.kind === "ref" ? expr.path : void 0;
|
|
@@ -683,7 +683,7 @@ function interactiveElements(graph) {
|
|
|
683
683
|
collectRefs(binding.expr).forEach(note);
|
|
684
684
|
}
|
|
685
685
|
for (const [name, info] of graph.elements) {
|
|
686
|
-
const interaction =
|
|
686
|
+
const interaction = chunkXJ4W6TW4_cjs.getComponentDescriptor(info.componentType)?.interaction;
|
|
687
687
|
if (info.kind === "Component" && interaction && OPERATED.has(interaction) && !graph.contracts.has(name)) {
|
|
688
688
|
pressable.add(name);
|
|
689
689
|
}
|
|
@@ -733,17 +733,17 @@ function writeComponentValue(input, id, value) {
|
|
|
733
733
|
if (!component) {
|
|
734
734
|
return;
|
|
735
735
|
}
|
|
736
|
-
component.value =
|
|
736
|
+
component.value = chunkXJ4W6TW4_cjs.isGenericComponent(component) ? value : String(value);
|
|
737
737
|
}
|
|
738
738
|
function writeComponentDisabled(input, id, disabled) {
|
|
739
739
|
const component = findComponent(input, id);
|
|
740
|
-
if (component &&
|
|
740
|
+
if (component && chunkXJ4W6TW4_cjs.isGenericComponent(component)) {
|
|
741
741
|
component.disabled = disabled;
|
|
742
742
|
}
|
|
743
743
|
}
|
|
744
744
|
function isComponentDisabled(input, id) {
|
|
745
745
|
const component = findComponent(input, id);
|
|
746
|
-
return component !== void 0 &&
|
|
746
|
+
return component !== void 0 && chunkXJ4W6TW4_cjs.isGenericComponent(component) && component.disabled;
|
|
747
747
|
}
|
|
748
748
|
function setShape(input, path, change) {
|
|
749
749
|
const shape = input.shapes.find((candidate) => candidate.id === path[0]);
|
|
@@ -792,7 +792,7 @@ function applyShader(input, binding, value) {
|
|
|
792
792
|
|
|
793
793
|
// src/binding/runtimeState.ts
|
|
794
794
|
function initialValue(input, id, componentType) {
|
|
795
|
-
const descriptor =
|
|
795
|
+
const descriptor = chunkXJ4W6TW4_cjs.getComponentDescriptor(componentType);
|
|
796
796
|
const current = findComponent(input, id)?.value;
|
|
797
797
|
if (current === void 0) {
|
|
798
798
|
return descriptor?.value?.default ?? 0;
|
|
@@ -804,8 +804,8 @@ function initialValue(input, id, componentType) {
|
|
|
804
804
|
return current;
|
|
805
805
|
}
|
|
806
806
|
function createRuntimeState(sfl, options) {
|
|
807
|
-
const graph = buildBindingGraph(
|
|
808
|
-
const input = structuredClone(
|
|
807
|
+
const graph = buildBindingGraph(chunkXJ4W6TW4_cjs.parseSource(sfl));
|
|
808
|
+
const input = structuredClone(chunkWQRT5PVT_cjs.sflToRenderInput(sfl));
|
|
809
809
|
const elementState = /* @__PURE__ */ new Map();
|
|
810
810
|
for (const [name, info] of graph.elements) {
|
|
811
811
|
if (!graph.contracts.has(name)) {
|
|
@@ -865,7 +865,7 @@ function applyComponentValue(state, binding, value) {
|
|
|
865
865
|
element.value = value;
|
|
866
866
|
markDirty(state, id);
|
|
867
867
|
}
|
|
868
|
-
if (!
|
|
868
|
+
if (!chunkXJ4W6TW4_cjs.isBuiltInComponentType(state.graph.elements.get(id)?.componentType)) {
|
|
869
869
|
return true;
|
|
870
870
|
}
|
|
871
871
|
announce(state, binding.id, { kind: "component", id, value });
|
|
@@ -925,7 +925,7 @@ function flush(state) {
|
|
|
925
925
|
if (!changed) {
|
|
926
926
|
return null;
|
|
927
927
|
}
|
|
928
|
-
const result =
|
|
928
|
+
const result = chunkWQRT5PVT_cjs.renderCanvas(state.input, { ...state.options.renderOptions, linkHitAreas: true });
|
|
929
929
|
for (const listener of [...state.listeners]) {
|
|
930
930
|
listener(result);
|
|
931
931
|
}
|
|
@@ -1000,7 +1000,7 @@ function setElementState(state, id, patch) {
|
|
|
1000
1000
|
// src/binding/userInput.ts
|
|
1001
1001
|
function descriptorOf(state, id) {
|
|
1002
1002
|
const info = state.graph.elements.get(id);
|
|
1003
|
-
return info?.kind === "Component" ?
|
|
1003
|
+
return info?.kind === "Component" ? chunkXJ4W6TW4_cjs.getComponentDescriptor(info.componentType) : void 0;
|
|
1004
1004
|
}
|
|
1005
1005
|
function valueBinding(state, id) {
|
|
1006
1006
|
return state.graph.bindings.find(
|
|
@@ -1176,7 +1176,7 @@ function renderBound(sfl, options = {}) {
|
|
|
1176
1176
|
runtime.registerSource(name, { get: () => rows, subscribe: () => () => void 0 });
|
|
1177
1177
|
}
|
|
1178
1178
|
runtime.flush();
|
|
1179
|
-
return
|
|
1179
|
+
return chunkWQRT5PVT_cjs.renderCanvas(runtime.input, renderOptions);
|
|
1180
1180
|
}
|
|
1181
1181
|
|
|
1182
1182
|
exports.buildBindingGraph = buildBindingGraph;
|
|
@@ -1185,5 +1185,5 @@ exports.createBindingRuntime = createBindingRuntime;
|
|
|
1185
1185
|
exports.createDataSource = createDataSource;
|
|
1186
1186
|
exports.interactiveElements = interactiveElements;
|
|
1187
1187
|
exports.renderBound = renderBound;
|
|
1188
|
-
//# sourceMappingURL=chunk-
|
|
1189
|
-
//# sourceMappingURL=chunk-
|
|
1188
|
+
//# sourceMappingURL=chunk-JIJMZMGY.cjs.map
|
|
1189
|
+
//# sourceMappingURL=chunk-JIJMZMGY.cjs.map
|