@clikvn/showroom-visualizer 0.2.2-dev-12 → 0.2.2-dev-13
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 +26 -133
- package/base.json +21 -21
- package/dist/components/SkinLayer/Floorplan/Map.d.ts.map +1 -1
- package/dist/components/SkinLayer/Floorplan/Minimap/MiniMapMarker.d.ts.map +1 -1
- package/dist/components/SkinLayer/Floorplan/Minimap/index.d.ts.map +1 -1
- package/dist/components/SkinLayer/Layout/index.d.ts.map +1 -1
- package/dist/components/SkinLayer/index.d.ts +0 -32
- package/dist/components/SkinLayer/index.d.ts.map +1 -1
- package/dist/features/ShowroomVisualizer/VirtualTour.d.ts +0 -5
- package/dist/features/ShowroomVisualizer/VirtualTour.d.ts.map +1 -1
- package/dist/features/ShowroomVisualizer/VirtualTourContainer.d.ts +3 -4
- package/dist/features/ShowroomVisualizer/VirtualTourContainer.d.ts.map +1 -1
- package/dist/features/ShowroomVisualizer/index.d.ts +3 -24
- package/dist/features/ShowroomVisualizer/index.d.ts.map +1 -1
- package/dist/fonts/icomoon.svg +633 -633
- package/dist/hooks/useToolConfig.d.ts.map +1 -1
- package/dist/index.d.ts +0 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.html +27 -102
- package/dist/models/Visualizer/Tour.d.ts +1 -0
- package/dist/models/Visualizer/Tour.d.ts.map +1 -1
- package/dist/models/Visualizer/TourScenario/TourScenarioPlayer.d.ts +1 -0
- package/dist/models/Visualizer/TourScenario/TourScenarioPlayer.d.ts.map +1 -1
- package/dist/register.d.ts +0 -3
- package/dist/register.d.ts.map +1 -1
- package/dist/types/SkinLayer/tool.type.d.ts +1 -6
- package/dist/types/SkinLayer/tool.type.d.ts.map +1 -1
- package/dist/types/SkinLayer/visualizer.type.d.ts +0 -3
- package/dist/types/SkinLayer/visualizer.type.d.ts.map +1 -1
- package/dist/web.d.ts.map +1 -1
- package/dist/web.js +1 -1
- package/package.json +1 -9
- package/rollup.config.js +97 -427
- package/tailwind.config.cjs +151 -151
- package/.idea/inspectionProfiles/Project_Default.xml +0 -36
- package/.idea/jsLinters/eslint.xml +0 -7
- package/.idea/misc.xml +0 -9
- package/.idea/modules.xml +0 -8
- package/.idea/prettier.xml +0 -8
- package/.idea/showroom-visualizer.iml +0 -9
- package/.idea/vcs.xml +0 -6
- package/DEVELOPMENT.md +0 -120
- package/EXAMPLES.md +0 -967
- package/SETUP_COMPLETE.md +0 -149
- package/dist/components/SkinLayer/DefaultLayout/index.d.ts +0 -8
- package/dist/components/SkinLayer/DefaultLayout/index.d.ts.map +0 -1
- package/dist/components/SkinLayer/GalleryFullScreen/Content/ARViewer.d.ts +0 -30
- package/dist/components/SkinLayer/GalleryFullScreen/Content/ARViewer.d.ts.map +0 -1
- package/dist/components/SkinLayer/ModalItemInfo/Description.d.ts +0 -10
- package/dist/components/SkinLayer/ModalItemInfo/Description.d.ts.map +0 -1
- package/dist/components/SkinLayer/ModalItemInfo/Intro.d.ts +0 -9
- package/dist/components/SkinLayer/ModalItemInfo/Intro.d.ts.map +0 -1
- package/dist/components/SkinLayer/ModalItemInfo/Media.d.ts +0 -13
- package/dist/components/SkinLayer/ModalItemInfo/Media.d.ts.map +0 -1
- package/dist/components/SkinLayer/ModalItemInfo/index.d.ts +0 -10
- package/dist/components/SkinLayer/ModalItemInfo/index.d.ts.map +0 -1
- package/dist/components/SkinLayer/PoiTextureOptions/HorizontalMenu/index.d.ts +0 -13
- package/dist/components/SkinLayer/PoiTextureOptions/HorizontalMenu/index.d.ts.map +0 -1
- package/dist/components/SkinLayer/PoiTextureOptions/SemicircleMenu/index.d.ts +0 -13
- package/dist/components/SkinLayer/PoiTextureOptions/SemicircleMenu/index.d.ts.map +0 -1
- package/dist/components/SkinLayer/PoiTextureOptions/TextureMenuItem/index.d.ts +0 -15
- package/dist/components/SkinLayer/PoiTextureOptions/TextureMenuItem/index.d.ts.map +0 -1
- package/dist/components/SkinLayer/PoiTextureOptions/VerticalMenu/index.d.ts +0 -13
- package/dist/components/SkinLayer/PoiTextureOptions/VerticalMenu/index.d.ts.map +0 -1
- package/dist/context/CustomLayoutContext.d.ts +0 -20
- package/dist/context/CustomLayoutContext.d.ts.map +0 -1
- package/dist/context/StoreContext.d.ts +0 -5
- package/dist/context/StoreContext.d.ts.map +0 -1
- package/dist/features/ShowroomVisualizer/Scripts.d.ts +0 -4
- package/dist/features/ShowroomVisualizer/Scripts.d.ts.map +0 -1
- package/dist/features/ShowroomVisualizer/TourContainer.d.ts +0 -9
- package/dist/features/ShowroomVisualizer/TourContainer.d.ts.map +0 -1
- package/dist/features/ShowroomVisualizer/Tours.d.ts +0 -3
- package/dist/features/ShowroomVisualizer/Tours.d.ts.map +0 -1
- package/dist/hooks/Visualizer/reducer.d.ts +0 -116
- package/dist/hooks/Visualizer/reducer.d.ts.map +0 -1
- package/dist/hooks/headless/index.d.ts +0 -150
- package/dist/hooks/headless/index.d.ts.map +0 -1
- package/dist/hooks/headless/useFloorplanControl.d.ts +0 -18
- package/dist/hooks/headless/useFloorplanControl.d.ts.map +0 -1
- package/dist/hooks/headless/usePOIInteraction.d.ts +0 -23
- package/dist/hooks/headless/usePOIInteraction.d.ts.map +0 -1
- package/dist/hooks/headless/useScenarioControl.d.ts +0 -22
- package/dist/hooks/headless/useScenarioControl.d.ts.map +0 -1
- package/dist/hooks/headless/useSceneNavigation.d.ts +0 -26
- package/dist/hooks/headless/useSceneNavigation.d.ts.map +0 -1
- package/dist/hooks/headless/useTourCore.d.ts +0 -23
- package/dist/hooks/headless/useTourCore.d.ts.map +0 -1
- package/dist/hooks/headless/useViewportControl.d.ts +0 -22
- package/dist/hooks/headless/useViewportControl.d.ts.map +0 -1
- package/dist/index.js +0 -1
- package/dist/types/custom-layout.d.ts +0 -63
- package/dist/types/custom-layout.d.ts.map +0 -1
- package/example/CSS_HANDLING.md +0 -141
- package/example/FIXES_SUMMARY.md +0 -121
- package/example/PATH_ALIASES.md +0 -103
- package/example/README.md +0 -64
- package/example/index.html +0 -13
- package/example/package.json +0 -25
- package/example/postcss.config.cjs +0 -6
- package/example/tailwind.config.cjs +0 -12
- package/example/tsconfig.node.json +0 -12
- package/example/vite.config.ts +0 -126
package/example/vite.config.ts
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { defineConfig, Plugin } from 'vite';
|
|
2
|
-
import react from '@vitejs/plugin-react';
|
|
3
|
-
import path from 'path';
|
|
4
|
-
import fs from 'fs';
|
|
5
|
-
import postcss from 'postcss';
|
|
6
|
-
import tailwindcss from 'tailwindcss';
|
|
7
|
-
import autoprefixer from 'autoprefixer';
|
|
8
|
-
|
|
9
|
-
// Custom plugin to handle CSS imports as strings (matching Rollup's postcss behavior)
|
|
10
|
-
const cssAsStringPlugin = (): Plugin => {
|
|
11
|
-
let postcssProcessor: any;
|
|
12
|
-
|
|
13
|
-
return {
|
|
14
|
-
name: 'css-as-string',
|
|
15
|
-
enforce: 'pre',
|
|
16
|
-
|
|
17
|
-
async configResolved(config) {
|
|
18
|
-
// Initialize PostCSS processor with Tailwind
|
|
19
|
-
postcssProcessor = postcss([
|
|
20
|
-
tailwindcss({
|
|
21
|
-
config: path.resolve(__dirname, 'tailwind.config.cjs'),
|
|
22
|
-
}),
|
|
23
|
-
autoprefixer(),
|
|
24
|
-
]);
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
async resolveId(source, importer) {
|
|
28
|
-
// Handle CSS imports from the library
|
|
29
|
-
if (source.endsWith('.css') && importer) {
|
|
30
|
-
// Check if this is from our library (any src folder) or @clikvn packages
|
|
31
|
-
const isLibraryCSS =
|
|
32
|
-
importer.includes('/showroom-visualizer/src/') ||
|
|
33
|
-
source.includes('@clikvn/');
|
|
34
|
-
|
|
35
|
-
if (isLibraryCSS) {
|
|
36
|
-
// Resolve the full path
|
|
37
|
-
let resolvedPath: string;
|
|
38
|
-
|
|
39
|
-
if (source.startsWith('.') || source.startsWith('/')) {
|
|
40
|
-
resolvedPath = path.resolve(path.dirname(importer), source);
|
|
41
|
-
} else if (source.startsWith('@clikvn/')) {
|
|
42
|
-
// Handle @clikvn packages - look in parent node_modules
|
|
43
|
-
const packagePath = source.replace('@clikvn/', '../node_modules/@clikvn/');
|
|
44
|
-
resolvedPath = path.resolve(__dirname, packagePath);
|
|
45
|
-
} else {
|
|
46
|
-
return null;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// Add a virtual marker to bypass Vite's CSS processing
|
|
50
|
-
return '\0' + resolvedPath + '.string';
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return null;
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
async load(id) {
|
|
57
|
-
// Handle our virtual CSS string modules
|
|
58
|
-
if (id.startsWith('\0') && id.endsWith('.css.string')) {
|
|
59
|
-
const realPath = id.slice(1, -7); // Remove \0 prefix and .string suffix
|
|
60
|
-
|
|
61
|
-
try {
|
|
62
|
-
const content = await fs.promises.readFile(realPath, 'utf-8');
|
|
63
|
-
|
|
64
|
-
// Process all CSS through PostCSS/Tailwind to ensure Tailwind utilities work
|
|
65
|
-
let processedContent = content;
|
|
66
|
-
try {
|
|
67
|
-
const result = await postcssProcessor.process(content, { from: realPath });
|
|
68
|
-
processedContent = result.css;
|
|
69
|
-
} catch (error) {
|
|
70
|
-
console.warn(`PostCSS processing failed for ${realPath}:`, error);
|
|
71
|
-
// Fall back to original content if processing fails
|
|
72
|
-
processedContent = content;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return {
|
|
76
|
-
code: `export default ${JSON.stringify(processedContent)};`,
|
|
77
|
-
map: null,
|
|
78
|
-
};
|
|
79
|
-
} catch (error) {
|
|
80
|
-
console.error(`Failed to load CSS file: ${realPath}`, error);
|
|
81
|
-
return {
|
|
82
|
-
code: `export default "";`,
|
|
83
|
-
map: null,
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
return null;
|
|
88
|
-
},
|
|
89
|
-
};
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
// https://vitejs.dev/config/
|
|
93
|
-
export default defineConfig({
|
|
94
|
-
plugins: [cssAsStringPlugin(), react()],
|
|
95
|
-
resolve: {
|
|
96
|
-
alias: {
|
|
97
|
-
// Force use of example's React to avoid duplicate instances
|
|
98
|
-
'react': path.resolve(__dirname, 'node_modules/react'),
|
|
99
|
-
'react-dom': path.resolve(__dirname, 'node_modules/react-dom'),
|
|
100
|
-
'react/jsx-runtime': path.resolve(__dirname, 'node_modules/react/jsx-runtime'),
|
|
101
|
-
// Alias để import trực tiếp từ source code thay vì build
|
|
102
|
-
'@clikvn/showroom-visualizer': path.resolve(__dirname, '../src'),
|
|
103
|
-
// Thư viện sử dụng baseUrl: "./src" nên tất cả imports cần aliases
|
|
104
|
-
commons: path.resolve(__dirname, '../src/commons'),
|
|
105
|
-
components: path.resolve(__dirname, '../src/components'),
|
|
106
|
-
constants: path.resolve(__dirname, '../src/constants'),
|
|
107
|
-
context: path.resolve(__dirname, '../src/context'),
|
|
108
|
-
features: path.resolve(__dirname, '../src/features'),
|
|
109
|
-
hooks: path.resolve(__dirname, '../src/hooks'),
|
|
110
|
-
models: path.resolve(__dirname, '../src/models'),
|
|
111
|
-
services: path.resolve(__dirname, '../src/services'),
|
|
112
|
-
types: path.resolve(__dirname, '../src/types'),
|
|
113
|
-
utils: path.resolve(__dirname, '../src/utils'),
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
server: {
|
|
117
|
-
port: 3001,
|
|
118
|
-
open: true,
|
|
119
|
-
},
|
|
120
|
-
optimizeDeps: {
|
|
121
|
-
// Force prebundle để tránh conflict React versions
|
|
122
|
-
include: ['react', 'react-dom'],
|
|
123
|
-
// Ensure all React references use the same instance
|
|
124
|
-
dedupe: ['react', 'react-dom'],
|
|
125
|
-
},
|
|
126
|
-
});
|