@plasius/gpu-shared 0.1.19 → 1.0.0
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/CHANGELOG.md +41 -1
- package/README.md +26 -13
- package/assets/shoreline.gltf +532 -0
- package/dist/{chunk-EZHA3MH7.js → chunk-DBTWE2EF.js} +6 -2
- package/dist/chunk-DBTWE2EF.js.map +1 -0
- package/dist/{chunk-UKCJ2AWJ.js → chunk-KGKLNL4X.js} +3 -2
- package/dist/chunk-KGKLNL4X.js.map +1 -0
- package/dist/{gltf-loader-FMRC3OEV.js → gltf-loader-44ILCO7V.js} +2 -2
- package/dist/index.cjs +421 -152
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/{product-studio-runtime-3KANG3JE.js → product-studio-runtime-H7S5WN64.js} +5 -3
- package/dist/{showcase-runtime-OH3H6ZW2.js → showcase-runtime-INRAPCXW.js} +414 -152
- package/dist/showcase-runtime-INRAPCXW.js.map +1 -0
- package/package.json +2 -1
- package/src/asset-url.js +1 -0
- package/src/index.d.ts +10 -1
- package/src/index.js +1 -0
- package/src/product-studio-runtime.js +4 -0
- package/src/showcase-runtime.js +430 -151
- package/dist/chunk-EZHA3MH7.js.map +0 -1
- package/dist/chunk-UKCJ2AWJ.js.map +0 -1
- package/dist/showcase-runtime-OH3H6ZW2.js.map +0 -1
- /package/dist/{gltf-loader-FMRC3OEV.js.map → gltf-loader-44ILCO7V.js.map} +0 -0
- /package/dist/{product-studio-runtime-3KANG3JE.js.map → product-studio-runtime-H7S5WN64.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
+
buildProductStudioSceneObjects,
|
|
2
3
|
createProductStudioMeshes,
|
|
3
4
|
mountGpuProductStudio
|
|
4
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-DBTWE2EF.js";
|
|
5
6
|
import {
|
|
6
7
|
GPU_SHOWCASE_PRODUCT_STUDIO_FEATURE,
|
|
7
8
|
GPU_SHOWCASE_REALISTIC_MODELS_FEATURE,
|
|
@@ -13,7 +14,7 @@ import {
|
|
|
13
14
|
} from "./chunk-CH3ZS5TQ.js";
|
|
14
15
|
import {
|
|
15
16
|
resolveShowcaseAssetUrl
|
|
16
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-KGKLNL4X.js";
|
|
17
18
|
import "./chunk-2GM64LB6.js";
|
|
18
19
|
import "./chunk-DGUM43GV.js";
|
|
19
20
|
|
|
@@ -29,7 +30,7 @@ var showcaseFocusModes = Object.freeze([
|
|
|
29
30
|
]);
|
|
30
31
|
var showcaseDemoModes = Object.freeze(["harbor", "product-studio"]);
|
|
31
32
|
async function loadGltfModel(url) {
|
|
32
|
-
const module = await import("./gltf-loader-
|
|
33
|
+
const module = await import("./gltf-loader-44ILCO7V.js");
|
|
33
34
|
return module.loadGltfModel(url);
|
|
34
35
|
}
|
|
35
36
|
function isProductStudioFeatureEnabled(featureFlags) {
|
|
@@ -58,7 +59,7 @@ async function mountGpuShowcase(options = {}) {
|
|
|
58
59
|
`${GPU_SHOWCASE_PRODUCT_STUDIO_FEATURE} must be enabled before Product Studio can mount.`
|
|
59
60
|
);
|
|
60
61
|
}
|
|
61
|
-
const productRuntimeLoader = typeof options.__productRuntimeLoader === "function" ? options.__productRuntimeLoader : () => import("./product-studio-runtime-
|
|
62
|
+
const productRuntimeLoader = typeof options.__productRuntimeLoader === "function" ? options.__productRuntimeLoader : () => import("./product-studio-runtime-H7S5WN64.js");
|
|
62
63
|
const productModule = await productRuntimeLoader();
|
|
63
64
|
if (typeof productModule.mountGpuProductStudio !== "function") {
|
|
64
65
|
throw new Error("product runtime loader must provide mountGpuProductStudio.");
|
|
@@ -69,7 +70,7 @@ async function mountGpuShowcase(options = {}) {
|
|
|
69
70
|
delete productOptions.__featureFlags;
|
|
70
71
|
return productModule.mountGpuProductStudio(productOptions, options.__featureFlags);
|
|
71
72
|
}
|
|
72
|
-
const runtimeLoader = typeof options.__runtimeLoader === "function" ? options.__runtimeLoader : () => import("./showcase-runtime-
|
|
73
|
+
const runtimeLoader = typeof options.__runtimeLoader === "function" ? options.__runtimeLoader : () => import("./showcase-runtime-INRAPCXW.js");
|
|
73
74
|
const module = await runtimeLoader();
|
|
74
75
|
if (typeof module.mountGpuShowcase !== "function") {
|
|
75
76
|
throw new Error("showcase runtime loader must provide mountGpuShowcase.");
|
|
@@ -83,6 +84,7 @@ async function mountGpuShowcase(options = {}) {
|
|
|
83
84
|
export {
|
|
84
85
|
GPU_SHOWCASE_PRODUCT_STUDIO_FEATURE,
|
|
85
86
|
GPU_SHOWCASE_REALISTIC_MODELS_FEATURE,
|
|
87
|
+
buildProductStudioSceneObjects,
|
|
86
88
|
createGpuSharedTranslator,
|
|
87
89
|
createProductStudioMeshes,
|
|
88
90
|
gpuSharedEnGbTranslations,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.js"],"sourcesContent":["import {\n GPU_SHOWCASE_PRODUCT_STUDIO_FEATURE,\n GPU_SHOWCASE_REALISTIC_MODELS_FEATURE,\n} from \"./feature-flags.js\";\n\nexport { resolveShowcaseAssetUrl } from \"./asset-url.js\";\nexport {\n createGpuSharedTranslator,\n gpuSharedTranslationKeys,\n gpuSharedTranslations,\n translateGpuSharedText,\n} from \"./i18n.js\";\nexport { gpuSharedEnGbTranslations } from \"./translations/en-GB.js\";\nexport {\n GPU_SHOWCASE_PRODUCT_STUDIO_FEATURE,\n GPU_SHOWCASE_REALISTIC_MODELS_FEATURE,\n};\nexport {\n createProductStudioMeshes,\n mountGpuProductStudio,\n} from \"./product-studio-runtime.js\";\n\nexport const showcaseFocusModes = Object.freeze([\n \"integrated\",\n \"lighting\",\n \"cloth\",\n \"fluid\",\n \"physics\",\n \"performance\",\n \"debug\",\n]);\nexport const showcaseDemoModes = Object.freeze([\"harbor\", \"product-studio\"]);\n\nexport async function loadGltfModel(url) {\n const module = await import(\"./gltf-loader.js\");\n return module.loadGltfModel(url);\n}\n\nfunction isProductStudioFeatureEnabled(featureFlags) {\n if (typeof featureFlags?.get === \"function\") {\n return featureFlags.get(GPU_SHOWCASE_PRODUCT_STUDIO_FEATURE) === true;\n }\n\n const direct = featureFlags?.[GPU_SHOWCASE_PRODUCT_STUDIO_FEATURE];\n if (typeof direct === \"boolean\") {\n return direct;\n }\n\n const flagsValue = featureFlags?.flags?.[GPU_SHOWCASE_PRODUCT_STUDIO_FEATURE];\n if (typeof flagsValue === \"boolean\") {\n return flagsValue;\n }\n\n const enabledValue = featureFlags?.enabled?.[GPU_SHOWCASE_PRODUCT_STUDIO_FEATURE];\n if (typeof enabledValue === \"boolean\") {\n return enabledValue;\n }\n\n return false;\n}\n\nexport async function mountGpuShowcase(options = {}) {\n const demoMode = options.demoMode ?? options.mode;\n if (\n demoMode === \"product-studio\" ||\n demoMode === \"product\" ||\n demoMode === \"studio\" ||\n demoMode === \"eames\"\n ) {\n if (!isProductStudioFeatureEnabled(options.__featureFlags)) {\n throw new Error(\n `${GPU_SHOWCASE_PRODUCT_STUDIO_FEATURE} must be enabled before Product Studio can mount.`\n );\n }\n\n const productRuntimeLoader =\n typeof options.__productRuntimeLoader === \"function\"\n ? options.__productRuntimeLoader\n : () => import(\"./product-studio-runtime.js\");\n const productModule = await productRuntimeLoader();\n if (typeof productModule.mountGpuProductStudio !== \"function\") {\n throw new Error(\"product runtime loader must provide mountGpuProductStudio.\");\n }\n\n const productOptions = { ...options, demoMode };\n delete productOptions.__runtimeLoader;\n delete productOptions.__productRuntimeLoader;\n delete productOptions.__featureFlags;\n return productModule.mountGpuProductStudio(productOptions, options.__featureFlags);\n }\n\n const runtimeLoader =\n typeof options.__runtimeLoader === \"function\"\n ? options.__runtimeLoader\n : () => import(\"./showcase-runtime.js\");\n const module = await runtimeLoader();\n if (typeof module.mountGpuShowcase !== \"function\") {\n throw new Error(\"showcase runtime loader must provide mountGpuShowcase.\");\n }\n\n const publicOptions = { ...options };\n delete publicOptions.__runtimeLoader;\n delete publicOptions.__productRuntimeLoader;\n delete publicOptions.__featureFlags;\n return module.mountGpuShowcase(publicOptions, options.__featureFlags);\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/index.js"],"sourcesContent":["import {\n GPU_SHOWCASE_PRODUCT_STUDIO_FEATURE,\n GPU_SHOWCASE_REALISTIC_MODELS_FEATURE,\n} from \"./feature-flags.js\";\n\nexport { resolveShowcaseAssetUrl } from \"./asset-url.js\";\nexport {\n createGpuSharedTranslator,\n gpuSharedTranslationKeys,\n gpuSharedTranslations,\n translateGpuSharedText,\n} from \"./i18n.js\";\nexport { gpuSharedEnGbTranslations } from \"./translations/en-GB.js\";\nexport {\n GPU_SHOWCASE_PRODUCT_STUDIO_FEATURE,\n GPU_SHOWCASE_REALISTIC_MODELS_FEATURE,\n};\nexport {\n buildProductStudioSceneObjects,\n createProductStudioMeshes,\n mountGpuProductStudio,\n} from \"./product-studio-runtime.js\";\n\nexport const showcaseFocusModes = Object.freeze([\n \"integrated\",\n \"lighting\",\n \"cloth\",\n \"fluid\",\n \"physics\",\n \"performance\",\n \"debug\",\n]);\nexport const showcaseDemoModes = Object.freeze([\"harbor\", \"product-studio\"]);\n\nexport async function loadGltfModel(url) {\n const module = await import(\"./gltf-loader.js\");\n return module.loadGltfModel(url);\n}\n\nfunction isProductStudioFeatureEnabled(featureFlags) {\n if (typeof featureFlags?.get === \"function\") {\n return featureFlags.get(GPU_SHOWCASE_PRODUCT_STUDIO_FEATURE) === true;\n }\n\n const direct = featureFlags?.[GPU_SHOWCASE_PRODUCT_STUDIO_FEATURE];\n if (typeof direct === \"boolean\") {\n return direct;\n }\n\n const flagsValue = featureFlags?.flags?.[GPU_SHOWCASE_PRODUCT_STUDIO_FEATURE];\n if (typeof flagsValue === \"boolean\") {\n return flagsValue;\n }\n\n const enabledValue = featureFlags?.enabled?.[GPU_SHOWCASE_PRODUCT_STUDIO_FEATURE];\n if (typeof enabledValue === \"boolean\") {\n return enabledValue;\n }\n\n return false;\n}\n\nexport async function mountGpuShowcase(options = {}) {\n const demoMode = options.demoMode ?? options.mode;\n if (\n demoMode === \"product-studio\" ||\n demoMode === \"product\" ||\n demoMode === \"studio\" ||\n demoMode === \"eames\"\n ) {\n if (!isProductStudioFeatureEnabled(options.__featureFlags)) {\n throw new Error(\n `${GPU_SHOWCASE_PRODUCT_STUDIO_FEATURE} must be enabled before Product Studio can mount.`\n );\n }\n\n const productRuntimeLoader =\n typeof options.__productRuntimeLoader === \"function\"\n ? options.__productRuntimeLoader\n : () => import(\"./product-studio-runtime.js\");\n const productModule = await productRuntimeLoader();\n if (typeof productModule.mountGpuProductStudio !== \"function\") {\n throw new Error(\"product runtime loader must provide mountGpuProductStudio.\");\n }\n\n const productOptions = { ...options, demoMode };\n delete productOptions.__runtimeLoader;\n delete productOptions.__productRuntimeLoader;\n delete productOptions.__featureFlags;\n return productModule.mountGpuProductStudio(productOptions, options.__featureFlags);\n }\n\n const runtimeLoader =\n typeof options.__runtimeLoader === \"function\"\n ? options.__runtimeLoader\n : () => import(\"./showcase-runtime.js\");\n const module = await runtimeLoader();\n if (typeof module.mountGpuShowcase !== \"function\") {\n throw new Error(\"showcase runtime loader must provide mountGpuShowcase.\");\n }\n\n const publicOptions = { ...options };\n delete publicOptions.__runtimeLoader;\n delete publicOptions.__productRuntimeLoader;\n delete publicOptions.__featureFlags;\n return module.mountGpuShowcase(publicOptions, options.__featureFlags);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAuBO,IAAM,qBAAqB,OAAO,OAAO;AAAA,EAC9C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AACM,IAAM,oBAAoB,OAAO,OAAO,CAAC,UAAU,gBAAgB,CAAC;AAE3E,eAAsB,cAAc,KAAK;AACvC,QAAM,SAAS,MAAM,OAAO,2BAAkB;AAC9C,SAAO,OA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;AAEA,QAAM,gBAAgB,EAAE,GAAG,QAAQ;AACnC,SAAO,cAAc;AACrB,SAAO,cAAc;AACrB,SAAO,cAAc;AACrB,SAAO,OAAO,iBAAiB,eAAe,QAAQ,cAAc;AACtE;","names":[]}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
|
+
buildProductStudioSceneObjects,
|
|
2
3
|
createProductStudioMeshes,
|
|
3
4
|
mountGpuProductStudio
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-DBTWE2EF.js";
|
|
6
|
+
import "./chunk-KGKLNL4X.js";
|
|
6
7
|
import "./chunk-2GM64LB6.js";
|
|
7
8
|
import "./chunk-DGUM43GV.js";
|
|
8
9
|
export {
|
|
10
|
+
buildProductStudioSceneObjects,
|
|
9
11
|
createProductStudioMeshes,
|
|
10
12
|
mountGpuProductStudio
|
|
11
13
|
};
|
|
12
|
-
//# sourceMappingURL=product-studio-runtime-
|
|
14
|
+
//# sourceMappingURL=product-studio-runtime-H7S5WN64.js.map
|