@webspatial/react-sdk 0.1.10 → 0.1.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/dist/default/index.d.ts +41 -7
- package/dist/default/index.js +208 -18
- package/dist/default/index.js.map +1 -1
- package/dist/jsx/jsx-dev-runtime.d.ts +1 -1
- package/dist/jsx/jsx-dev-runtime.js +15 -5
- package/dist/jsx/jsx-dev-runtime.js.map +1 -1
- package/dist/jsx/jsx-dev-runtime.web.js +18 -0
- package/dist/jsx/jsx-dev-runtime.web.js.map +1 -0
- package/dist/jsx/{jsx-runtime-DjvfDSm5.d.ts → jsx-runtime-zHGvMrtA.d.ts} +1 -0
- package/dist/jsx/jsx-runtime.d.ts +1 -1
- package/dist/jsx/jsx-runtime.js +15 -5
- package/dist/jsx/jsx-runtime.js.map +1 -1
- package/dist/jsx/jsx-runtime.web.js +18 -0
- package/dist/jsx/jsx-runtime.web.js.map +1 -0
- package/dist/web/index.d.ts +41 -7
- package/dist/web/index.js +239 -20
- package/dist/web/index.js.map +1 -1
- package/package.json +18 -13
- package/dist/jsx/jsx-dev-runtime.react-server.js +0 -9
- package/dist/jsx/jsx-dev-runtime.react-server.js.map +0 -1
- package/dist/jsx/jsx-runtime.react-server.js +0 -9
- package/dist/jsx/jsx-runtime.react-server.js.map +0 -1
- package/npm/plugin/esbuild.js +0 -11
- package/npm/plugin/rollup.js +0 -8
- package/npm/plugin/shared.js +0 -9
- package/npm/plugin/vite.d.ts +0 -5
- package/npm/plugin/vite.js +0 -86
- package/npm/plugin/webpack.js +0 -9
- /package/dist/jsx/{jsx-dev-runtime.react-server.d.ts → jsx-dev-runtime.web.d.ts} +0 -0
- /package/dist/jsx/{jsx-runtime.react-server.d.ts → jsx-runtime.web.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,30 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webspatial/react-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.13",
|
|
4
4
|
"description": "React components for WebSpatial",
|
|
5
5
|
"main": "./dist/default/index.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"types": "./dist/default/index.d.ts",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": "./dist/default/index.js",
|
|
10
|
-
"./default": "./dist/default/index.js",
|
|
11
|
-
"./web": "./dist/web/index.js",
|
|
12
|
-
"./plugin-esbuild.js": "./npm/plugin/esbuild.js",
|
|
13
|
-
"./plugin-vite.js": "./npm/plugin/vite.js",
|
|
14
|
-
"./plugin-rollup.js": "./npm/plugin/rollup.js",
|
|
15
|
-
"./plugin-webpack.js": "./npm/plugin/webpack.js",
|
|
16
10
|
"./jsx-runtime": {
|
|
17
|
-
"react-server": "./dist/jsx/jsx-runtime.
|
|
11
|
+
"react-server": "./dist/jsx/jsx-runtime.web.js",
|
|
18
12
|
"default": "./dist/jsx/jsx-runtime.js"
|
|
19
13
|
},
|
|
20
14
|
"./jsx-dev-runtime": {
|
|
21
|
-
"react-server": "./dist/jsx/jsx-dev-runtime.
|
|
15
|
+
"react-server": "./dist/jsx/jsx-dev-runtime.web.js",
|
|
22
16
|
"default": "./dist/jsx/jsx-dev-runtime.js"
|
|
23
|
-
}
|
|
17
|
+
},
|
|
18
|
+
"./default": "./dist/default/index.js",
|
|
19
|
+
"./default/jsx-dev-runtime": {
|
|
20
|
+
"react-server": "./dist/jsx/jsx-dev-runtime.web.js",
|
|
21
|
+
"default": "./dist/jsx/jsx-dev-runtime.js"
|
|
22
|
+
},
|
|
23
|
+
"./default/jsx-runtime": {
|
|
24
|
+
"react-server": "./dist/jsx/jsx-runtime.web.js",
|
|
25
|
+
"default": "./dist/jsx/jsx-runtime.js"
|
|
26
|
+
},
|
|
27
|
+
"./web": "./dist/web/index.js",
|
|
28
|
+
"./web/jsx-dev-runtime": "./dist/jsx/jsx-dev-runtime.web.js",
|
|
29
|
+
"./web/jsx-runtime": "./dist/jsx/jsx-runtime.web.js"
|
|
24
30
|
},
|
|
25
31
|
"files": [
|
|
26
|
-
"dist"
|
|
27
|
-
"npm"
|
|
32
|
+
"dist"
|
|
28
33
|
],
|
|
29
34
|
"repository": {
|
|
30
35
|
"type": "git",
|
|
@@ -46,7 +51,7 @@
|
|
|
46
51
|
"peerDependencies": {
|
|
47
52
|
"react": ">=18.0.0",
|
|
48
53
|
"react-dom": ">=18.0.0",
|
|
49
|
-
"@webspatial/core-sdk": "0.1.
|
|
54
|
+
"@webspatial/core-sdk": "0.1.13"
|
|
50
55
|
},
|
|
51
56
|
"peerDependenciesMeta": {
|
|
52
57
|
"@webspatial/core-sdk": {
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// src/jsx/jsx-dev-runtime.react-server.ts
|
|
2
|
-
import { Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { jsxDEV, jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
|
|
4
|
-
export {
|
|
5
|
-
Fragment,
|
|
6
|
-
jsxDEV2 as jsx,
|
|
7
|
-
jsxDEV
|
|
8
|
-
};
|
|
9
|
-
//# sourceMappingURL=jsx-dev-runtime.react-server.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/jsx/jsx-dev-runtime.react-server.ts"],"sourcesContent":["export { Fragment } from 'react/jsx-runtime'\nexport { jsxDEV, jsxDEV as jsx } from 'react/jsx-dev-runtime'\n"],"mappings":";AAAA,SAAS,gBAAgB;AACzB,SAAS,QAAkB,UAAVA,eAAqB;","names":["jsxDEV"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/jsx/jsx-runtime.react-server.ts"],"sourcesContent":["export { Fragment } from 'react/jsx-runtime'\nexport { jsx, jsxs } from 'react/jsx-runtime'\n"],"mappings":";AAAA,SAAS,gBAAgB;AACzB,SAAS,KAAK,YAAY;","names":[]}
|
package/npm/plugin/esbuild.js
DELETED
package/npm/plugin/rollup.js
DELETED
package/npm/plugin/shared.js
DELETED
package/npm/plugin/vite.d.ts
DELETED
package/npm/plugin/vite.js
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
const path = require('path')
|
|
2
|
-
const fs = require('fs')
|
|
3
|
-
const { getEnv, AVP } = require('./shared')
|
|
4
|
-
|
|
5
|
-
function injectProcessEnv() {
|
|
6
|
-
return {
|
|
7
|
-
name: 'vite-plugin-inject-env',
|
|
8
|
-
config: () => {
|
|
9
|
-
const xrEnv = getEnv()
|
|
10
|
-
|
|
11
|
-
const isAVP = xrEnv === AVP
|
|
12
|
-
|
|
13
|
-
const output = isAVP
|
|
14
|
-
? {
|
|
15
|
-
entryFileNames: `assets/[name]-[hash].${AVP}.js`, // no share js entry
|
|
16
|
-
chunkFileNames: `assets/[name]-[hash].${AVP}.js`, // no share js chunk
|
|
17
|
-
assetFileNames: 'assets/[name]-[hash][extname]', // shared css image
|
|
18
|
-
}
|
|
19
|
-
: {}
|
|
20
|
-
|
|
21
|
-
return {
|
|
22
|
-
resolve: {
|
|
23
|
-
alias: [
|
|
24
|
-
{
|
|
25
|
-
find: /^@webspatial\/react-sdk$/,
|
|
26
|
-
replacement: isAVP
|
|
27
|
-
? '@webspatial/react-sdk/default'
|
|
28
|
-
: '@webspatial/react-sdk/web',
|
|
29
|
-
},
|
|
30
|
-
],
|
|
31
|
-
},
|
|
32
|
-
define: {
|
|
33
|
-
'process.env.XR_ENV': JSON.stringify(xrEnv),
|
|
34
|
-
'import.meta.env.XR_ENV': JSON.stringify(xrEnv), // visible in development
|
|
35
|
-
},
|
|
36
|
-
build: {
|
|
37
|
-
emptyOutDir: xrEnv !== AVP, // keep dist folder
|
|
38
|
-
rollupOptions: {
|
|
39
|
-
output,
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
optimizeDeps: {},
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
renderStart(outputOptions) {
|
|
46
|
-
// rename index.html to index.avp.html
|
|
47
|
-
const xrEnv = getEnv()
|
|
48
|
-
if (xrEnv !== AVP) {
|
|
49
|
-
return
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const outDir = outputOptions.dir || 'dist'
|
|
53
|
-
const indexPath = path.resolve(outDir, 'index.html')
|
|
54
|
-
const tempIndexPath = path.resolve(outDir, 'index.html.tmp')
|
|
55
|
-
|
|
56
|
-
if (fs.existsSync(indexPath)) {
|
|
57
|
-
fs.renameSync(indexPath, tempIndexPath)
|
|
58
|
-
console.log(
|
|
59
|
-
`[Build Start] Renamed existing index.html to ${tempIndexPath}`,
|
|
60
|
-
)
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
writeBundle(outputOptions) {
|
|
64
|
-
const xrEnv = getEnv()
|
|
65
|
-
if (xrEnv !== AVP) {
|
|
66
|
-
return
|
|
67
|
-
}
|
|
68
|
-
const outDir = outputOptions.dir || 'dist'
|
|
69
|
-
const indexHtmlPath = path.resolve(outDir, 'index.html')
|
|
70
|
-
const tempIndexPath = path.resolve(outDir, 'index.html.tmp')
|
|
71
|
-
const newHtmlPath = path.resolve(outDir, 'index.avp.html')
|
|
72
|
-
|
|
73
|
-
if (fs.existsSync(indexHtmlPath)) {
|
|
74
|
-
fs.renameSync(indexHtmlPath, newHtmlPath)
|
|
75
|
-
console.log(`Renamed index.html to ${newHtmlPath}`)
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// recover index.html.tmp to index.html
|
|
79
|
-
if (fs.existsSync(tempIndexPath)) {
|
|
80
|
-
fs.renameSync(tempIndexPath, indexHtmlPath)
|
|
81
|
-
console.log(`Renamed ${tempIndexPath} back to index.html`)
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
module.exports = injectProcessEnv
|
package/npm/plugin/webpack.js
DELETED
|
File without changes
|
|
File without changes
|