floor-editor-ts 1.0.2 → 1.0.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.
Files changed (54) hide show
  1. package/dist/App.svelte.d.ts +1 -0
  2. package/dist/favicon.svg +1 -0
  3. package/dist/floor-editor-ts.css +2736 -0
  4. package/dist/floor-editor.es.js +70346 -0
  5. package/dist/floor-editor.es.js.map +1 -0
  6. package/dist/icons.svg +24 -0
  7. package/dist/lib/components/OnboardingTooltip.svelte.d.ts +1 -0
  8. package/dist/lib/components/editor/AlignmentToolbar.svelte.d.ts +1 -0
  9. package/dist/lib/components/editor/CommandPalette.svelte.d.ts +1 -0
  10. package/dist/lib/components/editor/ContextMenu.svelte.d.ts +1 -0
  11. package/dist/lib/components/editor/FloorPlanCanvas.svelte.d.ts +1 -0
  12. package/dist/lib/components/editor/PrintLayout.svelte.d.ts +1 -0
  13. package/dist/lib/components/editor/UndoHistoryPanel.svelte.d.ts +1 -0
  14. package/dist/lib/components/sidebar/AreaSummaryPanel.svelte.d.ts +1 -0
  15. package/dist/lib/components/sidebar/BuildPanel.svelte.d.ts +1 -0
  16. package/dist/lib/components/sidebar/LayersPanel.svelte.d.ts +1 -0
  17. package/dist/lib/components/sidebar/PropertiesPanel.svelte.d.ts +1 -0
  18. package/dist/lib/components/toolbar/SettingsDialog.svelte.d.ts +1 -0
  19. package/dist/lib/components/toolbar/TopBar.svelte.d.ts +1 -0
  20. package/dist/lib/components/toolbar/VersionHistoryPanel.svelte.d.ts +1 -0
  21. package/dist/src/define-web-component.d.ts +1 -0
  22. package/dist/src/lib/firebase.d.ts +1 -0
  23. package/dist/src/lib/index.d.ts +1 -0
  24. package/dist/src/lib/models/types.d.ts +160 -0
  25. package/dist/src/lib/services/datastore.d.ts +15 -0
  26. package/dist/src/lib/stores/aiKeys.d.ts +9 -0
  27. package/dist/src/lib/stores/onboarding.svelte.d.ts +15 -0
  28. package/dist/src/lib/stores/project.d.ts +162 -0
  29. package/dist/src/lib/stores/saveStatus.d.ts +12 -0
  30. package/dist/src/lib/stores/settings.d.ts +25 -0
  31. package/dist/src/lib/stores/theme.d.ts +5 -0
  32. package/dist/src/lib/stores/versionHistory.d.ts +16 -0
  33. package/dist/src/lib/utils/alignment.d.ts +2 -0
  34. package/dist/src/lib/utils/cadExport.d.ts +3 -0
  35. package/dist/src/lib/utils/canvasInteraction.d.ts +30 -0
  36. package/dist/src/lib/utils/canvasRenderer.d.ts +34 -0
  37. package/dist/src/lib/utils/export.d.ts +13 -0
  38. package/dist/src/lib/utils/furnitureCatalog.d.ts +16 -0
  39. package/dist/src/lib/utils/furnitureIcons.d.ts +12 -0
  40. package/dist/src/lib/utils/furnitureModelLoader.d.ts +1 -0
  41. package/dist/src/lib/utils/furnitureModels3d.d.ts +1 -0
  42. package/dist/src/lib/utils/furnitureThumbnails.d.ts +1 -0
  43. package/dist/src/lib/utils/hitTesting.d.ts +16 -0
  44. package/dist/src/lib/utils/houseTemplates.d.ts +10 -0
  45. package/dist/src/lib/utils/images.d.ts +23 -0
  46. package/dist/src/lib/utils/materials.d.ts +17 -0
  47. package/dist/src/lib/utils/roomDetection.d.ts +11 -0
  48. package/dist/src/lib/utils/roomPresets.d.ts +13 -0
  49. package/dist/src/lib/utils/roomTemplates.d.ts +25 -0
  50. package/dist/src/lib/utils/roomplanImport.d.ts +19 -0
  51. package/dist/src/lib/utils/shortcuts.d.ts +5 -0
  52. package/dist/src/lib/utils/textureGenerator.d.ts +9 -0
  53. package/dist/src/main.d.ts +5 -0
  54. package/package.json +11 -17
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ import { Point, Wall, Door, Window as Win, FurnitureItem, Stair, Column, Floor, Room } from '../../../lib/models/types';
2
+ import { HandleType } from '../../../lib/utils/canvasInteraction';
3
+ export declare function pointInPolygon(p: Point, poly: Point[]): boolean;
4
+ export declare function pointToSegmentDist(p: Point, a: Point, b: Point): number;
5
+ export declare function positionOnWall(p: Point, w: Wall): number;
6
+ export declare function findWallAt(p: Point, walls: Wall[], zoom: number): Wall | null;
7
+ export declare function findHandleAt(p: Point, selectedId: string | null, furniture: FurnitureItem[], zoom: number): HandleType | null;
8
+ export declare function findFurnitureAt(p: Point, furniture: FurnitureItem[]): FurnitureItem | null;
9
+ export declare function findColumnAt(p: Point, columns: Column[] | undefined): Column | null;
10
+ export declare function findStairAt(p: Point, stairs: Stair[] | undefined): Stair | null;
11
+ export declare function findDoorAt(p: Point, doors: Door[], walls: Wall[], zoom: number): Door | null;
12
+ export declare function findWindowAt(p: Point, windows: Win[], walls: Wall[], zoom: number): Win | null;
13
+ export declare function findRoomAt(p: Point, rooms: Room[], walls: Wall[]): Room | null;
14
+ export declare function hitTestMeasurement(wp: Point, floor: Floor, zoom: number): string | null;
15
+ export declare function hitTestAnnotation(wp: Point, floor: Floor, zoom: number): string | null;
16
+ export declare function hitTestTextAnnotation(wp: Point, floor: Floor, ctx: CanvasRenderingContext2D, zoom: number): string | null;
@@ -0,0 +1,10 @@
1
+ import { Project } from '../../../lib/models/types';
2
+ export interface HouseTemplate {
3
+ name: string;
4
+ description: string;
5
+ icon: string;
6
+ area: string;
7
+ tags: string[];
8
+ create: () => Project;
9
+ }
10
+ export declare const houseTemplates: HouseTemplate[];
@@ -0,0 +1,23 @@
1
+ declare const images: {
2
+ redBrick: string;
3
+ exposedBrick: string;
4
+ stone: string;
5
+ woodPanel: string;
6
+ concreteBlock: string;
7
+ subwayTile: string;
8
+ lightOak: string;
9
+ walnut: string;
10
+ bamboo: string;
11
+ laminate: string;
12
+ ceramicWhite: string;
13
+ ceramicGray: string;
14
+ porcelain: string;
15
+ marbleWhite: string;
16
+ marbleDark: string;
17
+ carpetBeige: string;
18
+ carpetGray: string;
19
+ concrete: string;
20
+ slate: string;
21
+ vinyl: string;
22
+ };
23
+ export default images;
@@ -0,0 +1,17 @@
1
+ export interface FloorMaterial {
2
+ id: string;
3
+ name: string;
4
+ color: string;
5
+ pattern?: 'hardwood' | 'tile' | 'carpet' | 'concrete' | 'marble' | 'bamboo' | 'laminate' | 'slate' | 'vinyl';
6
+ roughness?: number;
7
+ }
8
+ export interface WallColor {
9
+ id: string;
10
+ name: string;
11
+ color: string;
12
+ texture?: 'brick' | 'stone' | 'wood-panel' | 'concrete' | 'tile';
13
+ }
14
+ export declare const floorMaterials: FloorMaterial[];
15
+ export declare const wallColors: WallColor[];
16
+ export declare function getMaterial(id: string): FloorMaterial;
17
+ export declare function getWallColor(id: string): WallColor;
@@ -0,0 +1,11 @@
1
+ import { Wall, Point, Room } from '../../../lib/models/types';
2
+ /**
3
+ * Detect enclosed rooms from a set of walls using a simple graph-cycle approach.
4
+ * Returns detected rooms with wall ids, centroid, and area.
5
+ */
6
+ export declare function detectRooms(walls: Wall[]): Room[];
7
+ /**
8
+ * Get polygon vertices for a room from its walls
9
+ */
10
+ export declare function getRoomPolygon(room: Room, walls: Wall[]): Point[];
11
+ export declare function roomCentroid(polygon: Point[]): Point;
@@ -0,0 +1,13 @@
1
+ import { Point } from '../../../lib/models/types';
2
+ export interface RoomPreset {
3
+ id: string;
4
+ name: string;
5
+ icon: string;
6
+ description: string;
7
+ getWalls: (w: number, h: number) => {
8
+ start: Point;
9
+ end: Point;
10
+ }[];
11
+ }
12
+ export declare const roomPresets: RoomPreset[];
13
+ export declare function placePreset(preset: RoomPreset, origin: Point, w?: number, h?: number): void;
@@ -0,0 +1,25 @@
1
+ import { Point } from '../../../lib/models/types';
2
+ import { RoomPreset } from './roomPresets';
3
+ export interface FurniturePlacement {
4
+ catalogId: string;
5
+ /** Offset from room center, in cm */
6
+ x: number;
7
+ y: number;
8
+ rotation: number;
9
+ }
10
+ export interface RoomTemplate {
11
+ name: string;
12
+ presetId: string;
13
+ furniture: FurniturePlacement[];
14
+ }
15
+ /**
16
+ * Room templates keyed by room-type name.
17
+ * Positions are relative to the room bounding-box center.
18
+ * Default room size is 400×300 so extents are ±200 x ±150.
19
+ */
20
+ export declare const roomTemplates: RoomTemplate[];
21
+ /**
22
+ * Place a room preset with optional furniture template.
23
+ * Furniture positions are offset from the given origin (room center).
24
+ */
25
+ export declare function placeRoomTemplate(preset: RoomPreset, origin: Point, template: RoomTemplate | null, w?: number, h?: number): void;
@@ -0,0 +1,19 @@
1
+ import { Floor } from '../../../lib/models/types';
2
+ /**
3
+ * Enforce orthogonal: find the dominant rotation of the whole layout,
4
+ * then rotate ALL points by its inverse so walls become axis-aligned.
5
+ * This preserves topology (connected corners stay connected).
6
+ */
7
+ /** Orthogonal enforcement version (shown in import dialog) */
8
+ export declare const ORTHO_VERSION = "v5";
9
+ export interface RoomPlanImportOptions {
10
+ straighten?: boolean;
11
+ orthogonal?: boolean;
12
+ angleTolerance?: number;
13
+ mergeDistance?: number;
14
+ }
15
+ export declare function importRoomPlan(jsonData: any, options?: RoomPlanImportOptions): Floor;
16
+ /**
17
+ * Extract room.json from a .zip file (iOS RoomPlan export format)
18
+ */
19
+ export declare function extractRoomJsonFromZip(zipFile: File): Promise<any>;
@@ -0,0 +1,5 @@
1
+ export interface ShortcutContext {
2
+ rotateFurniture?: () => void;
3
+ save?: () => void;
4
+ }
5
+ export declare function handleGlobalShortcut(e: KeyboardEvent, ctx?: ShortcutContext): boolean;
@@ -0,0 +1,9 @@
1
+ export declare function generateBrickTexture(baseColor?: string, variant?: 'standard' | 'exposed'): HTMLCanvasElement;
2
+ export declare function generateStoneTexture(baseColor?: string): HTMLCanvasElement;
3
+ export declare function generateWoodPanelTexture(baseColor?: string): HTMLCanvasElement;
4
+ export declare function generateConcreteTexture(baseColor?: string): HTMLCanvasElement;
5
+ export declare function generateSubwayTileTexture(baseColor?: string): HTMLCanvasElement;
6
+ export declare function generateHardwoodTexture(baseColor?: string): HTMLCanvasElement;
7
+ export declare function getFloorTextureCanvas(materialId: string): HTMLCanvasElement | null;
8
+ export declare function setTextureLoadCallback(cb: () => void): void;
9
+ export declare function getWallTextureCanvas(textureId: string, color: string): HTMLCanvasElement | null;
@@ -0,0 +1,5 @@
1
+ declare const app: {
2
+ $on?(type: string, callback: (e: any) => void): () => void;
3
+ $set?(props: Partial<Record<string, any>>): void;
4
+ } & Record<string, any>;
5
+ export default app;
package/package.json CHANGED
@@ -1,28 +1,22 @@
1
1
  {
2
2
  "name": "floor-editor-ts",
3
3
  "private": false,
4
- "version": "1.0.2",
4
+ "version": "1.0.4",
5
5
  "type": "module",
6
- "types": "./src/main.d.ts",
7
- "main": "./floor-editor.umd.js",
8
- "module": "./floor-editor.es.js",
6
+ "main": "./dist/floor-editor.es.js",
7
+ "module": "./dist/floor-editor.es.js",
8
+ "types": "./dist/define-web-component.d.ts",
9
9
  "exports": {
10
10
  ".": {
11
- "types": "./src/main.d.ts",
12
- "import": "./floor-editor.es.js",
13
- "require": "./floor-editor.umd.js",
14
- "default": "./floor-editor.es.js"
11
+ "types": "./dist/define-web-component.d.ts",
12
+ "import": "./dist/floor-editor.es.js",
13
+ "default": "./dist/floor-editor.es.js"
15
14
  },
16
- "./style.css": "./floor-editor-ts.css",
17
- "./floor-editor-ts.css": "./floor-editor-ts.css"
15
+ "./style.css": "./dist/floor-editor-ts.css"
18
16
  },
19
17
  "files": [
20
- "floor-editor.es.js",
21
- "floor-editor.umd.js",
22
- "floor-editor-ts.css",
23
- "icons.svg",
24
- "favicon.svg",
25
- "src/main.d.ts"
18
+ "dist",
19
+ "README.md"
26
20
  ],
27
21
  "scripts": {
28
22
  "dev": "vite",
@@ -32,7 +26,7 @@
32
26
  "publish:js": "node scripts/publish-libjs.js",
33
27
  "preview": "vite preview",
34
28
  "check": "svelte-check --tsconfig ./tsconfig.app.json && tsc -p tsconfig.node.json",
35
- "build:css": "tailwindcss -i ./src/app.css -o ./src/tailwind-output.css"
29
+ "build:css": "tailwindcss -i ./src/app.css -o ./dist/floor-editor-ts.css"
36
30
  },
37
31
  "devDependencies": {
38
32
  "@sveltejs/vite-plugin-svelte": "^7.0.0",