@visuallyjs/browser-ui-svelte 1.2.2 → 1.2.4
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.
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {useSurface} from "./use-surface.svelte";
|
|
3
3
|
import { BackgroundPlugin, SimpleBackground } from "@visuallyjs/browser-ui"
|
|
4
4
|
import {usePaper} from "./use-paper.svelte";
|
|
5
|
-
import {ImageBackgroundComponentProps} from "./definitions";
|
|
5
|
+
import {type ImageBackgroundComponentProps} from "./definitions";
|
|
6
6
|
|
|
7
7
|
let initialized = false
|
|
8
8
|
const surface = useSurface()
|
package/PaperComponent.svelte
CHANGED
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
model,
|
|
48
48
|
data,
|
|
49
49
|
url,
|
|
50
|
+
dataType,
|
|
50
51
|
shapeLibrary,
|
|
51
52
|
injector,
|
|
52
53
|
children
|
|
@@ -336,11 +337,13 @@
|
|
|
336
337
|
_updateOverlayState()
|
|
337
338
|
})
|
|
338
339
|
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
340
|
+
$effect(() => {
|
|
341
|
+
if (url != null && model != null) {
|
|
342
|
+
model.load({ url, dataType });
|
|
343
|
+
} else if (data != null && model != null) {
|
|
344
|
+
model.load({ data, dataType });
|
|
345
|
+
}
|
|
346
|
+
})
|
|
344
347
|
});
|
|
345
348
|
|
|
346
349
|
</script>
|
package/SurfaceComponent.svelte
CHANGED
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
model,
|
|
48
48
|
data,
|
|
49
49
|
url,
|
|
50
|
+
dataType,
|
|
50
51
|
shapeLibrary,
|
|
51
52
|
injector,
|
|
52
53
|
children
|
|
@@ -337,11 +338,13 @@
|
|
|
337
338
|
})
|
|
338
339
|
|
|
339
340
|
// TODO how can this be made reactive
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
341
|
+
$effect(() => {
|
|
342
|
+
if (url != null && model != null) {
|
|
343
|
+
model.load({ url, dataType });
|
|
344
|
+
} else if (data != null && model != null) {
|
|
345
|
+
model.load({ data, dataType });
|
|
346
|
+
}
|
|
347
|
+
})
|
|
345
348
|
});
|
|
346
349
|
|
|
347
350
|
</script>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {useSurface} from "./use-surface.svelte";
|
|
3
3
|
import { BackgroundPlugin, TiledBackground } from "@visuallyjs/browser-ui"
|
|
4
4
|
import {usePaper} from "./use-paper.svelte";
|
|
5
|
-
import {TiledImageBackgroundComponentProps} from "./definitions";
|
|
5
|
+
import {type TiledImageBackgroundComponentProps} from "./definitions";
|
|
6
6
|
|
|
7
7
|
let initialized = false
|
|
8
8
|
const surface = useSurface()
|
package/definitions.d.ts
CHANGED
|
@@ -129,6 +129,10 @@ export interface SurfaceComponentProps extends DOMAttributes<HTMLDivElement> {
|
|
|
129
129
|
* Optional url from which to load data after the component has been mounted. If you provide this and also data, this will take precedence.
|
|
130
130
|
*/
|
|
131
131
|
url?: string;
|
|
132
|
+
/**
|
|
133
|
+
* ID of the format that `data` or the data retrieved from `url` is expected to be in. Defaults to `JSON_DATATYPE`.
|
|
134
|
+
*/
|
|
135
|
+
dataType?: string;
|
|
132
136
|
/**
|
|
133
137
|
* Shape library to use to render SVG shapes. Optional.
|
|
134
138
|
*/
|
|
@@ -179,6 +183,10 @@ export interface PaperComponentProps extends DOMAttributes<HTMLDivElement> {
|
|
|
179
183
|
* Optional url from which to load data after the component has been mounted. If you provide this and also data, this will take precedence.
|
|
180
184
|
*/
|
|
181
185
|
url?: string;
|
|
186
|
+
/**
|
|
187
|
+
* ID of the format that `data` or the data retrieved from `url` is expected to be in. Defaults to `JSON_DATATYPE`.
|
|
188
|
+
*/
|
|
189
|
+
dataType?: string;
|
|
182
190
|
/**
|
|
183
191
|
* Shape library to use to render SVG shapes. Optional.
|
|
184
192
|
*/
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@visuallyjs/browser-ui-svelte","version":"1.2.
|
|
1
|
+
{"name":"@visuallyjs/browser-ui-svelte","version":"1.2.4","description":"VisuallyJS Svelte integration for Browser UI renderer","module":"index.js","main":"index.js","types":"index.d.ts","svelte":"index.js","files":["**/*.d.ts","**/*.js","SurfaceComponent.svelte","PaperComponent.svelte","DecoratorComponent.svelte","DefaultGroupComponent.svelte","DefaultNodeComponent.svelte","MiniviewComponent.svelte","ControlsComponent.svelte","SurfaceProvider.svelte","PaperProvider.svelte","PaletteComponent.svelte","InspectorComponent.svelte","EdgeTypePickerComponent.svelte","ShapePaletteComponent.svelte","ExportControlsComponent.svelte","ShapeComponent.svelte","DiagramComponent.svelte","BarChartComponent.svelte","ColumnChartComponent.svelte","XYChartComponent.svelte","LineChartComponent.svelte","AreaChartComponent.svelte","PieChartComponent.svelte","WrapperComponent.svelte","OverlayWrapperComponent.svelte","DiagramProvider.svelte","DiagramPaletteComponent.svelte","ColorPickerComponent.svelte","ScatterChartComponent.svelte","BubbleChartComponent.svelte","GaugeChartComponent.svelte","SankeyChartComponent.svelte","SurfacePopup.svelte","GridBackgroundComponent.svelte","ImageBackgroundComponent.svelte","TiledImageBackgroundComponent.svelte"],"author":"VisuallyJs <hello@visuallyjs.com> (https://visuallyjs.com)","license":"Commercial","dependencies":{"@visuallyjs/browser-ui":"1.2.4"},"homepage":"https://visuallyjs.com/svelte","bugs":"https://github.com/visuallyjs/visuallyjs/issues"}
|