| 
									
										
										
										
											2023-03-25 02:48:24 +01:00
										 |  |  | import LayoutConfig from "./Models/ThemeConfig/LayoutConfig" | 
					
						
							| 
									
										
										
										
											2023-05-30 02:52:22 +02:00
										 |  |  | import * as theme from "./assets/generated/themes/bookcases.json" | 
					
						
							| 
									
										
										
										
											2023-03-29 17:21:20 +02:00
										 |  |  | import ThemeViewState from "./Models/ThemeViewState" | 
					
						
							|  |  |  | import Combine from "./UI/Base/Combine" | 
					
						
							|  |  |  | import SpecialVisualizations from "./UI/SpecialVisualizations" | 
					
						
							| 
									
										
										
										
											2023-05-30 02:52:22 +02:00
										 |  |  | import {VariableUiElement} from "./UI/Base/VariableUIElement" | 
					
						
							| 
									
										
										
										
											2023-04-20 01:52:23 +02:00
										 |  |  | import SvelteUIElement from "./UI/Base/SvelteUIElement" | 
					
						
							| 
									
										
										
										
											2023-05-30 02:52:22 +02:00
										 |  |  | import {SvgToPdf} from "./Utils/svgToPdf" | 
					
						
							|  |  |  | import {Utils} from "./Utils" | 
					
						
							|  |  |  | import {PointImportFlowState} from "./UI/Popup/ImportButtons/PointImportFlowState"; | 
					
						
							|  |  |  | import PointImportFlow from "./UI/Popup/ImportButtons/PointImportFlow.svelte"; | 
					
						
							|  |  |  | import {Feature, Point} from "geojson"; | 
					
						
							| 
									
										
										
										
											2023-03-26 05:58:28 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-04-14 17:53:08 +02:00
										 |  |  | function testspecial() { | 
					
						
							| 
									
										
										
										
											2023-04-02 02:59:20 +02:00
										 |  |  |     const layout = new LayoutConfig(<any>theme, true) // qp.data === "" ?  : new AllKnownLayoutsLazy().get(qp.data)
 | 
					
						
							| 
									
										
										
										
											2023-03-29 17:21:20 +02:00
										 |  |  |     const state = new ThemeViewState(layout) | 
					
						
							| 
									
										
										
										
											2023-04-07 02:13:57 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-03-29 17:21:20 +02:00
										 |  |  |     const all = SpecialVisualizations.specialVisualizations.map((s) => | 
					
						
							|  |  |  |         SpecialVisualizations.renderExampleOfSpecial(state, s) | 
					
						
							|  |  |  |     ) | 
					
						
							|  |  |  |     new Combine(all).AttachTo("maindiv") | 
					
						
							| 
									
										
										
										
											2023-03-28 05:13:48 +02:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2023-04-06 01:33:08 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-04-20 01:52:23 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-05-05 02:03:41 +02:00
										 |  |  | async function testPdf() { | 
					
						
							|  |  |  |     const svgs = await Promise.all( | 
					
						
							|  |  |  |         SvgToPdf.templates["flyer_a4"].pages.map((url) => Utils.download(url)) | 
					
						
							|  |  |  |     ) | 
					
						
							|  |  |  |     console.log("Building svg") | 
					
						
							|  |  |  |     const pdf = new SvgToPdf("Test", svgs, {}) | 
					
						
							|  |  |  |     new VariableUiElement(pdf.status).AttachTo("maindiv") | 
					
						
							|  |  |  |     await pdf.ConvertSvg("nl") | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-05-30 02:52:22 +02:00
										 |  |  | function testImportButton() { | 
					
						
							|  |  |  |     const layout = new LayoutConfig(<any>theme, true) // qp.data === "" ?  : new AllKnownLayoutsLazy().get(qp.data)
 | 
					
						
							|  |  |  |     const state = new ThemeViewState(layout) | 
					
						
							|  |  |  |     const originalFeature: Feature<Point> = { | 
					
						
							|  |  |  |         type: "Feature", | 
					
						
							|  |  |  |         properties: { | 
					
						
							|  |  |  |             id: "note/-1" | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |         geometry: { | 
					
						
							|  |  |  |             type: "Point", | 
					
						
							|  |  |  |             coordinates: [3.2255, 51.2112] | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     const importFlow = new PointImportFlowState(state, originalFeature, { | 
					
						
							|  |  |  |         text: "Import this point", | 
					
						
							|  |  |  |         newTags: undefined, | 
					
						
							|  |  |  |         targetLayer: "public_bookcase" | 
					
						
							|  |  |  |     }, tagsToApply) | 
					
						
							|  |  |  |     new SvelteUIElement(PointImportFlow, { | 
					
						
							|  |  |  |         importFlow | 
					
						
							|  |  |  |     }).SetClass("h-full").AttachTo("maindiv") | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | testImportButton() | 
					
						
							| 
									
										
										
										
											2023-05-16 03:27:49 +02:00
										 |  |  | // testPdf().then((_) => console.log("All done"))
 | 
					
						
							| 
									
										
										
										
											2023-04-24 03:36:02 +02:00
										 |  |  | /*/ | 
					
						
							|  |  |  | testspecial() | 
					
						
							|  |  |  | //*/
 |