@guilhermebkel/scenec 0.1.2 → 0.2.1
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/README.md +34 -31
- package/dist/Adapters/FileReaderAdapter.d.ts +4 -0
- package/dist/Adapters/FileReaderAdapter.js +21 -0
- package/dist/Adapters/FontAdapter.d.ts +5 -0
- package/dist/Adapters/FontAdapter.js +13 -0
- package/dist/Adapters/ResvgAdapter.d.ts +11 -0
- package/dist/Adapters/ResvgAdapter.js +18 -0
- package/dist/Commands/BaseCommand.d.ts +11 -0
- package/dist/Commands/BaseCommand.js +13 -0
- package/dist/Commands/BestCommand.d.ts +11 -0
- package/dist/Commands/BestCommand.js +73 -0
- package/dist/Commands/CatalogCommand.d.ts +6 -0
- package/dist/Commands/CatalogCommand.js +24 -0
- package/dist/Commands/CheckCommand.d.ts +5 -0
- package/dist/Commands/CheckCommand.js +8 -0
- package/dist/Commands/RenderCommand.d.ts +7 -0
- package/dist/Commands/RenderCommand.js +15 -0
- package/dist/Commands/SceneCommand.d.ts +11 -0
- package/dist/Commands/SceneCommand.js +70 -0
- package/dist/Commands/SchemaCommand.d.ts +5 -0
- package/dist/Commands/SchemaCommand.js +12 -0
- package/dist/Data/cities.json +312 -0
- package/dist/Data/europe.json +1 -0
- package/dist/Errors/SceneError.d.ts +4 -0
- package/dist/Errors/SceneError.js +11 -0
- package/dist/Errors/UnsafeSvgError.d.ts +3 -0
- package/dist/Errors/UnsafeSvgError.js +9 -0
- package/dist/Modules/BestModule.d.ts +41 -0
- package/dist/Modules/BestModule.js +159 -0
- package/dist/Modules/CheckModule.d.ts +8 -0
- package/dist/Modules/CheckModule.js +16 -0
- package/dist/Modules/CompilationModule.d.ts +23 -0
- package/dist/Modules/CompilationModule.js +210 -0
- package/dist/Modules/CritiqueModule.d.ts +9 -0
- package/dist/Modules/CritiqueModule.js +98 -0
- package/dist/Modules/MapModule.d.ts +24 -0
- package/dist/Modules/MapModule.js +99 -0
- package/dist/Modules/ParsingModule.d.ts +17 -0
- package/dist/Modules/ParsingModule.js +88 -0
- package/dist/Modules/PlaneModule.d.ts +19 -0
- package/dist/Modules/PlaneModule.js +98 -0
- package/dist/Protocols/AssetProtocol.d.ts +67 -0
- package/dist/Protocols/AssetProtocol.js +109 -0
- package/dist/Protocols/CommandProtocol.d.ts +8 -0
- package/dist/Protocols/CommandProtocol.js +0 -0
- package/dist/Protocols/CompilationProtocol.d.ts +136 -0
- package/dist/Protocols/CompilationProtocol.js +0 -0
- package/dist/Protocols/CritiqueProtocol.d.ts +58 -0
- package/dist/Protocols/CritiqueProtocol.js +14 -0
- package/dist/Protocols/CustomAssetProtocol.d.ts +24 -0
- package/dist/Protocols/CustomAssetProtocol.js +0 -0
- package/dist/Protocols/GroupProtocol.d.ts +17 -0
- package/dist/Protocols/GroupProtocol.js +12 -0
- package/dist/Protocols/KitProtocol.d.ts +32 -0
- package/dist/Protocols/KitProtocol.js +23 -0
- package/dist/Protocols/MapProtocol.d.ts +77 -0
- package/dist/Protocols/MapProtocol.js +4 -0
- package/dist/Protocols/OptionsProtocol.js +0 -0
- package/dist/Protocols/PersonProtocol.d.ts +68 -0
- package/dist/Protocols/PersonProtocol.js +42 -0
- package/dist/Protocols/PlaneProtocol.d.ts +140 -0
- package/dist/Protocols/PlaneProtocol.js +4 -0
- package/dist/{pipeline/index.d.ts → Protocols/ResultProtocol.d.ts} +0 -2
- package/dist/Protocols/ResultProtocol.js +0 -0
- package/dist/Protocols/SceneProtocol.d.ts +824 -0
- package/dist/Protocols/SceneProtocol.js +357 -0
- package/dist/{protocols/theme.d.ts → Protocols/ThemeProtocol.d.ts} +4 -0
- package/dist/Protocols/ThemeProtocol.js +28 -0
- package/dist/Resources/Assets/BackpackAsset.d.ts +10 -0
- package/dist/Resources/Assets/BackpackAsset.js +31 -0
- package/dist/Resources/Assets/BallAsset.d.ts +10 -0
- package/dist/Resources/Assets/BallAsset.js +15 -0
- package/dist/Resources/Assets/BalloonsAsset.d.ts +10 -0
- package/dist/Resources/Assets/BalloonsAsset.js +26 -0
- package/dist/Resources/Assets/BaseAsset.d.ts +17 -0
- package/dist/Resources/Assets/BaseAsset.js +11 -0
- package/dist/Resources/Assets/BeachTowelAsset.d.ts +10 -0
- package/dist/Resources/Assets/BeachTowelAsset.js +14 -0
- package/dist/Resources/Assets/BedAsset.d.ts +12 -0
- package/dist/Resources/Assets/BedAsset.js +25 -0
- package/dist/Resources/Assets/BenchAsset.d.ts +11 -0
- package/dist/Resources/Assets/BenchAsset.js +24 -0
- package/dist/Resources/Assets/BicycleAsset.d.ts +10 -0
- package/dist/Resources/Assets/BicycleAsset.js +18 -0
- package/dist/Resources/Assets/BigPlantAsset.d.ts +10 -0
- package/dist/Resources/Assets/BigPlantAsset.js +26 -0
- package/dist/Resources/Assets/BirdAsset.d.ts +10 -0
- package/dist/Resources/Assets/BirdAsset.js +14 -0
- package/dist/Resources/Assets/BlackboardAsset.d.ts +11 -0
- package/dist/Resources/Assets/BlackboardAsset.js +20 -0
- package/dist/Resources/Assets/BoardAsset.d.ts +12 -0
- package/dist/Resources/Assets/BoardAsset.js +44 -0
- package/dist/Resources/Assets/BoatAsset.d.ts +10 -0
- package/dist/Resources/Assets/BoatAsset.js +15 -0
- package/dist/Resources/Assets/BooksAsset.d.ts +10 -0
- package/dist/Resources/Assets/BooksAsset.js +35 -0
- package/dist/Resources/Assets/BookshelfAsset.d.ts +10 -0
- package/dist/Resources/Assets/BookshelfAsset.js +33 -0
- package/dist/Resources/Assets/BuildingAsset.d.ts +14 -0
- package/dist/Resources/Assets/BuildingAsset.js +34 -0
- package/dist/Resources/Assets/BurgerAsset.d.ts +9 -0
- package/dist/Resources/Assets/BurgerAsset.js +23 -0
- package/dist/Resources/Assets/BushAsset.d.ts +10 -0
- package/dist/Resources/Assets/BushAsset.js +17 -0
- package/dist/Resources/Assets/CabinetAsset.d.ts +14 -0
- package/dist/Resources/Assets/CabinetAsset.js +49 -0
- package/dist/Resources/Assets/CablesAsset.d.ts +10 -0
- package/dist/Resources/Assets/CablesAsset.js +16 -0
- package/dist/Resources/Assets/CakeAsset.d.ts +10 -0
- package/dist/Resources/Assets/CakeAsset.js +29 -0
- package/dist/Resources/Assets/CapAsset.d.ts +10 -0
- package/dist/Resources/Assets/CapAsset.js +18 -0
- package/dist/Resources/Assets/CarAsset.d.ts +10 -0
- package/dist/Resources/Assets/CarAsset.js +29 -0
- package/dist/Resources/Assets/CatAsset.d.ts +10 -0
- package/dist/Resources/Assets/CatAsset.js +17 -0
- package/dist/Resources/Assets/ChairAsset.d.ts +16 -0
- package/dist/Resources/Assets/ChairAsset.js +55 -0
- package/dist/Resources/Assets/ChatBubbleAsset.d.ts +11 -0
- package/dist/Resources/Assets/ChatBubbleAsset.js +18 -0
- package/dist/Resources/Assets/ClockAsset.d.ts +11 -0
- package/dist/Resources/Assets/ClockAsset.js +22 -0
- package/dist/Resources/Assets/CloudAsset.d.ts +10 -0
- package/dist/Resources/Assets/CloudAsset.js +17 -0
- package/dist/Resources/Assets/CoffeeMachineAsset.d.ts +10 -0
- package/dist/Resources/Assets/CoffeeMachineAsset.js +23 -0
- package/dist/Resources/Assets/ConfettiAsset.d.ts +10 -0
- package/dist/Resources/Assets/ConfettiAsset.js +18 -0
- package/dist/Resources/Assets/CounterAsset.d.ts +11 -0
- package/dist/Resources/Assets/CounterAsset.js +29 -0
- package/dist/Resources/Assets/CupAsset.d.ts +10 -0
- package/dist/Resources/Assets/CupAsset.js +17 -0
- package/dist/Resources/Assets/CursorAsset.d.ts +11 -0
- package/dist/Resources/Assets/CursorAsset.js +17 -0
- package/dist/Resources/Assets/CustomAsset.d.ts +25 -0
- package/dist/Resources/Assets/CustomAsset.js +58 -0
- package/dist/Resources/Assets/DeskAsset.d.ts +11 -0
- package/dist/Resources/Assets/DeskAsset.js +40 -0
- package/dist/Resources/Assets/DeskSlabAsset.d.ts +18 -0
- package/dist/Resources/Assets/DeskSlabAsset.js +43 -0
- package/dist/Resources/Assets/DiplomaAsset.d.ts +10 -0
- package/dist/Resources/Assets/DiplomaAsset.js +23 -0
- package/dist/Resources/Assets/DogAsset.d.ts +10 -0
- package/dist/Resources/Assets/DogAsset.js +24 -0
- package/dist/Resources/Assets/DrawerUnitAsset.d.ts +14 -0
- package/dist/Resources/Assets/DrawerUnitAsset.js +35 -0
- package/dist/Resources/Assets/FenceAsset.d.ts +10 -0
- package/dist/Resources/Assets/FenceAsset.js +26 -0
- package/dist/Resources/Assets/FigurineAsset.d.ts +10 -0
- package/dist/Resources/Assets/FigurineAsset.js +24 -0
- package/dist/Resources/Assets/FinishFlagAsset.d.ts +10 -0
- package/dist/Resources/Assets/FinishFlagAsset.js +21 -0
- package/dist/Resources/Assets/FirstAidKitAsset.d.ts +10 -0
- package/dist/Resources/Assets/FirstAidKitAsset.js +19 -0
- package/dist/Resources/Assets/FloorLampAsset.d.ts +10 -0
- package/dist/Resources/Assets/FloorLampAsset.js +22 -0
- package/dist/Resources/Assets/FlowersAsset.d.ts +10 -0
- package/dist/Resources/Assets/FlowersAsset.js +37 -0
- package/dist/Resources/Assets/FrameAsset.d.ts +11 -0
- package/dist/Resources/Assets/FrameAsset.js +24 -0
- package/dist/Resources/Assets/FruitBowlAsset.d.ts +10 -0
- package/dist/Resources/Assets/FruitBowlAsset.js +16 -0
- package/dist/Resources/Assets/GlassShelfAsset.d.ts +17 -0
- package/dist/Resources/Assets/GlassShelfAsset.js +25 -0
- package/dist/Resources/Assets/GlobeAsset.d.ts +10 -0
- package/dist/Resources/Assets/GlobeAsset.js +18 -0
- package/dist/Resources/Assets/HeadphonesAsset.d.ts +10 -0
- package/dist/Resources/Assets/HeadphonesAsset.js +23 -0
- package/dist/Resources/Assets/HouseAsset.d.ts +10 -0
- package/dist/Resources/Assets/HouseAsset.js +58 -0
- package/dist/Resources/Assets/LabAsset.d.ts +10 -0
- package/dist/Resources/Assets/LabAsset.js +52 -0
- package/dist/Resources/Assets/LampAsset.d.ts +10 -0
- package/dist/Resources/Assets/LampAsset.js +16 -0
- package/dist/Resources/Assets/LaptopAsset.d.ts +10 -0
- package/dist/Resources/Assets/LaptopAsset.js +27 -0
- package/dist/Resources/Assets/LaptopOpenAsset.d.ts +10 -0
- package/dist/Resources/Assets/LaptopOpenAsset.js +29 -0
- package/dist/Resources/Assets/LightSwitchAsset.d.ts +11 -0
- package/dist/Resources/Assets/LightSwitchAsset.js +24 -0
- package/dist/Resources/Assets/MonitorAsset.d.ts +10 -0
- package/dist/Resources/Assets/MonitorAsset.js +40 -0
- package/dist/Resources/Assets/MoonAsset.d.ts +10 -0
- package/dist/Resources/Assets/MoonAsset.js +16 -0
- package/dist/Resources/Assets/MountainAsset.d.ts +10 -0
- package/dist/Resources/Assets/MountainAsset.js +15 -0
- package/dist/Resources/Assets/OfficeChairAsset.d.ts +10 -0
- package/dist/Resources/Assets/OfficeChairAsset.js +45 -0
- package/dist/Resources/Assets/PalmAsset.d.ts +10 -0
- package/dist/Resources/Assets/PalmAsset.js +32 -0
- package/dist/Resources/Assets/PaperCupAsset.d.ts +10 -0
- package/dist/Resources/Assets/PaperCupAsset.js +17 -0
- package/dist/Resources/Assets/PendantLampAsset.d.ts +10 -0
- package/dist/Resources/Assets/PendantLampAsset.js +16 -0
- package/dist/Resources/Assets/PennantAsset.d.ts +10 -0
- package/dist/Resources/Assets/PennantAsset.js +15 -0
- package/dist/Resources/Assets/PersonAsset.d.ts +10 -0
- package/dist/Resources/Assets/PersonAsset.js +15 -0
- package/dist/Resources/Assets/PhotoFrameAsset.d.ts +15 -0
- package/dist/Resources/Assets/PhotoFrameAsset.js +68 -0
- package/dist/Resources/Assets/PineAsset.d.ts +10 -0
- package/dist/Resources/Assets/PineAsset.js +21 -0
- package/dist/Resources/Assets/PizzaAsset.d.ts +10 -0
- package/dist/Resources/Assets/PizzaAsset.js +17 -0
- package/dist/Resources/Assets/PlantAsset.d.ts +10 -0
- package/dist/Resources/Assets/PlantAsset.js +17 -0
- package/dist/Resources/Assets/PlasticBagAsset.d.ts +10 -0
- package/dist/Resources/Assets/PlasticBagAsset.js +15 -0
- package/dist/Resources/Assets/PlateAsset.d.ts +10 -0
- package/dist/Resources/Assets/PlateAsset.js +17 -0
- package/dist/Resources/Assets/PodiumAsset.d.ts +11 -0
- package/dist/Resources/Assets/PodiumAsset.js +20 -0
- package/dist/Resources/Assets/RefrigeratorAsset.d.ts +11 -0
- package/dist/Resources/Assets/RefrigeratorAsset.js +21 -0
- package/dist/Resources/Assets/RollingCartAsset.d.ts +11 -0
- package/dist/Resources/Assets/RollingCartAsset.js +34 -0
- package/dist/Resources/Assets/RugAsset.d.ts +10 -0
- package/dist/Resources/Assets/RugAsset.js +19 -0
- package/dist/Resources/Assets/SandcastleAsset.d.ts +10 -0
- package/dist/Resources/Assets/SandcastleAsset.js +30 -0
- package/dist/Resources/Assets/SchoolAsset.d.ts +10 -0
- package/dist/Resources/Assets/SchoolAsset.js +32 -0
- package/dist/Resources/Assets/ShelfWallAsset.d.ts +11 -0
- package/dist/Resources/Assets/ShelfWallAsset.js +23 -0
- package/dist/Resources/Assets/SinkAsset.d.ts +11 -0
- package/dist/Resources/Assets/SinkAsset.js +21 -0
- package/dist/Resources/Assets/SofaAsset.d.ts +16 -0
- package/dist/Resources/Assets/SofaAsset.js +66 -0
- package/dist/Resources/Assets/StageAsset.d.ts +10 -0
- package/dist/Resources/Assets/StageAsset.js +44 -0
- package/dist/Resources/Assets/StarAsset.d.ts +10 -0
- package/dist/Resources/Assets/StarAsset.js +14 -0
- package/dist/Resources/Assets/StarsAsset.d.ts +17 -0
- package/dist/Resources/Assets/StarsAsset.js +55 -0
- package/dist/Resources/Assets/StethoscopeAsset.d.ts +10 -0
- package/dist/Resources/Assets/StethoscopeAsset.js +18 -0
- package/dist/Resources/Assets/StoveAsset.d.ts +11 -0
- package/dist/Resources/Assets/StoveAsset.js +20 -0
- package/dist/Resources/Assets/StreetlightAsset.d.ts +10 -0
- package/dist/Resources/Assets/StreetlightAsset.js +20 -0
- package/dist/Resources/Assets/SuitcaseAsset.d.ts +10 -0
- package/dist/Resources/Assets/SuitcaseAsset.js +42 -0
- package/dist/Resources/Assets/SunAsset.d.ts +10 -0
- package/dist/Resources/Assets/SunAsset.js +22 -0
- package/dist/Resources/Assets/TableAsset.d.ts +15 -0
- package/dist/Resources/Assets/TableAsset.js +21 -0
- package/dist/Resources/Assets/ToggleAsset.d.ts +11 -0
- package/dist/Resources/Assets/ToggleAsset.js +21 -0
- package/dist/Resources/Assets/TrashCanAsset.d.ts +10 -0
- package/dist/Resources/Assets/TrashCanAsset.js +31 -0
- package/dist/Resources/Assets/TreeAsset.d.ts +15 -0
- package/dist/Resources/Assets/TreeAsset.js +48 -0
- package/dist/Resources/Assets/TrophyAsset.d.ts +10 -0
- package/dist/Resources/Assets/TrophyAsset.js +16 -0
- package/dist/Resources/Assets/TumblerAsset.d.ts +10 -0
- package/dist/Resources/Assets/TumblerAsset.js +17 -0
- package/dist/Resources/Assets/TvAsset.d.ts +10 -0
- package/dist/Resources/Assets/TvAsset.js +29 -0
- package/dist/Resources/Assets/TvStandAsset.d.ts +11 -0
- package/dist/Resources/Assets/TvStandAsset.js +34 -0
- package/dist/Resources/Assets/UmbrellaAsset.d.ts +10 -0
- package/dist/Resources/Assets/UmbrellaAsset.js +17 -0
- package/dist/Resources/Assets/UniversityAsset.d.ts +10 -0
- package/dist/Resources/Assets/UniversityAsset.js +22 -0
- package/dist/Resources/Assets/VaseFlowersAsset.d.ts +10 -0
- package/dist/Resources/Assets/VaseFlowersAsset.js +16 -0
- package/dist/Resources/Assets/WaterCoolerAsset.d.ts +11 -0
- package/dist/Resources/Assets/WaterCoolerAsset.js +20 -0
- package/dist/Resources/Assets/WhiteboardAsset.d.ts +10 -0
- package/dist/Resources/Assets/WhiteboardAsset.js +18 -0
- package/dist/Resources/Assets/WindowAsset.d.ts +11 -0
- package/dist/Resources/Assets/WindowAsset.js +32 -0
- package/dist/Resources/Groups/BaseGroup.d.ts +7 -0
- package/dist/Resources/Groups/BaseGroup.js +5 -0
- package/dist/Resources/Groups/CelebrationGroup.d.ts +8 -0
- package/dist/Resources/Groups/CelebrationGroup.js +19 -0
- package/dist/Resources/Groups/ConversationGroup.d.ts +9 -0
- package/dist/Resources/Groups/ConversationGroup.js +17 -0
- package/dist/Resources/Groups/DiningGroup.d.ts +8 -0
- package/dist/Resources/Groups/DiningGroup.js +21 -0
- package/dist/Resources/Groups/MeetingGroup.d.ts +8 -0
- package/dist/Resources/Groups/MeetingGroup.js +22 -0
- package/dist/Resources/Groups/ParkBenchGroup.d.ts +8 -0
- package/dist/Resources/Groups/ParkBenchGroup.js +17 -0
- package/dist/Resources/Groups/ReadingCornerGroup.d.ts +8 -0
- package/dist/Resources/Groups/ReadingCornerGroup.js +17 -0
- package/dist/Resources/Groups/WorkspaceGroup.d.ts +10 -0
- package/dist/Resources/Groups/WorkspaceGroup.js +25 -0
- package/dist/Resources/Kits/BaseKit.d.ts +13 -0
- package/dist/Resources/Kits/BaseKit.js +12 -0
- package/dist/Resources/Kits/ClayKit.d.ts +9 -0
- package/dist/Resources/Kits/ClayKit.js +11 -0
- package/dist/Resources/Kits/DuotoneKit.d.ts +16 -0
- package/dist/Resources/Kits/DuotoneKit.js +18 -0
- package/dist/Resources/Kits/FlatKit.d.ts +5 -0
- package/dist/Resources/Kits/FlatKit.js +8 -0
- package/dist/Resources/Kits/HatchKit.d.ts +15 -0
- package/dist/Resources/Kits/HatchKit.js +12 -0
- package/dist/Resources/Kits/IsometricKit.d.ts +8 -0
- package/dist/Resources/Kits/IsometricKit.js +10 -0
- package/dist/Resources/Kits/OutlineKit.d.ts +15 -0
- package/dist/Resources/Kits/OutlineKit.js +10 -0
- package/dist/Resources/Kits/PaperKit.d.ts +13 -0
- package/dist/Resources/Kits/PaperKit.js +12 -0
- package/dist/Resources/Kits/PosterKit.d.ts +14 -0
- package/dist/Resources/Kits/PosterKit.js +16 -0
- package/dist/Resources/Kits/RisoKit.d.ts +16 -0
- package/dist/Resources/Kits/RisoKit.js +11 -0
- package/dist/Resources/Kits/SketchKit.d.ts +10 -0
- package/dist/Resources/Kits/SketchKit.js +12 -0
- package/dist/Resources/Themes/BaseTheme.d.ts +5 -0
- package/dist/Resources/Themes/BaseTheme.js +5 -0
- package/dist/Resources/Themes/BeachTheme.d.ts +6 -0
- package/dist/Resources/Themes/BeachTheme.js +31 -0
- package/dist/Resources/Themes/FlatAutumnTheme.d.ts +6 -0
- package/dist/Resources/Themes/FlatAutumnTheme.js +29 -0
- package/dist/Resources/Themes/FlatCoolTheme.d.ts +6 -0
- package/dist/Resources/Themes/FlatCoolTheme.js +29 -0
- package/dist/Resources/Themes/NightTheme.d.ts +6 -0
- package/dist/Resources/Themes/NightTheme.js +29 -0
- package/dist/Resources/Themes/WarmCafeTheme.d.ts +6 -0
- package/dist/Resources/Themes/WarmCafeTheme.js +29 -0
- package/dist/Services/AssetService.d.ts +12 -0
- package/dist/Services/AssetService.js +232 -0
- package/dist/Services/BackgroundService.d.ts +41 -0
- package/dist/Services/BackgroundService.js +177 -0
- package/dist/Services/BalanceCritiqueService.d.ts +13 -0
- package/dist/Services/BalanceCritiqueService.js +64 -0
- package/dist/Services/CameraService.d.ts +21 -0
- package/dist/Services/CameraService.js +121 -0
- package/dist/Services/CatalogService.d.ts +30 -0
- package/dist/Services/CatalogService.js +56 -0
- package/dist/Services/ColorCritiqueService.d.ts +42 -0
- package/dist/Services/ColorCritiqueService.js +232 -0
- package/dist/Services/ContextService.d.ts +21 -0
- package/dist/Services/ContextService.js +98 -0
- package/dist/Services/CoverageCritiqueService.d.ts +16 -0
- package/dist/Services/CoverageCritiqueService.js +84 -0
- package/dist/Services/CustomAssetService.d.ts +31 -0
- package/dist/Services/CustomAssetService.js +184 -0
- package/dist/Services/DependencyOrderService.d.ts +12 -0
- package/dist/Services/DependencyOrderService.js +73 -0
- package/dist/Services/DescriptionService.d.ts +10 -0
- package/dist/Services/DescriptionService.js +33 -0
- package/dist/Services/DetailService.d.ts +7 -0
- package/dist/Services/DetailService.js +18 -0
- package/dist/Services/FocusCritiqueService.d.ts +23 -0
- package/dist/Services/FocusCritiqueService.js +166 -0
- package/dist/Services/FramingCheckService.d.ts +15 -0
- package/dist/Services/FramingCheckService.js +93 -0
- package/dist/Services/FramingService.d.ts +31 -0
- package/dist/Services/FramingService.js +108 -0
- package/dist/Services/GazeService.d.ts +6 -0
- package/dist/Services/GazeService.js +45 -0
- package/dist/Services/GroundDetailService.d.ts +50 -0
- package/dist/Services/GroundDetailService.js +115 -0
- package/dist/Services/GroupService.d.ts +17 -0
- package/dist/Services/GroupService.js +152 -0
- package/dist/Services/KitService.d.ts +32 -0
- package/dist/Services/KitService.js +131 -0
- package/dist/Services/LightingService.d.ts +39 -0
- package/dist/Services/LightingService.js +237 -0
- package/dist/Services/MapBaseService.d.ts +24 -0
- package/dist/Services/MapBaseService.js +104 -0
- package/dist/Services/MapLabelService.d.ts +26 -0
- package/dist/Services/MapLabelService.js +185 -0
- package/dist/Services/MapLegService.d.ts +23 -0
- package/dist/Services/MapLegService.js +87 -0
- package/dist/Services/MapPanelService.d.ts +16 -0
- package/dist/Services/MapPanelService.js +89 -0
- package/dist/Services/MapPinService.d.ts +11 -0
- package/dist/Services/MapPinService.js +56 -0
- package/dist/Services/MapProjectionService.d.ts +14 -0
- package/dist/Services/MapProjectionService.js +70 -0
- package/dist/Services/MapRouteService.d.ts +17 -0
- package/dist/Services/MapRouteService.js +79 -0
- package/dist/Services/PaletteService.d.ts +108 -0
- package/dist/Services/PaletteService.js +282 -0
- package/dist/Services/PieceService.d.ts +47 -0
- package/dist/Services/PieceService.js +175 -0
- package/dist/Services/PlacementService.d.ts +60 -0
- package/dist/Services/PlacementService.js +421 -0
- package/dist/Services/PlaneBackgroundService.d.ts +28 -0
- package/dist/Services/PlaneBackgroundService.js +209 -0
- package/dist/Services/PlaneBoxService.d.ts +27 -0
- package/dist/Services/PlaneBoxService.js +209 -0
- package/dist/Services/PlaneDepthService.d.ts +18 -0
- package/dist/Services/PlaneDepthService.js +146 -0
- package/dist/Services/PlaneLabelService.d.ts +13 -0
- package/dist/Services/PlaneLabelService.js +115 -0
- package/dist/Services/PlaneObjectService.d.ts +17 -0
- package/dist/Services/PlaneObjectService.js +147 -0
- package/dist/Services/PlanePathService.d.ts +15 -0
- package/dist/Services/PlanePathService.js +98 -0
- package/dist/Services/PlaneProjectionService.d.ts +20 -0
- package/dist/Services/PlaneProjectionService.js +119 -0
- package/dist/Services/PlaneRoadService.d.ts +13 -0
- package/dist/Services/PlaneRoadService.js +105 -0
- package/dist/Services/PlaneScatterService.d.ts +11 -0
- package/dist/Services/PlaneScatterService.js +48 -0
- package/dist/Services/PlaneSpaceService.d.ts +27 -0
- package/dist/Services/PlaneSpaceService.js +96 -0
- package/dist/Services/PlaneSpriteService.d.ts +29 -0
- package/dist/Services/PlaneSpriteService.js +95 -0
- package/dist/Services/PlaneTitleService.d.ts +17 -0
- package/dist/Services/PlaneTitleService.js +126 -0
- package/dist/Services/PlaneZoneService.d.ts +20 -0
- package/dist/Services/PlaneZoneService.js +121 -0
- package/dist/Services/RasterService.d.ts +10 -0
- package/dist/Services/RasterService.js +85 -0
- package/dist/Services/RidgeService.d.ts +31 -0
- package/dist/Services/RidgeService.js +85 -0
- package/dist/Services/ScaleCritiqueService.d.ts +11 -0
- package/dist/Services/ScaleCritiqueService.js +57 -0
- package/dist/Services/SchemaService.d.ts +3 -0
- package/dist/Services/SchemaService.js +10 -0
- package/dist/Services/SilhouetteCritiqueService.d.ts +32 -0
- package/dist/Services/SilhouetteCritiqueService.js +155 -0
- package/dist/Services/SkyDetailService.d.ts +39 -0
- package/dist/Services/SkyDetailService.js +95 -0
- package/dist/Services/TangentCritiqueService.d.ts +23 -0
- package/dist/Services/TangentCritiqueService.js +136 -0
- package/dist/Services/TextService.d.ts +87 -0
- package/dist/Services/TextService.js +434 -0
- package/dist/Services/ThemeService.d.ts +5 -0
- package/dist/Services/ThemeService.js +18 -0
- package/dist/Services/ThumbnailCritiqueService.d.ts +30 -0
- package/dist/Services/ThumbnailCritiqueService.js +130 -0
- package/dist/Utils/BoxUtil.d.ts +4 -0
- package/dist/Utils/BoxUtil.js +8 -0
- package/dist/Utils/ColorUtil.d.ts +34 -0
- package/dist/Utils/ColorUtil.js +114 -0
- package/dist/Utils/CurveUtil.d.ts +6 -0
- package/dist/Utils/CurveUtil.js +35 -0
- package/dist/Utils/DetailUtil.d.ts +7 -0
- package/dist/Utils/DetailUtil.js +15 -0
- package/dist/Utils/FallbackUtil.d.ts +3 -0
- package/dist/Utils/FallbackUtil.js +8 -0
- package/dist/Utils/FontMetricsUtil.d.ts +7 -0
- package/dist/Utils/FontMetricsUtil.js +694 -0
- package/dist/Utils/FormatUtil.d.ts +4 -0
- package/dist/Utils/FormatUtil.js +9 -0
- package/dist/Utils/IdUtil.d.ts +4 -0
- package/dist/Utils/IdUtil.js +11 -0
- package/dist/Utils/NormalizeUtil.d.ts +4 -0
- package/dist/Utils/NormalizeUtil.js +9 -0
- package/dist/Utils/OklabUtil.d.ts +41 -0
- package/dist/Utils/OklabUtil.js +151 -0
- package/dist/Utils/PersonArmUtil.d.ts +31 -0
- package/dist/Utils/PersonArmUtil.js +132 -0
- package/dist/Utils/PersonHeadUtil.d.ts +31 -0
- package/dist/Utils/PersonHeadUtil.js +156 -0
- package/dist/Utils/PersonOutfitUtil.d.ts +64 -0
- package/dist/Utils/PersonOutfitUtil.js +254 -0
- package/dist/Utils/PersonUtil.d.ts +41 -0
- package/dist/Utils/PersonUtil.js +216 -0
- package/dist/Utils/PixelUtil.d.ts +3 -0
- package/dist/Utils/PixelUtil.js +8 -0
- package/dist/Utils/RecolorUtil.d.ts +40 -0
- package/dist/Utils/RecolorUtil.js +155 -0
- package/dist/Utils/RegistryUtil.d.ts +8 -0
- package/dist/Utils/RegistryUtil.js +19 -0
- package/dist/Utils/RequireUtil.d.ts +3 -0
- package/dist/Utils/RequireUtil.js +11 -0
- package/dist/Utils/SanitizeUtil.d.ts +25 -0
- package/dist/Utils/SanitizeUtil.js +211 -0
- package/dist/Utils/SeedUtil.d.ts +6 -0
- package/dist/Utils/SeedUtil.js +15 -0
- package/dist/Utils/ShapeUtil.d.ts +40 -0
- package/dist/Utils/ShapeUtil.js +73 -0
- package/dist/Utils/SuggestUtil.d.ts +7 -0
- package/dist/Utils/SuggestUtil.js +25 -0
- package/dist/Utils/SvgUtil.d.ts +9 -0
- package/dist/Utils/SvgUtil.js +21 -0
- package/dist/Utils/ThemeUtil.d.ts +4 -0
- package/dist/Utils/ThemeUtil.js +13 -0
- package/dist/Utils/TransportUtil.d.ts +24 -0
- package/dist/Utils/TransportUtil.js +108 -0
- package/dist/Utils/TypesettingUtil.d.ts +17 -0
- package/dist/Utils/TypesettingUtil.js +92 -0
- package/dist/cli.js +52 -96
- package/dist/index.d.ts +10 -6
- package/dist/index.js +14 -2
- package/dist/render.d.ts +10 -5
- package/dist/render.js +26 -3
- package/dist/schema.d.ts +9 -2
- package/dist/schema.js +29 -5
- package/fonts/DMSerifDisplay-Regular.ttf +0 -0
- package/fonts/OFL.txt +2 -0
- package/fonts/PatrickHand-Regular.ttf +0 -0
- package/package.json +3 -2
- package/skills/{scenec → draw-scene}/SKILL.md +17 -20
- package/skills/{scenec/recipes/carrossel.yaml → draw-scene/recipes/carousel.yaml} +1 -1
- package/skills/draw-scene/recipes/conference-keynote.yaml +43 -0
- package/skills/draw-scene/recipes/product-feature.yaml +41 -0
- package/skills/{scenec/recipes/ilustracoes-produto.yaml → draw-scene/recipes/product-illustration.yaml} +2 -1
- package/skills/{scenec → draw-scene}/references/catalog.md +33 -15
- package/skills/{scenec → draw-scene}/references/dsl.md +32 -8
- package/dist/catalog.d.ts +0 -21
- package/dist/catalog.js +0 -35
- package/dist/data/europe.json +0 -1
- package/dist/drawing/assets.d.ts +0 -8
- package/dist/drawing/assets.js +0 -612
- package/dist/drawing/kits.d.ts +0 -7
- package/dist/drawing/kits.js +0 -92
- package/dist/drawing/person.d.ts +0 -18
- package/dist/drawing/person.js +0 -287
- package/dist/drawing/themes.d.ts +0 -4
- package/dist/drawing/themes.js +0 -45
- package/dist/modes/map.d.ts +0 -5
- package/dist/modes/map.js +0 -365
- package/dist/modes/plane.d.ts +0 -5
- package/dist/modes/plane.js +0 -716
- package/dist/pipeline/compile.d.ts +0 -2
- package/dist/pipeline/compile.js +0 -581
- package/dist/pipeline/custom.d.ts +0 -2
- package/dist/pipeline/custom.js +0 -120
- package/dist/pipeline/groups.d.ts +0 -2
- package/dist/pipeline/groups.js +0 -189
- package/dist/pipeline/index.js +0 -7
- package/dist/pipeline/parse.d.ts +0 -10
- package/dist/pipeline/parse.js +0 -80
- package/dist/protocols/options.js +0 -1
- package/dist/protocols/scene.d.ts +0 -299
- package/dist/protocols/scene.js +0 -118
- package/dist/protocols/theme.js +0 -1
- package/dist/render/check.d.ts +0 -6
- package/dist/render/check.js +0 -10
- package/dist/render/critic.d.ts +0 -1
- package/dist/render/critic.js +0 -235
- package/dist/render/files.d.ts +0 -2
- package/dist/render/files.js +0 -16
- package/dist/render/fonts.d.ts +0 -2
- package/dist/render/fonts.js +0 -4
- package/dist/render/png.d.ts +0 -9
- package/dist/render/png.js +0 -13
- package/dist/utils/color.d.ts +0 -5
- package/dist/utils/color.js +0 -35
- package/dist/utils/recolor.d.ts +0 -1
- package/dist/utils/recolor.js +0 -56
- package/dist/utils/sanitize.d.ts +0 -5
- package/dist/utils/sanitize.js +0 -169
- package/dist/utils/suggest.d.ts +0 -1
- package/dist/utils/suggest.js +0 -22
- package/dist/utils/svg.d.ts +0 -2
- package/dist/utils/svg.js +0 -11
- package/skills/scenec/references/fontes.md +0 -8
- /package/dist/{protocols/options.d.ts → Protocols/OptionsProtocol.d.ts} +0 -0
- /package/skills/{scenec/recipes/anuncios-variacoes.yaml → draw-scene/recipes/ad-variations.yaml} +0 -0
- /package/skills/{scenec/recipes/elearning.yaml → draw-scene/recipes/e-learning.yaml} +0 -0
- /package/skills/{scenec/recipes/reels-explicativo.yaml → draw-scene/recipes/explainer-reel.yaml} +0 -0
- /package/skills/{scenec/recipes/historia-ilustrada.yaml → draw-scene/recipes/illustrated-story.yaml} +0 -0
- /package/skills/{scenec/recipes/mapas-jornadas.yaml → draw-scene/recipes/journey-map.yaml} +0 -0
- /package/skills/{scenec/recipes/wrapped-personalizado.yaml → draw-scene/recipes/personalized-wrapped.yaml} +0 -0
package/dist/render/critic.js
DELETED
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
// Diretor de arte: renderiza a cena em baixa resolução e devolve críticas de composição em texto,
|
|
2
|
-
// cada uma com uma sugestão concreta de correção. Roda em CPU (resvg), sem modelo.
|
|
3
|
-
import { Resvg } from "@resvg/resvg-js";
|
|
4
|
-
const R = 320; // largura da renderização de análise
|
|
5
|
-
function srgbToLin(v) { v /= 255; return v <= 0.04045 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4; }
|
|
6
|
-
const LUT = Float32Array.from({ length: 256 }, (_, i) => srgbToLin(i));
|
|
7
|
-
function oklab(r, g, b) {
|
|
8
|
-
const lr = LUT[r], lg = LUT[g], lb = LUT[b];
|
|
9
|
-
const l = Math.cbrt(0.4122214708 * lr + 0.5363325363 * lg + 0.0514459929 * lb);
|
|
10
|
-
const m = Math.cbrt(0.2119034982 * lr + 0.6806995451 * lg + 0.1073969566 * lb);
|
|
11
|
-
const s = Math.cbrt(0.0883024619 * lr + 0.2817188376 * lg + 0.6299787005 * lb);
|
|
12
|
-
return [0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s, 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s, 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s];
|
|
13
|
-
}
|
|
14
|
-
const hex = (r, g, b) => "#" + [r, g, b].map((v) => Math.round(v).toString(16).padStart(2, "0")).join("").toUpperCase();
|
|
15
|
-
const hexToRgb = (h) => [1, 3, 5].map((i) => parseInt(h.slice(i, i + 2), 16));
|
|
16
|
-
export function critique({ W, H, head, bg, scene, objects, theme, scale, textRects, skip = [] }) {
|
|
17
|
-
const f = R / W, Rw = R, Rh = Math.max(1, Math.round(H * f));
|
|
18
|
-
const render = (inner) => {
|
|
19
|
-
const img = new Resvg(`${head}${inner}</svg>`, { fitTo: { mode: "width", value: R }, font: { loadSystemFonts: false } }).render();
|
|
20
|
-
return img.pixels;
|
|
21
|
-
};
|
|
22
|
-
const defs = (bg.match(/<defs>[\s\S]*?<\/defs>/) || [""])[0];
|
|
23
|
-
const N = Rw * Rh;
|
|
24
|
-
const full = render(scene), back = render(bg);
|
|
25
|
-
const lab = (px) => { const L = new Float32Array(N * 3); for (let i = 0; i < N; i++) {
|
|
26
|
-
const o = oklab(px[i * 4], px[i * 4 + 1], px[i * 4 + 2]);
|
|
27
|
-
L[i * 3] = o[0];
|
|
28
|
-
L[i * 3 + 1] = o[1];
|
|
29
|
-
L[i * 3 + 2] = o[2];
|
|
30
|
-
} return L; };
|
|
31
|
-
const FL = lab(full), BL = lab(back);
|
|
32
|
-
const dE = (A, i, B, j) => Math.hypot(A[i * 3] - B[j * 3], A[i * 3 + 1] - B[j * 3 + 1], A[i * 3 + 2] - B[j * 3 + 2]);
|
|
33
|
-
const objs = objects.filter((o) => !o.ignore).sort((a, b) => a.z - b.z);
|
|
34
|
-
for (const o of objs) {
|
|
35
|
-
const px = render(defs + o.body);
|
|
36
|
-
o.alpha = new Uint8Array(N);
|
|
37
|
-
let n = 0, x0 = Rw, x1 = -1, y0 = Rh, y1 = -1;
|
|
38
|
-
for (let i = 0; i < N; i++) {
|
|
39
|
-
const a = px[i * 4 + 3];
|
|
40
|
-
o.alpha[i] = a;
|
|
41
|
-
if (a > 128) {
|
|
42
|
-
n++;
|
|
43
|
-
const x = i % Rw, y = (i / Rw) | 0;
|
|
44
|
-
if (x < x0)
|
|
45
|
-
x0 = x;
|
|
46
|
-
if (x > x1)
|
|
47
|
-
x1 = x;
|
|
48
|
-
if (y < y0)
|
|
49
|
-
y0 = y;
|
|
50
|
-
if (y > y1)
|
|
51
|
-
y1 = y;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
o.area = n;
|
|
55
|
-
o.bb = [x0, y0, x1, y1];
|
|
56
|
-
}
|
|
57
|
-
// dono visível de cada pixel (objeto mais à frente)
|
|
58
|
-
const owner = new Int16Array(N).fill(-1);
|
|
59
|
-
objs.forEach((o, k) => { for (let i = 0; i < N; i++)
|
|
60
|
-
if (o.alpha[i] > 128)
|
|
61
|
-
owner[i] = k; });
|
|
62
|
-
const out = [];
|
|
63
|
-
const pct = (v) => Math.round(v * 100) + "%";
|
|
64
|
-
// 1) ocupação e faixas vazias
|
|
65
|
-
const occ = new Uint8Array(N);
|
|
66
|
-
let objCov = 0;
|
|
67
|
-
for (let i = 0; i < N; i++)
|
|
68
|
-
if (owner[i] >= 0) {
|
|
69
|
-
occ[i] = 1;
|
|
70
|
-
if (objs[owner[i]].kind !== "sky")
|
|
71
|
-
objCov++;
|
|
72
|
-
}
|
|
73
|
-
for (const r of textRects) {
|
|
74
|
-
for (let y = Math.max(0, Math.floor(r.y0 * f)); y < Math.min(Rh, Math.ceil(r.y1 * f)); y++)
|
|
75
|
-
for (let x = Math.max(0, Math.floor(r.x0 * f)); x < Math.min(Rw, Math.ceil(r.x1 * f)); x++)
|
|
76
|
-
occ[y * Rw + x] = 1;
|
|
77
|
-
}
|
|
78
|
-
objCov /= N;
|
|
79
|
-
if (objCov < 0.05 && objs.length) {
|
|
80
|
-
const sug = Math.min(2.5, scale * Math.sqrt(0.08 / Math.max(objCov, 0.01)));
|
|
81
|
-
out.push(`cena vazia: os objetos ocupam só ${pct(objCov)} do quadro; aproxime a câmera (canvas.scale ≈ ${sug.toFixed(2)}) ou use objetos maiores`);
|
|
82
|
-
}
|
|
83
|
-
let run = 0, best = 0, bestEnd = 0;
|
|
84
|
-
for (let y = 0; y < Rh; y++) {
|
|
85
|
-
let c = 0;
|
|
86
|
-
for (let x = 0; x < Rw; x++)
|
|
87
|
-
c += occ[y * Rw + x];
|
|
88
|
-
if (c < Rw * 0.02) {
|
|
89
|
-
run++;
|
|
90
|
-
if (run > best) {
|
|
91
|
-
best = run;
|
|
92
|
-
bestEnd = y;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
else
|
|
96
|
-
run = 0;
|
|
97
|
-
}
|
|
98
|
-
if (best > Rh * 0.3) {
|
|
99
|
-
const a = (bestEnd - best + 1) / Rh, b = (bestEnd + 1) / Rh;
|
|
100
|
-
out.push(`faixa vazia de ${pct(best / Rh)} da altura (de y=${pct(a)} a y=${pct(b)}); suba o grupo principal, aumente a escala ou ocupe a faixa (texto, objeto de parede, elemento de céu)`);
|
|
101
|
-
}
|
|
102
|
-
// 2) equilíbrio de peso visual (o que difere do fundo, ponderado pela diferença de cor)
|
|
103
|
-
let sw = 0, sx = 0;
|
|
104
|
-
const perObj = objs.map(() => 0);
|
|
105
|
-
for (let i = 0; i < N; i++) {
|
|
106
|
-
const w = Math.min(0.3, dE(FL, i, BL, i));
|
|
107
|
-
if (w < 0.02)
|
|
108
|
-
continue;
|
|
109
|
-
sw += w;
|
|
110
|
-
sx += w * (i % Rw);
|
|
111
|
-
if (owner[i] >= 0)
|
|
112
|
-
perObj[owner[i]] += w;
|
|
113
|
-
}
|
|
114
|
-
for (const r of textRects) {
|
|
115
|
-
const a = (r.x1 - r.x0) * (r.y1 - r.y0) * f * f * (r.box ? 0.25 : 0.12);
|
|
116
|
-
sw += a;
|
|
117
|
-
sx += a * ((r.x0 + r.x1) / 2) * f;
|
|
118
|
-
}
|
|
119
|
-
if (sw > 0) {
|
|
120
|
-
const cx = sx / sw / Rw;
|
|
121
|
-
if (Math.abs(cx - 0.5) > 0.15) {
|
|
122
|
-
const left = cx < 0.5;
|
|
123
|
-
const side = objs.map((o, k) => ({ o, w: perObj[k] })).filter(({ o }) => left ? (o.bb[0] + o.bb[2]) / 2 < Rw / 2 : (o.bb[0] + o.bb[2]) / 2 > Rw / 2).sort((a, b) => b.w - a.w)[0];
|
|
124
|
-
out.push(`peso visual pende para a ${left ? "esquerda" : "direita"} (centro de massa em ${pct(cx)} da largura); ` +
|
|
125
|
-
(side ? `aproxime '${side.o.id}' do centro ou ` : "") + `ponha algo do lado ${left ? "direito" : "esquerdo"}`);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
// 3) silhueta que se perde no vizinho ou no fundo
|
|
129
|
-
const tokens = Object.entries(theme).filter(([, v]) => typeof v === "string" && /^#[0-9a-f]{6}$/i.test(v));
|
|
130
|
-
const tokenOf = (rgb) => {
|
|
131
|
-
let bestT = null, bd = 0.03;
|
|
132
|
-
const a = oklab(rgb[0], rgb[1], rgb[2]);
|
|
133
|
-
for (const [k, v] of tokens) {
|
|
134
|
-
const b = oklab(...hexToRgb(v));
|
|
135
|
-
const d = Math.hypot(a[0] - b[0], a[1] - b[1], a[2] - b[2]);
|
|
136
|
-
if (d < bd) {
|
|
137
|
-
bd = d;
|
|
138
|
-
bestT = k;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
return bestT;
|
|
142
|
-
};
|
|
143
|
-
const OFF = [[2, 0], [-2, 0], [0, 2], [0, -2]];
|
|
144
|
-
if (!skip.includes("silhouette"))
|
|
145
|
-
objs.forEach((o, k) => {
|
|
146
|
-
if (o.area < 40 || ["sky", "floor"].includes(o.kind))
|
|
147
|
-
return;
|
|
148
|
-
// contagem por terço vertical do objeto: uma parte inteira sumindo (ex.: pernas no sofá) já é problema
|
|
149
|
-
const T = [0, 0, 0], Lz = [0, 0, 0], NB = [{}, {}, {}], RGB = [[0, 0, 0], [0, 0, 0], [0, 0, 0]];
|
|
150
|
-
const hh = Math.max(1, o.bb[3] - o.bb[1] + 1);
|
|
151
|
-
for (let y = 2; y < Rh - 2; y++)
|
|
152
|
-
for (let x = 2; x < Rw - 2; x++) {
|
|
153
|
-
const i = y * Rw + x;
|
|
154
|
-
if (owner[i] !== k)
|
|
155
|
-
continue;
|
|
156
|
-
for (const [dx, dy] of OFF) {
|
|
157
|
-
const j = (y + dy) * Rw + x + dx;
|
|
158
|
-
if (o.alpha[j] > 25)
|
|
159
|
-
continue;
|
|
160
|
-
const ob = owner[j];
|
|
161
|
-
if (ob > k)
|
|
162
|
-
continue; // o vizinho está na frente: não é borda visível deste objeto
|
|
163
|
-
const t3 = Math.min(2, Math.floor(((y - o.bb[1]) / hh) * 3));
|
|
164
|
-
T[t3]++;
|
|
165
|
-
if (dE(FL, i, FL, j) < 0.06) {
|
|
166
|
-
Lz[t3]++;
|
|
167
|
-
const key = ob >= 0 ? objs[ob].id : "(fundo)";
|
|
168
|
-
NB[t3][key] = (NB[t3][key] || 0) + 1;
|
|
169
|
-
RGB[t3][0] += full[i * 4];
|
|
170
|
-
RGB[t3][1] += full[i * 4 + 1];
|
|
171
|
-
RGB[t3][2] += full[i * 4 + 2];
|
|
172
|
-
}
|
|
173
|
-
break;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
const total = T[0] + T[1] + T[2], lost = Lz[0] + Lz[1] + Lz[2];
|
|
177
|
-
if (total < 24)
|
|
178
|
-
return;
|
|
179
|
-
const t3 = [0, 1, 2].sort((a, b) => Lz[b] / Math.max(1, T[b]) - Lz[a] / Math.max(1, T[a]))[0];
|
|
180
|
-
const partFrac = Lz[t3] / Math.max(1, T[t3]);
|
|
181
|
-
if (!((lost / total >= 0.3 && lost >= 12) || (partFrac >= 0.4 && Lz[t3] >= 10)))
|
|
182
|
-
return;
|
|
183
|
-
const who = Object.entries(NB[t3]).sort((a, b) => b[1] - a[1])[0][0];
|
|
184
|
-
const c = RGB[t3].map((v) => v / Lz[t3]), tk = tokenOf(c);
|
|
185
|
-
const part = ["de cima", "do meio", "de baixo"][t3];
|
|
186
|
-
out.push(`'${o.id}' some contra ${who === "(fundo)" ? "o fundo" : `'${who}'`} na parte ${part} (${pct(partFrac)} desse contorno sem contraste): ` +
|
|
187
|
-
`a cor ${hex(c[0], c[1], c[2])}${tk ? ` (${tk})` : ""} está próxima demais; mude a cor de um dos dois`);
|
|
188
|
-
});
|
|
189
|
-
// 4) tangências: contornos que quase se tocam sem se sobrepor (criam tensão visual)
|
|
190
|
-
const dil = (a) => {
|
|
191
|
-
const m = new Uint8Array(N);
|
|
192
|
-
for (let y = 0; y < Rh; y++)
|
|
193
|
-
for (let x = 0; x < Rw; x++)
|
|
194
|
-
if (a[y * Rw + x] > 128)
|
|
195
|
-
for (let dy = -2; dy <= 2; dy++)
|
|
196
|
-
for (let dx = -2; dx <= 2; dx++) {
|
|
197
|
-
const yy = y + dy, xx = x + dx;
|
|
198
|
-
if (yy >= 0 && yy < Rh && xx >= 0 && xx < Rw)
|
|
199
|
-
m[yy * Rw + xx] = 1;
|
|
200
|
-
}
|
|
201
|
-
return m;
|
|
202
|
-
};
|
|
203
|
-
const cand = objs.filter((o) => o.area >= 30 && o.kind !== "floor");
|
|
204
|
-
for (const o of cand)
|
|
205
|
-
o.dil = dil(o.alpha);
|
|
206
|
-
for (let a = 0; a < cand.length; a++)
|
|
207
|
-
for (let b = a + 1; b < cand.length; b++) {
|
|
208
|
-
const A = cand[a], B = cand[b];
|
|
209
|
-
if (A.related.includes(B.id) || B.related.includes(A.id))
|
|
210
|
-
continue;
|
|
211
|
-
if (A.bb[2] + 3 < B.bb[0] || B.bb[2] + 3 < A.bb[0] || A.bb[3] + 3 < B.bb[1] || B.bb[3] + 3 < A.bb[1])
|
|
212
|
-
continue;
|
|
213
|
-
let near = 0, over = 0;
|
|
214
|
-
for (let i = 0; i < N; i++) {
|
|
215
|
-
if (B.alpha[i] > 128) {
|
|
216
|
-
if (A.alpha[i] > 128)
|
|
217
|
-
over++;
|
|
218
|
-
else if (A.dil[i])
|
|
219
|
-
near++;
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
if (near >= 4 && over <= Math.max(2, 0.01 * Math.min(A.area, B.area)))
|
|
223
|
-
out.push(`'${A.id}' e '${B.id}' quase se encostam (tangência); afaste-os um pouco ou sobreponha de propósito`);
|
|
224
|
-
}
|
|
225
|
-
for (const o of cand) {
|
|
226
|
-
if (o.kind === "sky" && o.area < 30)
|
|
227
|
-
continue;
|
|
228
|
-
const [x0, y0, x1] = o.bb;
|
|
229
|
-
const gaps = [["esquerda", x0], ["direita", Rw - 1 - x1], ["topo", y0]];
|
|
230
|
-
for (const [side, g] of gaps)
|
|
231
|
-
if (g > 0 && g <= 2)
|
|
232
|
-
out.push(`'${o.id}' encosta na borda (${side}); afaste da borda ou deixe cortar de propósito`);
|
|
233
|
-
}
|
|
234
|
-
return out.map((m) => "arte: " + m);
|
|
235
|
-
}
|
package/dist/render/files.d.ts
DELETED
package/dist/render/files.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
export function createFileReader(baseDir) {
|
|
4
|
-
const root = path.resolve(baseDir);
|
|
5
|
-
const resolveInside = (file) => {
|
|
6
|
-
const full = path.resolve(root, file);
|
|
7
|
-
if (path.isAbsolute(file) || (full !== root && !full.startsWith(root + path.sep))) {
|
|
8
|
-
throw new Error(`caminho '${file}' fora da pasta da cena; use um caminho relativo dentro dela`);
|
|
9
|
-
}
|
|
10
|
-
return full;
|
|
11
|
-
};
|
|
12
|
-
return {
|
|
13
|
-
readText: (file) => fs.readFileSync(resolveInside(file), "utf8"),
|
|
14
|
-
readBytes: (file) => new Uint8Array(fs.readFileSync(resolveInside(file))),
|
|
15
|
-
};
|
|
16
|
-
}
|
package/dist/render/fonts.d.ts
DELETED
package/dist/render/fonts.js
DELETED
package/dist/render/png.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { BBox } from "../protocols/options.ts";
|
|
2
|
-
export interface Raster {
|
|
3
|
-
width: number;
|
|
4
|
-
height: number;
|
|
5
|
-
pixels: Uint8Array;
|
|
6
|
-
png: Uint8Array;
|
|
7
|
-
}
|
|
8
|
-
export declare function renderPng(svg: string, width?: number): Raster;
|
|
9
|
-
export declare function measureSvg(svg: string): BBox | null;
|
package/dist/render/png.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Resvg } from "@resvg/resvg-js";
|
|
2
|
-
import { FONT_FAMILY, FONT_FILES } from "./fonts.js";
|
|
3
|
-
export function renderPng(svg, width = 1200) {
|
|
4
|
-
const image = new Resvg(svg, {
|
|
5
|
-
font: { fontFiles: FONT_FILES, loadSystemFonts: false, defaultFontFamily: FONT_FAMILY },
|
|
6
|
-
fitTo: { mode: "width", value: width },
|
|
7
|
-
}).render();
|
|
8
|
-
return { width: image.width, height: image.height, pixels: image.pixels, png: image.asPng() };
|
|
9
|
-
}
|
|
10
|
-
export function measureSvg(svg) {
|
|
11
|
-
const box = new Resvg(svg).getBBox();
|
|
12
|
-
return box ? { x: box.x, y: box.y, width: box.width, height: box.height } : null;
|
|
13
|
-
}
|
package/dist/utils/color.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/** Darkens (k < 0) or lightens (k > 0) a hex color by mixing it with black or white. */
|
|
2
|
-
export declare function sh(hex: string, k: number): string;
|
|
3
|
-
export declare function luminance(hex: string): number;
|
|
4
|
-
/** WCAG contrast ratio between two hex colors. */
|
|
5
|
-
export declare function contrast(a: string, b: string): number;
|
package/dist/utils/color.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
// Color helpers shared by every layer.
|
|
2
|
-
/** Darkens (k < 0) or lightens (k > 0) a hex color by mixing it with black or white. */
|
|
3
|
-
export function sh(hex, k) {
|
|
4
|
-
if (!hex.startsWith("#")) {
|
|
5
|
-
return hex;
|
|
6
|
-
}
|
|
7
|
-
let digits = hex.slice(1);
|
|
8
|
-
if (digits.length === 3) {
|
|
9
|
-
digits = [...digits].map((char) => char + char).join("");
|
|
10
|
-
}
|
|
11
|
-
const channels = [0, 2, 4].map((i) => parseInt(digits.slice(i, i + 2), 16));
|
|
12
|
-
const target = k < 0 ? 0 : 255;
|
|
13
|
-
const amount = Math.abs(k);
|
|
14
|
-
return "#" + channels.map((v) => Math.round(v + (target - v) * amount).toString(16).padStart(2, "0")).join("");
|
|
15
|
-
}
|
|
16
|
-
export function luminance(hex) {
|
|
17
|
-
let digits = hex.replace("#", "");
|
|
18
|
-
if (digits.length === 3) {
|
|
19
|
-
digits = [...digits].map((char) => char + char).join("");
|
|
20
|
-
}
|
|
21
|
-
const pairs = (/^[0-9a-f]{6}$/i.exec(digits)) ? digits.match(/.{2}/g) : null;
|
|
22
|
-
if (!pairs) {
|
|
23
|
-
return 1;
|
|
24
|
-
}
|
|
25
|
-
const [rr = 0, gg = 0, bb = 0] = pairs.map((x) => {
|
|
26
|
-
const c = parseInt(x, 16) / 255;
|
|
27
|
-
return c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4;
|
|
28
|
-
});
|
|
29
|
-
return 0.2126 * rr + 0.7152 * gg + 0.0722 * bb;
|
|
30
|
-
}
|
|
31
|
-
/** WCAG contrast ratio between two hex colors. */
|
|
32
|
-
export function contrast(a, b) {
|
|
33
|
-
const [l1 = 0, l2 = 0] = [luminance(a), luminance(b)].sort((x, y) => y - x);
|
|
34
|
-
return (l1 + 0.05) / (l2 + 0.05);
|
|
35
|
-
}
|
package/dist/utils/recolor.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function makeRecolor(theme: any, strength?: number): (svg: any) => any;
|
package/dist/utils/recolor.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
// Recolore um SVG importado para a paleta do tema, preservando a luminosidade relativa.
|
|
2
|
-
// Cada cor é levada para o swatch do tema de matiz mais próximo; cinzas viram neutros do tema.
|
|
3
|
-
const hex2rgb = (h) => { h = h.replace("#", ""); if (h.length === 3) {
|
|
4
|
-
h = [...h].map((c) => c + c).join("");
|
|
5
|
-
} return [0, 2, 4].map((i) => parseInt(h.slice(i, i + 2), 16) / 255); };
|
|
6
|
-
const lin = (c) => (c <= 0.04045 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4);
|
|
7
|
-
const delin = (c) => (c <= 0.0031308 ? 12.92 * c : 1.055 * c ** (1 / 2.4) - 0.055);
|
|
8
|
-
function rgb2lab([r, g, b]) {
|
|
9
|
-
[r, g, b] = [r, g, b].map(lin);
|
|
10
|
-
const x = (0.4124 * r + 0.3576 * g + 0.1805 * b) / 0.95047, y = 0.2126 * r + 0.7152 * g + 0.0722 * b, z = (0.0193 * r + 0.1192 * g + 0.9505 * b) / 1.08883;
|
|
11
|
-
const f = (t) => (t > 0.008856 ? Math.cbrt(t) : 7.787 * t + 16 / 116);
|
|
12
|
-
return [116 * f(y) - 16, 500 * (f(x) - f(y)), 200 * (f(y) - f(z))];
|
|
13
|
-
}
|
|
14
|
-
function lab2hex([L, a, b]) {
|
|
15
|
-
const fy = (L + 16) / 116, fx = fy + a / 500, fz = fy - b / 200;
|
|
16
|
-
const inv = (t) => (t ** 3 > 0.008856 ? t ** 3 : (t - 16 / 116) / 7.787);
|
|
17
|
-
const [x, y, z] = [inv(fx) * 0.95047, inv(fy), inv(fz) * 1.08883];
|
|
18
|
-
const rgb = [3.2406 * x - 1.5372 * y - 0.4986 * z, -0.9689 * x + 1.8758 * y + 0.0415 * z, 0.0557 * x - 0.204 * y + 1.057 * z];
|
|
19
|
-
return "#" + rgb.map((c) => Math.round(Math.min(1, Math.max(0, delin(c))) * 255).toString(16).padStart(2, "0")).join("");
|
|
20
|
-
}
|
|
21
|
-
const lch = ([L, a, b]) => [L, Math.hypot(a, b), Math.atan2(b, a)];
|
|
22
|
-
export function makeRecolor(theme, strength = 0.75) {
|
|
23
|
-
const swatches = [theme.primary, theme.secondary, theme.accent, ...theme.foliage, theme.trunk, theme.wood, theme.glass]
|
|
24
|
-
.filter((c) => c?.startsWith("#")).map((c) => lch(rgb2lab(hex2rgb(c)))).filter((s) => s[1] > 12);
|
|
25
|
-
const neutral = rgb2lab(hex2rgb(theme.metal));
|
|
26
|
-
const cache = new Map();
|
|
27
|
-
const map = (hex) => {
|
|
28
|
-
if (cache.has(hex)) {
|
|
29
|
-
return cache.get(hex);
|
|
30
|
-
}
|
|
31
|
-
const lab = rgb2lab(hex2rgb(hex));
|
|
32
|
-
const [L, C, H] = lch(lab);
|
|
33
|
-
let out;
|
|
34
|
-
if (C < 10) { // cinza: puxa levemente para o neutro do tema
|
|
35
|
-
out = lab2hex([L, lab[1] * (1 - strength) + neutral[1] * strength * 0.5, lab[2] * (1 - strength) + neutral[2] * strength * 0.5]);
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
let best = swatches[0], bd = Infinity;
|
|
39
|
-
for (const s of swatches) {
|
|
40
|
-
const dh = Math.abs(Math.atan2(Math.sin(H - s[2]), Math.cos(H - s[2])));
|
|
41
|
-
const d = dh * 2 + Math.abs(C - s[1]) / 60;
|
|
42
|
-
if (d < bd) {
|
|
43
|
-
bd = d;
|
|
44
|
-
best = s;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
const nH = Math.atan2(Math.sin(H) * (1 - strength) + Math.sin(best[2]) * strength, Math.cos(H) * (1 - strength) + Math.cos(best[2]) * strength);
|
|
48
|
-
const nC = C * (1 - strength) + Math.min(C, best[1]) * strength;
|
|
49
|
-
const nL = L * (1 - strength * 0.4) + best[0] * strength * 0.4;
|
|
50
|
-
out = lab2hex([nL, nC * Math.cos(nH), nC * Math.sin(nH)]);
|
|
51
|
-
}
|
|
52
|
-
cache.set(hex, out);
|
|
53
|
-
return out;
|
|
54
|
-
};
|
|
55
|
-
return (svg) => svg.replace(/(fill|stroke|stop-color)="(#[0-9a-fA-F]{3,6})"/g, (_, attr, c) => `${attr}="${map(c)}"`);
|
|
56
|
-
}
|
package/dist/utils/sanitize.d.ts
DELETED
package/dist/utils/sanitize.js
DELETED
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
const ALLOWED_ELEMENTS = new Set([
|
|
2
|
-
"svg", "g", "defs", "title", "desc", "path", "rect", "circle", "ellipse", "line", "polyline", "polygon", "text", "tspan",
|
|
3
|
-
"linearGradient", "radialGradient", "stop", "clipPath", "mask", "pattern", "symbol", "use", "image", "filter",
|
|
4
|
-
"feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDropShadow", "feFlood",
|
|
5
|
-
"feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feMerge", "feMergeNode", "feMorphology", "feOffset",
|
|
6
|
-
"feTurbulence",
|
|
7
|
-
]);
|
|
8
|
-
export function isAllowedElement(name) {
|
|
9
|
-
return ALLOWED_ELEMENTS.has(name);
|
|
10
|
-
}
|
|
11
|
-
const LINK_ATTRIBUTES = new Set(["href", "xlink:href"]);
|
|
12
|
-
const SAFE_LINK = /^(#|data:image\/(png|jpeg|jpg|webp|gif);base64,)/;
|
|
13
|
-
const EXTERNAL_URL = /url\(\s*['"]?\s*(?!#)/i;
|
|
14
|
-
const STANDARD_ENTITY = /&(?!(?:lt|gt|amp|quot|apos|#\d+|#x[0-9a-f]+);)/i;
|
|
15
|
-
const NAME_END = /[\s/>]/;
|
|
16
|
-
export class UnsafeSvgError extends Error {
|
|
17
|
-
constructor(reason) {
|
|
18
|
-
super(reason);
|
|
19
|
-
this.name = "UnsafeSvgError";
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
function skipPast(source, from, terminator) {
|
|
23
|
-
const at = source.indexOf(terminator, from);
|
|
24
|
-
return at < 0 ? source.length : at + terminator.length;
|
|
25
|
-
}
|
|
26
|
-
function skipDoctype(source, from) {
|
|
27
|
-
const end = source.indexOf(">", from);
|
|
28
|
-
const bracket = source.indexOf("[", from);
|
|
29
|
-
const hasSubset = bracket >= 0 && (end < 0 || bracket < end);
|
|
30
|
-
return hasSubset ? skipPast(source, skipPast(source, from, "]"), ">") : skipPast(source, from, ">");
|
|
31
|
-
}
|
|
32
|
-
function readAttributeValue(source, from) {
|
|
33
|
-
const quote = source[from];
|
|
34
|
-
if (quote === "\"" || quote === "'") {
|
|
35
|
-
const close = source.indexOf(quote, from + 1);
|
|
36
|
-
const end = close < 0 ? source.length : close;
|
|
37
|
-
return { value: source.slice(from + 1, end), end: end + 1 };
|
|
38
|
-
}
|
|
39
|
-
let end = from;
|
|
40
|
-
while (end < source.length && !/[\s>]/.test(source[end] ?? "") && !(source[end] === "/" && source[end + 1] === ">")) {
|
|
41
|
-
end++;
|
|
42
|
-
}
|
|
43
|
-
return { value: source.slice(from, end), end };
|
|
44
|
-
}
|
|
45
|
-
function readTag(source, from) {
|
|
46
|
-
const isClosing = source[from + 1] === "/";
|
|
47
|
-
let cursor = from + (isClosing ? 2 : 1);
|
|
48
|
-
const nameStart = cursor;
|
|
49
|
-
while (cursor < source.length && !NAME_END.test(source[cursor] ?? "")) {
|
|
50
|
-
cursor++;
|
|
51
|
-
}
|
|
52
|
-
const name = source.slice(nameStart, cursor);
|
|
53
|
-
const attributes = [];
|
|
54
|
-
let isSelfClosing = false;
|
|
55
|
-
while (cursor < source.length && source[cursor] !== ">") {
|
|
56
|
-
if (source[cursor] === "/" && source[cursor + 1] === ">") {
|
|
57
|
-
isSelfClosing = true;
|
|
58
|
-
cursor++;
|
|
59
|
-
}
|
|
60
|
-
else if (/\s/.test(source[cursor] ?? "")) {
|
|
61
|
-
cursor++;
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
const attributeStart = cursor;
|
|
65
|
-
while (cursor < source.length && !/[\s=>]/.test(source[cursor] ?? "") && !(source[cursor] === "/" && source[cursor + 1] === ">")) {
|
|
66
|
-
cursor++;
|
|
67
|
-
}
|
|
68
|
-
const attributeName = source.slice(attributeStart, cursor);
|
|
69
|
-
while (/\s/.test(source[cursor] ?? "")) {
|
|
70
|
-
cursor++;
|
|
71
|
-
}
|
|
72
|
-
let value = "";
|
|
73
|
-
if (source[cursor] === "=") {
|
|
74
|
-
while (/[\s=]/.test(source[cursor] ?? "")) {
|
|
75
|
-
cursor++;
|
|
76
|
-
}
|
|
77
|
-
const read = readAttributeValue(source, cursor);
|
|
78
|
-
value = read.value;
|
|
79
|
-
cursor = read.end;
|
|
80
|
-
}
|
|
81
|
-
attributes.push([attributeName, value]);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return { name, attributes, isClosing, isSelfClosing, end: cursor + 1 };
|
|
85
|
-
}
|
|
86
|
-
function isSafeAttribute(name, value) {
|
|
87
|
-
const lower = name.toLowerCase();
|
|
88
|
-
if (lower.startsWith("on") || STANDARD_ENTITY.test(value)) {
|
|
89
|
-
return false;
|
|
90
|
-
}
|
|
91
|
-
if (LINK_ATTRIBUTES.has(lower)) {
|
|
92
|
-
return SAFE_LINK.test(value.trim());
|
|
93
|
-
}
|
|
94
|
-
return !EXTERNAL_URL.test(value) && !/javascript:/i.test(value);
|
|
95
|
-
}
|
|
96
|
-
function escapeAttribute(value) {
|
|
97
|
-
return value.replace(/"/g, """);
|
|
98
|
-
}
|
|
99
|
-
function openTag(tag) {
|
|
100
|
-
const attributes = tag.attributes
|
|
101
|
-
.filter(([name, value]) => isSafeAttribute(name, value))
|
|
102
|
-
.map(([name, value]) => ` ${name}="${escapeAttribute(value)}"`)
|
|
103
|
-
.join("");
|
|
104
|
-
return `<${tag.name}${attributes}${tag.isSelfClosing ? "/" : ""}>`;
|
|
105
|
-
}
|
|
106
|
-
export function sanitizeSvg(source) {
|
|
107
|
-
if (/<!ENTITY/i.test(source)) {
|
|
108
|
-
throw new UnsafeSvgError("declarações <!ENTITY> não são permitidas em SVG importado");
|
|
109
|
-
}
|
|
110
|
-
const output = [];
|
|
111
|
-
const openElements = [];
|
|
112
|
-
let skippedDepth = 0;
|
|
113
|
-
let cursor = 0;
|
|
114
|
-
while (cursor < source.length) {
|
|
115
|
-
const next = source.indexOf("<", cursor);
|
|
116
|
-
const textEnd = next < 0 ? source.length : next;
|
|
117
|
-
if (skippedDepth === 0) {
|
|
118
|
-
output.push(source.slice(cursor, textEnd));
|
|
119
|
-
}
|
|
120
|
-
if (next < 0) {
|
|
121
|
-
break;
|
|
122
|
-
}
|
|
123
|
-
if (source.startsWith("<!--", next)) {
|
|
124
|
-
cursor = skipPast(source, next, "-->");
|
|
125
|
-
}
|
|
126
|
-
else if (source.startsWith("<![CDATA[", next)) {
|
|
127
|
-
const end = skipPast(source, next, "]]>");
|
|
128
|
-
const text = source.slice(next + "<![CDATA[".length, end - "]]>".length);
|
|
129
|
-
output.push(skippedDepth === 0 ? text.replace(/&/g, "&").replace(/</g, "<") : "");
|
|
130
|
-
cursor = end;
|
|
131
|
-
}
|
|
132
|
-
else if (source.startsWith("<?", next)) {
|
|
133
|
-
cursor = skipPast(source, next, "?>");
|
|
134
|
-
}
|
|
135
|
-
else if (source.startsWith("<!", next)) {
|
|
136
|
-
cursor = skipDoctype(source, next);
|
|
137
|
-
}
|
|
138
|
-
else {
|
|
139
|
-
const tag = readTag(source, next);
|
|
140
|
-
cursor = tag.end;
|
|
141
|
-
if (tag.isClosing) {
|
|
142
|
-
const closed = openElements.pop();
|
|
143
|
-
if (closed && !closed.isAllowed) {
|
|
144
|
-
skippedDepth--;
|
|
145
|
-
}
|
|
146
|
-
else if (closed && skippedDepth === 0) {
|
|
147
|
-
output.push(`</${closed.name}>`);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
else if (skippedDepth > 0) {
|
|
151
|
-
skippedDepth += tag.isSelfClosing ? 0 : 1;
|
|
152
|
-
if (!tag.isSelfClosing) {
|
|
153
|
-
openElements.push({ name: tag.name, isAllowed: false });
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
else if (ALLOWED_ELEMENTS.has(tag.name)) {
|
|
157
|
-
output.push(openTag(tag));
|
|
158
|
-
if (!tag.isSelfClosing) {
|
|
159
|
-
openElements.push({ name: tag.name, isAllowed: true });
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
else if (!tag.isSelfClosing) {
|
|
163
|
-
skippedDepth = 1;
|
|
164
|
-
openElements.push({ name: tag.name, isAllowed: false });
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
return output.join("");
|
|
169
|
-
}
|
package/dist/utils/suggest.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function closest(name: string, candidates: readonly string[], limit?: number): string[];
|
package/dist/utils/suggest.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
function distance(a, b) {
|
|
2
|
-
const rows = Array.from({ length: a.length + 1 }, (_, i) => [i]);
|
|
3
|
-
for (let j = 1; j <= b.length; j++) {
|
|
4
|
-
rows[0][j] = j;
|
|
5
|
-
}
|
|
6
|
-
for (let i = 1; i <= a.length; i++) {
|
|
7
|
-
for (let j = 1; j <= b.length; j++) {
|
|
8
|
-
rows[i][j] = Math.min(rows[i - 1][j] + 1, rows[i][j - 1] + 1, rows[i - 1][j - 1] + (a[i - 1] === b[j - 1] ? 0 : 1));
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
return rows[a.length][b.length];
|
|
12
|
-
}
|
|
13
|
-
export function closest(name, candidates, limit = 3) {
|
|
14
|
-
const lower = name.toLowerCase();
|
|
15
|
-
const maxDistance = Math.max(2, Math.ceil(lower.length / 3));
|
|
16
|
-
return candidates
|
|
17
|
-
.map((candidate) => ({ candidate, score: distance(lower, candidate.toLowerCase()) }))
|
|
18
|
-
.filter(({ score }) => score <= maxDistance)
|
|
19
|
-
.sort((a, b) => a.score - b.score)
|
|
20
|
-
.slice(0, limit)
|
|
21
|
-
.map(({ candidate }) => candidate);
|
|
22
|
-
}
|
package/dist/utils/svg.d.ts
DELETED
package/dist/utils/svg.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
const SHAPE_OP = /<(rect|path|circle|ellipse|polygon|polyline|line)\b([^>]*?)\sopacity="([\d.]+)"([^>]*?)\/>/g;
|
|
2
|
-
const TEXT_OP = /<text\b([^>]*?)\sopacity="([\d.]+)"([^>]*)>/g;
|
|
3
|
-
export function flattenOpacity(svg) {
|
|
4
|
-
const withText = svg.replace(TEXT_OP, (match, before, opacity, after) => (before + after).includes("fill-opacity") ? match : `<text${before} fill-opacity="${opacity}"${after}>`);
|
|
5
|
-
return withText.replace(SHAPE_OP, (match, tag, before, opacity, after) => /fill-opacity|stroke-opacity/.test(before + after)
|
|
6
|
-
? match
|
|
7
|
-
: `<${tag}${before} fill-opacity="${opacity}" stroke-opacity="${opacity}"${after}/>`);
|
|
8
|
-
}
|
|
9
|
-
export function escapeXml(text) {
|
|
10
|
-
return text.replace(/&/g, "&").replace(/</g, "<");
|
|
11
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
Consultadas em outubro de 2026
|
|
2
|
-
|
|
3
|
-
- [Natural Earth](https://www.naturalearthdata.com/): contornos dos países da Europa (escala 1:50m) usados no modo mapa, extraídos uma vez para src/data/europe.json; domínio público.
|
|
4
|
-
- [Poppins](https://github.com/itfoundry/Poppins): fonte usada nos textos e no renderizador; licença OFL-1.1.
|
|
5
|
-
- [resvg-js](https://github.com/yisibl/resvg-js): renderização de SVG para PNG e medição de caixas; licença MPL-2.0 (dependência sem modificação).
|
|
6
|
-
- [Vercel Skills CLI](https://github.com/vercel-labs/skills): formato de pasta skills/ e instalação via npx skills add.
|
|
7
|
-
- [npm: trusted publishing](https://docs.npmjs.com/trusted-publishers): publicação por OIDC sem token, citada no ADR 0009.
|
|
8
|
-
- [harness-ledger](https://github.com/guilhermebkel/harness-ledger): modelos de harness (lint, regras locais, knip, jscpd, AGENTS.md, ADRs); licença MIT, do mesmo autor.
|
|
File without changes
|
/package/skills/{scenec/recipes/anuncios-variacoes.yaml → draw-scene/recipes/ad-variations.yaml}
RENAMED
|
File without changes
|
|
File without changes
|
/package/skills/{scenec/recipes/reels-explicativo.yaml → draw-scene/recipes/explainer-reel.yaml}
RENAMED
|
File without changes
|
/package/skills/{scenec/recipes/historia-ilustrada.yaml → draw-scene/recipes/illustrated-story.yaml}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|