@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.
Files changed (103) hide show
  1. package/README.md +26 -133
  2. package/base.json +21 -21
  3. package/dist/components/SkinLayer/Floorplan/Map.d.ts.map +1 -1
  4. package/dist/components/SkinLayer/Floorplan/Minimap/MiniMapMarker.d.ts.map +1 -1
  5. package/dist/components/SkinLayer/Floorplan/Minimap/index.d.ts.map +1 -1
  6. package/dist/components/SkinLayer/Layout/index.d.ts.map +1 -1
  7. package/dist/components/SkinLayer/index.d.ts +0 -32
  8. package/dist/components/SkinLayer/index.d.ts.map +1 -1
  9. package/dist/features/ShowroomVisualizer/VirtualTour.d.ts +0 -5
  10. package/dist/features/ShowroomVisualizer/VirtualTour.d.ts.map +1 -1
  11. package/dist/features/ShowroomVisualizer/VirtualTourContainer.d.ts +3 -4
  12. package/dist/features/ShowroomVisualizer/VirtualTourContainer.d.ts.map +1 -1
  13. package/dist/features/ShowroomVisualizer/index.d.ts +3 -24
  14. package/dist/features/ShowroomVisualizer/index.d.ts.map +1 -1
  15. package/dist/fonts/icomoon.svg +633 -633
  16. package/dist/hooks/useToolConfig.d.ts.map +1 -1
  17. package/dist/index.d.ts +0 -11
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.html +27 -102
  20. package/dist/models/Visualizer/Tour.d.ts +1 -0
  21. package/dist/models/Visualizer/Tour.d.ts.map +1 -1
  22. package/dist/models/Visualizer/TourScenario/TourScenarioPlayer.d.ts +1 -0
  23. package/dist/models/Visualizer/TourScenario/TourScenarioPlayer.d.ts.map +1 -1
  24. package/dist/register.d.ts +0 -3
  25. package/dist/register.d.ts.map +1 -1
  26. package/dist/types/SkinLayer/tool.type.d.ts +1 -6
  27. package/dist/types/SkinLayer/tool.type.d.ts.map +1 -1
  28. package/dist/types/SkinLayer/visualizer.type.d.ts +0 -3
  29. package/dist/types/SkinLayer/visualizer.type.d.ts.map +1 -1
  30. package/dist/web.d.ts.map +1 -1
  31. package/dist/web.js +1 -1
  32. package/package.json +1 -9
  33. package/rollup.config.js +97 -427
  34. package/tailwind.config.cjs +151 -151
  35. package/.idea/inspectionProfiles/Project_Default.xml +0 -36
  36. package/.idea/jsLinters/eslint.xml +0 -7
  37. package/.idea/misc.xml +0 -9
  38. package/.idea/modules.xml +0 -8
  39. package/.idea/prettier.xml +0 -8
  40. package/.idea/showroom-visualizer.iml +0 -9
  41. package/.idea/vcs.xml +0 -6
  42. package/DEVELOPMENT.md +0 -120
  43. package/EXAMPLES.md +0 -967
  44. package/SETUP_COMPLETE.md +0 -149
  45. package/dist/components/SkinLayer/DefaultLayout/index.d.ts +0 -8
  46. package/dist/components/SkinLayer/DefaultLayout/index.d.ts.map +0 -1
  47. package/dist/components/SkinLayer/GalleryFullScreen/Content/ARViewer.d.ts +0 -30
  48. package/dist/components/SkinLayer/GalleryFullScreen/Content/ARViewer.d.ts.map +0 -1
  49. package/dist/components/SkinLayer/ModalItemInfo/Description.d.ts +0 -10
  50. package/dist/components/SkinLayer/ModalItemInfo/Description.d.ts.map +0 -1
  51. package/dist/components/SkinLayer/ModalItemInfo/Intro.d.ts +0 -9
  52. package/dist/components/SkinLayer/ModalItemInfo/Intro.d.ts.map +0 -1
  53. package/dist/components/SkinLayer/ModalItemInfo/Media.d.ts +0 -13
  54. package/dist/components/SkinLayer/ModalItemInfo/Media.d.ts.map +0 -1
  55. package/dist/components/SkinLayer/ModalItemInfo/index.d.ts +0 -10
  56. package/dist/components/SkinLayer/ModalItemInfo/index.d.ts.map +0 -1
  57. package/dist/components/SkinLayer/PoiTextureOptions/HorizontalMenu/index.d.ts +0 -13
  58. package/dist/components/SkinLayer/PoiTextureOptions/HorizontalMenu/index.d.ts.map +0 -1
  59. package/dist/components/SkinLayer/PoiTextureOptions/SemicircleMenu/index.d.ts +0 -13
  60. package/dist/components/SkinLayer/PoiTextureOptions/SemicircleMenu/index.d.ts.map +0 -1
  61. package/dist/components/SkinLayer/PoiTextureOptions/TextureMenuItem/index.d.ts +0 -15
  62. package/dist/components/SkinLayer/PoiTextureOptions/TextureMenuItem/index.d.ts.map +0 -1
  63. package/dist/components/SkinLayer/PoiTextureOptions/VerticalMenu/index.d.ts +0 -13
  64. package/dist/components/SkinLayer/PoiTextureOptions/VerticalMenu/index.d.ts.map +0 -1
  65. package/dist/context/CustomLayoutContext.d.ts +0 -20
  66. package/dist/context/CustomLayoutContext.d.ts.map +0 -1
  67. package/dist/context/StoreContext.d.ts +0 -5
  68. package/dist/context/StoreContext.d.ts.map +0 -1
  69. package/dist/features/ShowroomVisualizer/Scripts.d.ts +0 -4
  70. package/dist/features/ShowroomVisualizer/Scripts.d.ts.map +0 -1
  71. package/dist/features/ShowroomVisualizer/TourContainer.d.ts +0 -9
  72. package/dist/features/ShowroomVisualizer/TourContainer.d.ts.map +0 -1
  73. package/dist/features/ShowroomVisualizer/Tours.d.ts +0 -3
  74. package/dist/features/ShowroomVisualizer/Tours.d.ts.map +0 -1
  75. package/dist/hooks/Visualizer/reducer.d.ts +0 -116
  76. package/dist/hooks/Visualizer/reducer.d.ts.map +0 -1
  77. package/dist/hooks/headless/index.d.ts +0 -150
  78. package/dist/hooks/headless/index.d.ts.map +0 -1
  79. package/dist/hooks/headless/useFloorplanControl.d.ts +0 -18
  80. package/dist/hooks/headless/useFloorplanControl.d.ts.map +0 -1
  81. package/dist/hooks/headless/usePOIInteraction.d.ts +0 -23
  82. package/dist/hooks/headless/usePOIInteraction.d.ts.map +0 -1
  83. package/dist/hooks/headless/useScenarioControl.d.ts +0 -22
  84. package/dist/hooks/headless/useScenarioControl.d.ts.map +0 -1
  85. package/dist/hooks/headless/useSceneNavigation.d.ts +0 -26
  86. package/dist/hooks/headless/useSceneNavigation.d.ts.map +0 -1
  87. package/dist/hooks/headless/useTourCore.d.ts +0 -23
  88. package/dist/hooks/headless/useTourCore.d.ts.map +0 -1
  89. package/dist/hooks/headless/useViewportControl.d.ts +0 -22
  90. package/dist/hooks/headless/useViewportControl.d.ts.map +0 -1
  91. package/dist/index.js +0 -1
  92. package/dist/types/custom-layout.d.ts +0 -63
  93. package/dist/types/custom-layout.d.ts.map +0 -1
  94. package/example/CSS_HANDLING.md +0 -141
  95. package/example/FIXES_SUMMARY.md +0 -121
  96. package/example/PATH_ALIASES.md +0 -103
  97. package/example/README.md +0 -64
  98. package/example/index.html +0 -13
  99. package/example/package.json +0 -25
  100. package/example/postcss.config.cjs +0 -6
  101. package/example/tailwind.config.cjs +0 -12
  102. package/example/tsconfig.node.json +0 -12
  103. package/example/vite.config.ts +0 -126
@@ -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
- });