@holoscript/core 8.0.0 → 8.0.2
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 +2 -2
- package/dist/{GLTFPipeline-M7WSSJED.cjs → GLTFPipeline-76QTLF4Z.cjs} +10 -9
- package/dist/{GLTFPipeline-276GE64O.js → GLTFPipeline-ES5YMBGT.js} +6 -5
- package/dist/HoloScriptRuntime-2DDYOPOR.js +10 -0
- package/dist/{HoloScriptRuntime-SXEAEU2N.cjs → HoloScriptRuntime-ZGRR5EB3.cjs} +5 -5
- package/dist/{chunk-JJBE3TIH.cjs → chunk-2IWC4FP7.cjs} +6 -6
- package/dist/{chunk-S4W6Z2MN.js → chunk-2X7NGX3M.js} +3 -3
- package/dist/{chunk-NGKREZ36.js → chunk-3OYVN53V.js} +505 -5
- package/dist/{chunk-GQT4TYKY.cjs → chunk-3OZACAFQ.cjs} +44 -19
- package/dist/{chunk-T2QCTZMO.js → chunk-4SDKXQ4C.js} +3 -3
- package/dist/{chunk-253GBQZY.cjs → chunk-5H2G27PK.cjs} +35 -35
- package/dist/{chunk-C2A5DUMF.cjs → chunk-5NWINHR5.cjs} +35 -35
- package/dist/{chunk-D54CNIAJ.cjs → chunk-7H33U5SM.cjs} +2 -2
- package/dist/{chunk-CXFDRBQU.cjs → chunk-7M3PNU2M.cjs} +7 -7
- package/dist/{chunk-WJIHFLMJ.js → chunk-ADADVMXY.js} +2 -2
- package/dist/{chunk-NHWSN2SD.cjs → chunk-AVJHHUC5.cjs} +17 -17
- package/dist/{chunk-JCLBKPMX.js → chunk-BOVPWH4H.js} +48 -4
- package/dist/{chunk-ZZEI7MV4.js → chunk-CCATWPXM.js} +3 -3
- package/dist/{chunk-NBMHU6SW.js → chunk-CMT5NMMS.js} +3 -3
- package/dist/{chunk-HINXWAOD.cjs → chunk-CR4FMIWL.cjs} +11 -11
- package/dist/{chunk-IZM5VQZD.js → chunk-D3STJ56J.js} +3 -3
- package/dist/{chunk-EUDQTK7N.cjs → chunk-DAKRKDZV.cjs} +27 -38
- package/dist/{chunk-ZBQXLH2L.js → chunk-DHO2YRIM.js} +3 -3
- package/dist/{chunk-RVBHAXFG.js → chunk-DXWOTOUK.js} +16 -11
- package/dist/{chunk-F43YAA34.js → chunk-E47Z63DF.js} +3 -3
- package/dist/{chunk-62FBK3B7.js → chunk-FFAOS5HQ.js} +4 -4
- package/dist/{chunk-UM6C3CGK.js → chunk-FS7BFHFN.js} +28 -3
- package/dist/{chunk-SJBGLS25.cjs → chunk-FXIO6GHT.cjs} +5 -5
- package/dist/{chunk-XUUVDHIF.cjs → chunk-HKEXJUWS.cjs} +48 -3
- package/dist/{chunk-NXZFOPVD.cjs → chunk-HNDK4IQU.cjs} +16 -16
- package/dist/{chunk-SMIWS6DE.cjs → chunk-IELX2OKI.js} +118 -7
- package/dist/{chunk-KH4CNH66.cjs → chunk-IMGDUSTT.cjs} +4 -4
- package/dist/{chunk-LICPB5HZ.cjs → chunk-IUDGEUDO.cjs} +10 -10
- package/dist/{chunk-73FELZVJ.cjs → chunk-IWC5DM2M.cjs} +11 -11
- package/dist/{chunk-PHVRG4I2.js → chunk-J7XZV333.js} +3 -3
- package/dist/{chunk-K4VVR7CN.cjs → chunk-JBNDTXXV.cjs} +15 -15
- package/dist/{chunk-3NFFOWGG.js → chunk-KFIXE2MB.js} +14 -5
- package/dist/{chunk-B4TFTDG4.js → chunk-LCEXRE5Z.js} +3 -3
- package/dist/{chunk-IVSZDECV.js → chunk-LHAXPADA.js} +3 -3
- package/dist/{chunk-7CUEMLDZ.cjs → chunk-LKBTCABN.cjs} +540 -38
- package/dist/{chunk-AYBXB26F.js → chunk-LOGP3JWH.js} +5 -5
- package/dist/{chunk-KVRSTFNH.cjs → chunk-NCWCUZNS.cjs} +8 -8
- package/dist/{chunk-NV4VMVXU.js → chunk-NNFA2C3Y.js} +3 -3
- package/dist/{chunk-HZSPDCXV.cjs → chunk-O7WLJ53D.cjs} +3 -3
- package/dist/{chunk-MGE5Z4GS.js → chunk-OH2FAIVU.js} +3 -3
- package/dist/{chunk-UMABK6SI.js → chunk-PY37LNDP.js} +3 -3
- package/dist/{chunk-23J755AR.js → chunk-QD32ADK6.js} +3 -3
- package/dist/chunk-QRPRIJ2W.js +1525 -0
- package/dist/{chunk-HZTDET3N.js → chunk-R24NNAEG.js} +3 -3
- package/dist/{chunk-W7VDOASB.cjs → chunk-RMTPN3G4.cjs} +5 -5
- package/dist/{chunk-6DPSFNJB.cjs → chunk-ROHLEP2W.cjs} +16 -16
- package/dist/{chunk-3HYYMEXI.cjs → chunk-SMRVK6BI.cjs} +17 -12
- package/dist/{chunk-25IQCHTO.cjs → chunk-TWUXUCEW.cjs} +35 -35
- package/dist/{chunk-KEFNV2WM.cjs → chunk-U7IUS5HJ.cjs} +13 -13
- package/dist/{chunk-3AO425MZ.cjs → chunk-UFZZ7TSN.cjs} +17 -17
- package/dist/chunk-UPXIY52O.cjs +1562 -0
- package/dist/{chunk-BE4UJCQT.js → chunk-UWJHCOH2.js} +3 -3
- package/dist/{chunk-7HIASF7S.cjs → chunk-XB274MW5.cjs} +10 -10
- package/dist/{chunk-RARB3MBR.js → chunk-YDPEHCCI.cjs} +127 -3
- package/dist/{chunk-KJLB4OPV.js → chunk-YN2YWTXW.js} +3 -3
- package/dist/{chunk-IPWSXCCN.js → chunk-YVD3CSO3.js} +3 -3
- package/dist/{chunk-OR4Q2BGL.cjs → chunk-YWOBW2PV.cjs} +15 -15
- package/dist/{chunk-JX7YL6ZE.js → chunk-ZPYP4RBA.js} +4 -4
- package/dist/compiler/android-xr.cjs +5 -5
- package/dist/compiler/android-xr.js +3 -3
- package/dist/compiler/babylon.cjs +4 -4
- package/dist/compiler/babylon.js +3 -3
- package/dist/compiler/business-quest.cjs +9 -9
- package/dist/compiler/business-quest.js +1 -1
- package/dist/compiler/domain-block-utils.cjs +154 -150
- package/dist/compiler/domain-block-utils.js +2 -2
- package/dist/compiler/gltf-pipeline.cjs +8 -8
- package/dist/compiler/gltf-pipeline.js +1 -1
- package/dist/compiler/godot.cjs +4 -4
- package/dist/compiler/godot.js +3 -3
- package/dist/compiler/index.cjs +129 -581
- package/dist/compiler/index.d.ts +12 -0
- package/dist/compiler/index.js +42 -498
- package/dist/compiler/multi-layer.cjs +5 -5
- package/dist/compiler/multi-layer.js +4 -4
- package/dist/compiler/nodetoy.d.ts +69 -0
- package/dist/compiler/openxr.cjs +4 -4
- package/dist/compiler/openxr.js +3 -3
- package/dist/compiler/playcanvas.cjs +4 -4
- package/dist/compiler/playcanvas.js +3 -3
- package/dist/compiler/r3f.cjs +9 -8
- package/dist/compiler/r3f.js +4 -3
- package/dist/compiler/sdf.cjs +5 -5
- package/dist/compiler/sdf.js +3 -3
- package/dist/compiler/unity.cjs +4 -4
- package/dist/compiler/unity.js +3 -3
- package/dist/compiler/unreal.cjs +5 -5
- package/dist/compiler/unreal.js +3 -3
- package/dist/compiler/urdf.cjs +12 -12
- package/dist/compiler/urdf.js +3 -3
- package/dist/compiler/usd-physics.cjs +5 -5
- package/dist/compiler/usd-physics.js +2 -2
- package/dist/compiler/visionos.cjs +4 -4
- package/dist/compiler/visionos.js +3 -3
- package/dist/compiler/vrchat.cjs +5 -5
- package/dist/compiler/vrchat.js +3 -3
- package/dist/compiler/vrr.cjs +5 -5
- package/dist/compiler/vrr.js +3 -3
- package/dist/compiler/wasm.cjs +8 -8
- package/dist/compiler/wasm.js +3 -3
- package/dist/compiler/webgpu.cjs +4 -4
- package/dist/compiler/webgpu.js +3 -3
- package/dist/debugger.cjs +5 -5
- package/dist/debugger.js +3 -3
- package/dist/dist-ACXG6IH5.cjs +3113 -0
- package/dist/dist-VD4L6V7Q.js +3076 -0
- package/dist/index.cjs +1894 -559
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1448 -113
- package/dist/reconstruction/index.cjs +31 -31
- package/dist/reconstruction/index.js +2 -2
- package/dist/runtime.cjs +150 -293
- package/dist/runtime.js +82 -23
- package/dist/src-4ROC227P.cjs +2094 -0
- package/dist/src-HCCCSYP7.js +2073 -0
- package/dist/traits/botanical-lotus.cjs +162 -10
- package/dist/traits/botanical-lotus.d.ts +330 -0
- package/dist/traits/botanical-lotus.js +4 -1
- package/dist/traits/index.cjs +610 -455
- package/dist/traits/index.js +9 -5
- package/package.json +23 -23
- package/dist/HoloScriptRuntime-3URVTKPJ.js +0 -10
- package/dist/chunk-VECQYRXL.js +0 -474
- package/dist/chunk-WDT3JTGM.cjs +0 -483
package/dist/compiler/index.d.ts
CHANGED
|
@@ -472,3 +472,15 @@ export class FlatSemanticCompiler extends CompilerBase {
|
|
|
472
472
|
compile(ast: any, ...args: any[]): any;
|
|
473
473
|
[key: string]: any;
|
|
474
474
|
}
|
|
475
|
+
// Native2DCompiler — .holo composition → hydration-free HTML / React (I.017).
|
|
476
|
+
// Consumed via @holoscript/core/compiler by the studio Founder Console native
|
|
477
|
+
// route (packages/studio/src/app/quest-proof/native/route.ts, N1/N2 lane).
|
|
478
|
+
export interface Native2DCompilerOptions {
|
|
479
|
+
format?: 'html' | 'react';
|
|
480
|
+
minify?: boolean;
|
|
481
|
+
}
|
|
482
|
+
export class Native2DCompiler extends CompilerBase {
|
|
483
|
+
constructor(options?: Native2DCompilerOptions);
|
|
484
|
+
compile(ast: any, agentToken: string, outputPath?: string, options?: Native2DCompilerOptions): string | any;
|
|
485
|
+
[key: string]: any;
|
|
486
|
+
}
|
package/dist/compiler/index.js
CHANGED
|
@@ -1,77 +1,77 @@
|
|
|
1
1
|
export { createReproducibilityContext, parseReproducibilityFlags } from '../chunk-5GLCTO44.js';
|
|
2
2
|
export { ContextCompileError, ContextCompiler, createContextCompiler } from '../chunk-QXH7QDSZ.js';
|
|
3
3
|
export { LLMCapabilityCompileError, LLMProviderCapabilitiesCompiler, createLLMProviderCapabilitiesCompiler } from '../chunk-DAJXW4KX.js';
|
|
4
|
-
export { GLTF_PIPELINE_TOOLS, registerGLTFTools } from '../chunk-
|
|
5
|
-
export { BUSINESS_QUEST_TOOLS, buildVRRCompositionFromDraft, businessVRRDraftSchema, draftToHoloPreview, handleBusinessQuestToolCall, registerBusinessQuestTools, validateBusinessVRRDraft } from '../chunk-
|
|
4
|
+
export { GLTF_PIPELINE_TOOLS, registerGLTFTools } from '../chunk-LCEXRE5Z.js';
|
|
5
|
+
export { BUSINESS_QUEST_TOOLS, buildVRRCompositionFromDraft, businessVRRDraftSchema, draftToHoloPreview, handleBusinessQuestToolCall, registerBusinessQuestTools, validateBusinessVRRDraft } from '../chunk-ADADVMXY.js';
|
|
6
6
|
export { NodeToyMapper, mapNodeToyToShader } from '../chunk-TG7O4WBC.js';
|
|
7
7
|
export { QuantumCircuitCompiler } from '../chunk-ZU7NIRT6.js';
|
|
8
|
-
import { init_ThreeJSCompiler, ThreeJSCompiler_exports, init_A2AAgentCardCompiler, A2AAgentCardCompiler_exports, init_NIRCompiler, NIRCompiler_exports } from '../chunk-
|
|
9
|
-
export { CompilerBridge, GaussianSplattingCompiler, SHARED_SORT_SHADER_PATH, SpatialPartitionPass, USDZPipeline, bestCategoryForTraits, compilePipelineSource, compilePipelineSourceToNode, compilePipelineSourceToPython, compilePipelineToNode, compilePipelineToPython, createGaussianSplattingCompiler, detectMultiUserSharedSort, quickSafetyCheck, runSafetyPass, selectModality, selectModalityForAll, spatialPartition } from '../chunk-
|
|
8
|
+
import { init_Native2DCompiler, init_ThreeJSCompiler, ThreeJSCompiler_exports, init_A2AAgentCardCompiler, A2AAgentCardCompiler_exports, init_NIRCompiler, NIRCompiler_exports, Native2DCompiler_exports, Native2DCompiler } from '../chunk-3OYVN53V.js';
|
|
9
|
+
export { CompilerBridge, GaussianSplattingCompiler, Native2DCompiler, SHARED_SORT_SHADER_PATH, SpatialPartitionPass, USDZPipeline, bestCategoryForTraits, compilePipelineSource, compilePipelineSourceToNode, compilePipelineSourceToPython, compilePipelineToNode, compilePipelineToPython, createGaussianSplattingCompiler, detectMultiUserSharedSort, quickSafetyCheck, runSafetyPass, selectModality, selectModalityForAll, spatialPartition } from '../chunk-3OYVN53V.js';
|
|
10
10
|
export { generateHullGeometry, generateMembraneGeometry, generateSplineGeometry } from '../chunk-EKBKLK7P.js';
|
|
11
11
|
export { SemanticSceneGraph } from '../chunk-HYNTS5CP.js';
|
|
12
12
|
import '../chunk-V6MKC2FZ.js';
|
|
13
13
|
import { assertHoloMapManifestContract } from '../chunk-MBOOR7X4.js';
|
|
14
14
|
export { COCOExporterImpl as COCOExporter } from '../chunk-Q56TT7IL.js';
|
|
15
15
|
export { RemotionBridgeImpl as RemotionBridge } from '../chunk-YYXH45E2.js';
|
|
16
|
-
import { vrTraitRegistry } from '../chunk-
|
|
16
|
+
import { vrTraitRegistry } from '../chunk-DXWOTOUK.js';
|
|
17
17
|
import '../chunk-QPOQ7VPI.js';
|
|
18
18
|
import { isWebGpuEnvironmentPresent } from '../chunk-YF2I3MV3.js';
|
|
19
19
|
import '../chunk-TDCNJHWO.js';
|
|
20
|
-
import '../chunk-VECQYRXL.js';
|
|
21
20
|
import '../chunk-YQELFNJV.js';
|
|
22
21
|
import '../chunk-FHP6LXJS.js';
|
|
23
22
|
export { IncrementalCompiler, createIncrementalCompiler } from '../chunk-GYZE55MO.js';
|
|
24
23
|
import '../chunk-2M2DPHKB.js';
|
|
25
24
|
import '../chunk-4R6SBXDB.js';
|
|
26
|
-
import { init_WASMCompiler, WASMCompiler_exports } from '../chunk-
|
|
27
|
-
export { WASMCompiler } from '../chunk-
|
|
28
|
-
import { init_WebGPUCompiler, WebGPUCompiler_exports, WebGPUCompiler } from '../chunk-
|
|
29
|
-
export { WebGPUCompiler } from '../chunk-
|
|
25
|
+
import { init_WASMCompiler, WASMCompiler_exports } from '../chunk-YVD3CSO3.js';
|
|
26
|
+
export { WASMCompiler } from '../chunk-YVD3CSO3.js';
|
|
27
|
+
import { init_WebGPUCompiler, WebGPUCompiler_exports, WebGPUCompiler } from '../chunk-CMT5NMMS.js';
|
|
28
|
+
export { WebGPUCompiler } from '../chunk-CMT5NMMS.js';
|
|
30
29
|
import { init_DTDLCompiler, DTDLCompiler_exports } from '../chunk-J6M4FPK5.js';
|
|
31
30
|
export { DTDLCompiler } from '../chunk-J6M4FPK5.js';
|
|
32
|
-
import { init_URDFCompiler, URDFCompiler_exports } from '../chunk-
|
|
33
|
-
export { URDFCompiler, createURDFCompiler } from '../chunk-
|
|
34
|
-
export { USDPhysicsCompiler } from '../chunk-
|
|
35
|
-
import { init_SDFCompiler, SDFCompiler_exports } from '../chunk-
|
|
36
|
-
export { SDFCompiler } from '../chunk-
|
|
31
|
+
import { init_URDFCompiler, URDFCompiler_exports } from '../chunk-R24NNAEG.js';
|
|
32
|
+
export { URDFCompiler, createURDFCompiler } from '../chunk-R24NNAEG.js';
|
|
33
|
+
export { USDPhysicsCompiler } from '../chunk-LHAXPADA.js';
|
|
34
|
+
import { init_SDFCompiler, SDFCompiler_exports } from '../chunk-OH2FAIVU.js';
|
|
35
|
+
export { SDFCompiler } from '../chunk-OH2FAIVU.js';
|
|
37
36
|
import { init_StateCompiler, StateCompiler_exports } from '../chunk-ANXZFVY2.js';
|
|
38
37
|
export { StateCompiler } from '../chunk-ANXZFVY2.js';
|
|
39
38
|
export { TraitCompositionCompiler } from '../chunk-XKTPFXGA.js';
|
|
40
|
-
import { init_UnrealCompiler, UnrealCompiler_exports } from '../chunk-
|
|
41
|
-
import { init_GodotCompiler, GodotCompiler_exports } from '../chunk-
|
|
42
|
-
export { GodotCompiler } from '../chunk-
|
|
43
|
-
import { init_R3FCompiler, R3FCompiler_exports } from '../chunk-
|
|
44
|
-
export { ENVIRONMENT_PRESETS, R3FCompiler } from '../chunk-
|
|
39
|
+
import { init_UnrealCompiler, UnrealCompiler_exports } from '../chunk-D3STJ56J.js';
|
|
40
|
+
import { init_GodotCompiler, GodotCompiler_exports } from '../chunk-PY37LNDP.js';
|
|
41
|
+
export { GodotCompiler } from '../chunk-PY37LNDP.js';
|
|
42
|
+
import { init_R3FCompiler, R3FCompiler_exports } from '../chunk-FS7BFHFN.js';
|
|
43
|
+
export { ENVIRONMENT_PRESETS, R3FCompiler } from '../chunk-FS7BFHFN.js';
|
|
45
44
|
import '../chunk-XT6JY5W5.js';
|
|
46
|
-
import
|
|
47
|
-
|
|
45
|
+
import '../chunk-QRPRIJ2W.js';
|
|
46
|
+
import { init_PlayCanvasCompiler, PlayCanvasCompiler_exports } from '../chunk-DHO2YRIM.js';
|
|
47
|
+
export { PlayCanvasCompiler } from '../chunk-DHO2YRIM.js';
|
|
48
48
|
import { init_AndroidCompiler, AndroidCompiler_exports } from '../chunk-WRKUDAZJ.js';
|
|
49
49
|
export { AndroidCompiler } from '../chunk-WRKUDAZJ.js';
|
|
50
|
-
import { init_AndroidXRCompiler, init_AndroidXRTraitMap, AndroidXRCompiler_exports, AndroidXRCompiler, getTraitMapping, ANDROIDXR_TRAIT_MAP } from '../chunk-
|
|
51
|
-
export { AndroidXRCompiler } from '../chunk-
|
|
50
|
+
import { init_AndroidXRCompiler, init_AndroidXRTraitMap, AndroidXRCompiler_exports, AndroidXRCompiler, getTraitMapping, ANDROIDXR_TRAIT_MAP } from '../chunk-YN2YWTXW.js';
|
|
51
|
+
export { AndroidXRCompiler } from '../chunk-YN2YWTXW.js';
|
|
52
52
|
import '../chunk-FDSGHPAK.js';
|
|
53
53
|
import { init_IOSCompiler, IOSCompiler_exports } from '../chunk-OMXII44L.js';
|
|
54
54
|
export { IOSCompiler } from '../chunk-OMXII44L.js';
|
|
55
|
-
import { init_VisionOSCompiler, init_VisionOSTraitMap, VisionOSCompiler_exports, getTraitMapping as getTraitMapping$1, listAllTraits, generateTraitCode } from '../chunk-
|
|
56
|
-
export { VisionOSCompiler } from '../chunk-
|
|
57
|
-
export { MultiLayerCompiler } from '../chunk-
|
|
58
|
-
import { init_VRRCompiler, VRRCompiler_exports } from '../chunk-
|
|
59
|
-
export { VRRCompiler } from '../chunk-
|
|
55
|
+
import { init_VisionOSCompiler, init_VisionOSTraitMap, VisionOSCompiler_exports, getTraitMapping as getTraitMapping$1, listAllTraits, generateTraitCode } from '../chunk-2X7NGX3M.js';
|
|
56
|
+
export { VisionOSCompiler } from '../chunk-2X7NGX3M.js';
|
|
57
|
+
export { MultiLayerCompiler } from '../chunk-FFAOS5HQ.js';
|
|
58
|
+
import { init_VRRCompiler, VRRCompiler_exports } from '../chunk-4SDKXQ4C.js';
|
|
59
|
+
export { VRRCompiler } from '../chunk-4SDKXQ4C.js';
|
|
60
60
|
import { init_ARCompiler, ARCompiler_exports } from '../chunk-UJXISJBN.js';
|
|
61
61
|
export { ARCompiler } from '../chunk-UJXISJBN.js';
|
|
62
|
-
import { init_OpenXRCompiler, OpenXRCompiler_exports } from '../chunk-
|
|
63
|
-
export { OpenXRCompiler } from '../chunk-
|
|
64
|
-
import { init_VRChatCompiler, VRChatCompiler_exports } from '../chunk-
|
|
65
|
-
export { VRChatCompiler } from '../chunk-
|
|
66
|
-
import { init_BabylonCompiler, BabylonCompiler_exports } from '../chunk-
|
|
67
|
-
export { BabylonCompiler } from '../chunk-
|
|
62
|
+
import { init_OpenXRCompiler, OpenXRCompiler_exports } from '../chunk-QD32ADK6.js';
|
|
63
|
+
export { OpenXRCompiler } from '../chunk-QD32ADK6.js';
|
|
64
|
+
import { init_VRChatCompiler, VRChatCompiler_exports } from '../chunk-UWJHCOH2.js';
|
|
65
|
+
export { VRChatCompiler } from '../chunk-UWJHCOH2.js';
|
|
66
|
+
import { init_BabylonCompiler, BabylonCompiler_exports } from '../chunk-J7XZV333.js';
|
|
67
|
+
export { BabylonCompiler } from '../chunk-J7XZV333.js';
|
|
68
68
|
import '../chunk-TJHVSBP2.js';
|
|
69
69
|
import '../chunk-4C57PR42.js';
|
|
70
|
-
import { init_UnityCompiler, UnityCompiler_exports } from '../chunk-
|
|
71
|
-
export { UnityCompiler } from '../chunk-
|
|
70
|
+
import { init_UnityCompiler, UnityCompiler_exports } from '../chunk-CCATWPXM.js';
|
|
71
|
+
export { UnityCompiler } from '../chunk-CCATWPXM.js';
|
|
72
72
|
import { init_PlatformConditionalCompilerMixin } from '../chunk-GZG4KA4E.js';
|
|
73
73
|
export { PlatformConditionalCompilerMixin, createPlatformTarget, filterCompositionForPlatform, matchesPlatformConstraint, normalizePlatformName } from '../chunk-GZG4KA4E.js';
|
|
74
|
-
import '../chunk-
|
|
74
|
+
import '../chunk-BOVPWH4H.js';
|
|
75
75
|
import { init_CompilerBase, CompilerBase, init_ANSNamespace, ANSCapabilityPath, init_CompilerDocumentationGenerator } from '../chunk-QPSKHBJP.js';
|
|
76
76
|
export { CompilerBase, CompilerDocumentationGenerator, UnauthorizedCompilerAccessError, createTestCompilerToken, isCapabilityTokenCredential } from '../chunk-QPSKHBJP.js';
|
|
77
77
|
import { init_traitDocs, getTraitDoc, getAllTraitNames } from '../chunk-THCK6ECW.js';
|
|
@@ -86,466 +86,10 @@ import '../chunk-CBJY23VL.js';
|
|
|
86
86
|
import { ExpressionEvaluator } from '../chunk-XL6INWKT.js';
|
|
87
87
|
import '../chunk-H652NHX5.js';
|
|
88
88
|
import '../chunk-PHENW4MQ.js';
|
|
89
|
-
import
|
|
89
|
+
import '../chunk-VVKVQZI6.js';
|
|
90
90
|
import { __export, __esm, __toCommonJS } from '../chunk-OL46QLBJ.js';
|
|
91
91
|
import { ANSCapabilityPath as ANSCapabilityPath$1 } from '@holoscript/core-types/ans';
|
|
92
92
|
|
|
93
|
-
// src/compiler/Native2DCompiler.ts
|
|
94
|
-
var Native2DCompiler_exports = {};
|
|
95
|
-
__export(Native2DCompiler_exports, {
|
|
96
|
-
Native2DCompiler: () => Native2DCompiler
|
|
97
|
-
});
|
|
98
|
-
var Native2DCompiler;
|
|
99
|
-
var init_Native2DCompiler = __esm({
|
|
100
|
-
"src/compiler/Native2DCompiler.ts"() {
|
|
101
|
-
init_CompilerBase();
|
|
102
|
-
init_safeJsonParse();
|
|
103
|
-
Native2DCompiler = class extends CompilerBase {
|
|
104
|
-
constructor() {
|
|
105
|
-
super(...arguments);
|
|
106
|
-
this.compilerName = "Native2DCompiler";
|
|
107
|
-
// ============================================================================
|
|
108
|
-
// REACT GENERATION
|
|
109
|
-
// ============================================================================
|
|
110
|
-
/** Collected during node traversal — used to generate imports and hooks */
|
|
111
|
-
this._slotImports = /* @__PURE__ */ new Map();
|
|
112
|
-
this._uiImports = /* @__PURE__ */ new Set();
|
|
113
|
-
this._stateFields = /* @__PURE__ */ new Map();
|
|
114
|
-
this._fetchCalls = [];
|
|
115
|
-
this._options = {};
|
|
116
|
-
}
|
|
117
|
-
// @ts-expect-error During migration
|
|
118
|
-
compile(composition, agentToken, outputPath, options) {
|
|
119
|
-
this.validateCompilerAccess(agentToken, outputPath);
|
|
120
|
-
const isReact = options?.format === "react";
|
|
121
|
-
const elements = composition.ui?.elements || composition.objects || [];
|
|
122
|
-
if (isReact) {
|
|
123
|
-
const code2 = this.generateReactComponent(composition.name, elements, composition, options);
|
|
124
|
-
return this.withTripleOutputIfRequested(composition, code2, options);
|
|
125
|
-
}
|
|
126
|
-
const code = this.generateHTMLPage(composition.name, elements, composition);
|
|
127
|
-
return this.withTripleOutputIfRequested(composition, code, options);
|
|
128
|
-
}
|
|
129
|
-
generateReactComponent(name, objects, composition, options) {
|
|
130
|
-
this._slotImports.clear();
|
|
131
|
-
this._uiImports.clear();
|
|
132
|
-
this._stateFields.clear();
|
|
133
|
-
this._fetchCalls = [];
|
|
134
|
-
this._options = options || {};
|
|
135
|
-
const safeName = name.replace(/[^a-zA-Z0-9]/g, "");
|
|
136
|
-
if (composition?.state?.properties) {
|
|
137
|
-
for (const prop of composition.state.properties) {
|
|
138
|
-
this._stateFields.set(prop.key, prop.value ?? null);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
const jsx = objects.map((obj) => this.generateReactNode(obj)).join("\n ");
|
|
142
|
-
const imports = [];
|
|
143
|
-
const reactImports = /* @__PURE__ */ new Set();
|
|
144
|
-
if (this._stateFields.size > 0) reactImports.add("useState");
|
|
145
|
-
if (this._fetchCalls.length > 0) reactImports.add("useEffect");
|
|
146
|
-
imports.push(
|
|
147
|
-
reactImports.size > 0 ? `import React, { ${[...reactImports].join(", ")} } from 'react';` : `import React from 'react';`
|
|
148
|
-
);
|
|
149
|
-
if (this._uiImports.size > 0) {
|
|
150
|
-
imports.push(`import { ${[...this._uiImports].join(", ")} } from '@holoscript/ui';`);
|
|
151
|
-
}
|
|
152
|
-
for (const [, slot] of this._slotImports) {
|
|
153
|
-
imports.push(`import { ${slot.component} } from '${slot.importPath}';`);
|
|
154
|
-
}
|
|
155
|
-
const stateHooks = [];
|
|
156
|
-
for (const [key, value] of this._stateFields) {
|
|
157
|
-
const capitalKey = key.charAt(0).toUpperCase() + key.slice(1);
|
|
158
|
-
const initValue = JSON.stringify(value);
|
|
159
|
-
stateHooks.push(
|
|
160
|
-
` const [${key}, set${capitalKey}] = useState(${initValue === void 0 ? "null" : initValue});`
|
|
161
|
-
);
|
|
162
|
-
}
|
|
163
|
-
const fetchEffects = [];
|
|
164
|
-
for (const f of this._fetchCalls) {
|
|
165
|
-
fetchEffects.push(` useEffect(() => {
|
|
166
|
-
fetch(\`${f.endpoint}\`${f.method !== "GET" ? `, { method: '${f.method}' }` : ""})
|
|
167
|
-
.then(r => r.json())
|
|
168
|
-
.then(set${f.name.charAt(0).toUpperCase() + f.name.slice(1)})
|
|
169
|
-
.catch(console.error);
|
|
170
|
-
}, []);`);
|
|
171
|
-
}
|
|
172
|
-
return `${imports.join("\n")}
|
|
173
|
-
|
|
174
|
-
// @generated by HoloScript Native2DCompiler \u2014 DO NOT EDIT
|
|
175
|
-
export function ${safeName}Component() {
|
|
176
|
-
${stateHooks.join("\n")}
|
|
177
|
-
${fetchEffects.join("\n")}
|
|
178
|
-
|
|
179
|
-
return (
|
|
180
|
-
<div className="holoscript-2d-root w-full h-full">
|
|
181
|
-
${jsx}
|
|
182
|
-
</div>
|
|
183
|
-
);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
export default ${safeName}Component;
|
|
187
|
-
`;
|
|
188
|
-
}
|
|
189
|
-
generateReactNode(obj) {
|
|
190
|
-
const traits = this.extractTraits(obj);
|
|
191
|
-
if (traits.slot) {
|
|
192
|
-
const slotName = traits.slot.name || obj.name || "Slot";
|
|
193
|
-
const configuredSlot = this._options.slots?.[String(slotName)];
|
|
194
|
-
const component = traits.slot.component || configuredSlot?.component || slotName;
|
|
195
|
-
const importPath = traits.slot.import || configuredSlot?.importPath || `@/components/${component}`;
|
|
196
|
-
this._slotImports.set(slotName, { component, importPath });
|
|
197
|
-
const propsStr = traits.slot.props ? ` {...${JSON.stringify(traits.slot.props)}}` : "";
|
|
198
|
-
return `<div data-holo-slot="${slotName}">
|
|
199
|
-
<${component}${propsStr} />
|
|
200
|
-
</div>`;
|
|
201
|
-
}
|
|
202
|
-
if (traits.fetch) {
|
|
203
|
-
const name = traits.fetch.into || "data";
|
|
204
|
-
const endpoint = traits.fetch.endpoint || "/api/data";
|
|
205
|
-
const method = traits.fetch.method || "GET";
|
|
206
|
-
this._fetchCalls.push({ name, endpoint, method });
|
|
207
|
-
if (!this._stateFields.has(name)) {
|
|
208
|
-
this._stateFields.set(name, null);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
let tag = traits.theme?.tag || traits.panel?.tag || (typeof obj.type === "string" ? obj.type.toLowerCase() : void 0) || "div";
|
|
212
|
-
if ([
|
|
213
|
-
"nav",
|
|
214
|
-
"section",
|
|
215
|
-
"main",
|
|
216
|
-
"footer",
|
|
217
|
-
"form",
|
|
218
|
-
"style",
|
|
219
|
-
"a",
|
|
220
|
-
"header",
|
|
221
|
-
"h1",
|
|
222
|
-
"h2",
|
|
223
|
-
"h3"
|
|
224
|
-
].includes(tag)) ; else if (tag === "container") {
|
|
225
|
-
tag = "div";
|
|
226
|
-
} else if (traits.link || tag === "link") {
|
|
227
|
-
tag = "a";
|
|
228
|
-
} else if (traits.button || tag === "button") {
|
|
229
|
-
tag = "button";
|
|
230
|
-
} else if (traits.image || tag === "image") {
|
|
231
|
-
tag = "img";
|
|
232
|
-
} else if (traits.input || tag === "input") {
|
|
233
|
-
tag = "input";
|
|
234
|
-
} else if (traits.text || tag === "text") {
|
|
235
|
-
tag = this.mapTextVariantToTag(traits.text?.variant || "body");
|
|
236
|
-
} else {
|
|
237
|
-
tag = "div";
|
|
238
|
-
}
|
|
239
|
-
const styles = this.buildStyles(traits);
|
|
240
|
-
const classes = this.buildClasses(traits);
|
|
241
|
-
let props = ``;
|
|
242
|
-
if (traits.theme?.className) {
|
|
243
|
-
classes.push(traits.theme.className);
|
|
244
|
-
}
|
|
245
|
-
if (traits.theme?.id) {
|
|
246
|
-
props += ` id="${traits.theme.id}"`;
|
|
247
|
-
}
|
|
248
|
-
const combinedStyles = { ...styles };
|
|
249
|
-
if (traits.theme?.style) {
|
|
250
|
-
traits.theme.style.split(";").forEach((rule) => {
|
|
251
|
-
const [key, ...valueParts] = rule.split(":");
|
|
252
|
-
const value = valueParts.join(":");
|
|
253
|
-
if (key && value) {
|
|
254
|
-
const camelKey = key.trim().replace(/-([a-z])/g, (g) => g[1].toUpperCase());
|
|
255
|
-
combinedStyles[camelKey] = value.trim();
|
|
256
|
-
}
|
|
257
|
-
});
|
|
258
|
-
}
|
|
259
|
-
if (Object.keys(combinedStyles).length > 0) {
|
|
260
|
-
props += ` style={${JSON.stringify(combinedStyles)}}`;
|
|
261
|
-
}
|
|
262
|
-
if (classes.length > 0) {
|
|
263
|
-
props += ` className="${classes.join(" ")}"`;
|
|
264
|
-
}
|
|
265
|
-
if (traits.theme?.attributes) {
|
|
266
|
-
try {
|
|
267
|
-
const parsedAttrs = readJson(traits.theme.attributes);
|
|
268
|
-
for (const [key, value] of Object.entries(parsedAttrs)) {
|
|
269
|
-
props += ` ${key}="${value}"`;
|
|
270
|
-
}
|
|
271
|
-
} catch (e) {
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
if (traits.button?.onClick || traits.form?.onSubmit) {
|
|
275
|
-
const action = traits.button?.onClick || traits.form?.onSubmit;
|
|
276
|
-
if (action) {
|
|
277
|
-
const cleanAction = action.replace(/["']/g, "'");
|
|
278
|
-
if (cleanAction.includes("navigate")) {
|
|
279
|
-
props += ` onClick={() => ${cleanAction}}`;
|
|
280
|
-
} else if (cleanAction.includes("submit")) {
|
|
281
|
-
props += ` onSubmit={${cleanAction}}`;
|
|
282
|
-
} else if (cleanAction.includes("window.open")) {
|
|
283
|
-
props += ` onClick={() => ${cleanAction}}`;
|
|
284
|
-
} else {
|
|
285
|
-
props += ` onClick={() => console.log('${cleanAction}')}`;
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
if (traits.image?.src) props += ` src="${traits.image.src}"`;
|
|
290
|
-
if (traits.image?.alt) props += ` alt="${traits.image.alt}"`;
|
|
291
|
-
if (traits.link?.href) props += ` href="${traits.link.href}"`;
|
|
292
|
-
if (traits.input?.placeholder) props += ` placeholder="${traits.input.placeholder}"`;
|
|
293
|
-
if (traits.input?.type) props += ` type="${traits.input.type}"`;
|
|
294
|
-
if (traits.input?.required) props += ` required`;
|
|
295
|
-
if (traits.button?.type) props += ` type="${traits.button.type}"`;
|
|
296
|
-
const childrenMarkup = (obj.children || obj.objects || []).map((child) => this.generateReactNode(child)).join("\n");
|
|
297
|
-
const content = traits.text?.content || traits.button?.content || traits.link?.content || traits.icon?.name;
|
|
298
|
-
let safeContent = "";
|
|
299
|
-
if (content) {
|
|
300
|
-
safeContent = `{\`${content.replace(/`/g, "\\`").replace(/\$/g, "\\$")}\`}`;
|
|
301
|
-
}
|
|
302
|
-
if (tag === "style") {
|
|
303
|
-
const escapedStyle = (content || "").replace(/`/g, "\\`").replace(/\$/g, "\\$");
|
|
304
|
-
return `<style dangerouslySetInnerHTML={{ __html: \`${escapedStyle}\` }} />`;
|
|
305
|
-
}
|
|
306
|
-
if (tag === "img" || tag === "input") {
|
|
307
|
-
return `<${tag}${props} />`;
|
|
308
|
-
}
|
|
309
|
-
return `<${tag}${props}>
|
|
310
|
-
${safeContent}
|
|
311
|
-
${childrenMarkup}
|
|
312
|
-
</${tag}>`;
|
|
313
|
-
}
|
|
314
|
-
// ============================================================================
|
|
315
|
-
// HTML GENERATION
|
|
316
|
-
// ============================================================================
|
|
317
|
-
generateHTMLPage(name, objects, composition) {
|
|
318
|
-
const content = objects.map((obj) => this.generateHTMLNode(obj)).join("\n ");
|
|
319
|
-
let bgColor = "#ffffff";
|
|
320
|
-
let color = "#000000";
|
|
321
|
-
if (composition.environment?.properties) {
|
|
322
|
-
const themeProp = composition.environment.properties.find((p) => p.key === "theme");
|
|
323
|
-
const bgProp = composition.environment.properties.find((p) => p.key === "backgroundColor");
|
|
324
|
-
if (themeProp?.value === "dark" || composition.traits?.some((t) => t.name === "theme" && t.config?.dark)) {
|
|
325
|
-
bgColor = bgProp?.value || "#050510";
|
|
326
|
-
color = "#ffffff";
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
return `<!DOCTYPE html>
|
|
330
|
-
<html lang="en">
|
|
331
|
-
<head>
|
|
332
|
-
<meta charset="UTF-8">
|
|
333
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
334
|
-
<title>${name}</title>
|
|
335
|
-
<script src="https://cdn.tailwindcss.com"></script>
|
|
336
|
-
<style>
|
|
337
|
-
body { margin: 0; padding: 0; background-color: ${bgColor}; color: ${color}; font-family: system-ui, -apple-system, sans-serif; }
|
|
338
|
-
/* Basic resets and custom trait animations to mirror React Framer variants */
|
|
339
|
-
.glow-btn:hover { box-shadow: 0 0 15px rgba(255,255,255,0.5); }
|
|
340
|
-
.lift-card { transition: transform 0.2s ease, box-shadow 0.2s ease; }
|
|
341
|
-
.lift-card:hover { transform: translateY(-4px); box-shadow: 0 10px 20px rgba(0,0,0,0.2); }
|
|
342
|
-
</style>
|
|
343
|
-
</head>
|
|
344
|
-
<body>
|
|
345
|
-
<div id="holoscript-native-root">
|
|
346
|
-
${content}
|
|
347
|
-
</div>
|
|
348
|
-
<script>
|
|
349
|
-
function navigate(path) { window.location.href = path; }
|
|
350
|
-
function submitNewsletter(e) { e.preventDefault(); alert('Subscribed!'); }
|
|
351
|
-
</script>
|
|
352
|
-
</body>
|
|
353
|
-
</html>`;
|
|
354
|
-
}
|
|
355
|
-
generateHTMLNode(obj) {
|
|
356
|
-
const node = obj;
|
|
357
|
-
const traits = this.extractTraits(obj);
|
|
358
|
-
const nodeType = typeof node.type === "string" ? node.type.toLowerCase() : void 0;
|
|
359
|
-
let tag = traits.theme?.tag || traits.panel?.tag || nodeType || "div";
|
|
360
|
-
if ([
|
|
361
|
-
"nav",
|
|
362
|
-
"section",
|
|
363
|
-
"main",
|
|
364
|
-
"footer",
|
|
365
|
-
"form",
|
|
366
|
-
"style",
|
|
367
|
-
"a",
|
|
368
|
-
"header",
|
|
369
|
-
"h1",
|
|
370
|
-
"h2",
|
|
371
|
-
"h3"
|
|
372
|
-
].includes(tag)) ; else if (tag === "container") {
|
|
373
|
-
tag = "div";
|
|
374
|
-
} else if (traits.link || tag === "link") {
|
|
375
|
-
tag = "a";
|
|
376
|
-
} else if (traits.button || tag === "button") {
|
|
377
|
-
tag = "button";
|
|
378
|
-
} else if (traits.image || tag === "image") {
|
|
379
|
-
tag = "img";
|
|
380
|
-
} else if (traits.input || tag === "input") {
|
|
381
|
-
tag = "input";
|
|
382
|
-
} else if (traits.text || tag === "text") {
|
|
383
|
-
tag = this.mapTextVariantToTag(traits.text?.variant || "body");
|
|
384
|
-
} else {
|
|
385
|
-
tag = "div";
|
|
386
|
-
}
|
|
387
|
-
const styles = this.buildStyles(traits);
|
|
388
|
-
const classes = this.buildClasses(traits);
|
|
389
|
-
let props = ``;
|
|
390
|
-
if (traits.theme?.className) {
|
|
391
|
-
classes.push(traits.theme.className);
|
|
392
|
-
}
|
|
393
|
-
if (traits.theme?.id) {
|
|
394
|
-
props += ` id="${traits.theme.id}"`;
|
|
395
|
-
}
|
|
396
|
-
if (Object.keys(styles).length > 0 || traits.theme?.style) {
|
|
397
|
-
let styleStr = Object.entries(styles).map(([k, v]) => `${this.camelToKebab(k)}: ${v}`).join("; ");
|
|
398
|
-
if (traits.theme?.style) {
|
|
399
|
-
styleStr += (styleStr ? "; " : "") + traits.theme.style;
|
|
400
|
-
}
|
|
401
|
-
props += ` style="${styleStr}"`;
|
|
402
|
-
}
|
|
403
|
-
if (classes.length > 0) {
|
|
404
|
-
props += ` class="${classes.join(" ")}"`;
|
|
405
|
-
}
|
|
406
|
-
if (traits.theme?.attributes) {
|
|
407
|
-
try {
|
|
408
|
-
const parsedAttrs = readJson(traits.theme.attributes);
|
|
409
|
-
for (const [key, value] of Object.entries(parsedAttrs)) {
|
|
410
|
-
props += ` ${key}="${value}"`;
|
|
411
|
-
}
|
|
412
|
-
} catch (e) {
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
if (traits.button?.onClick) props += ` onclick="${traits.button.onClick}"`;
|
|
416
|
-
if (traits.form?.onSubmit) props += ` onsubmit="${traits.form.onSubmit}"`;
|
|
417
|
-
if (traits.image?.src) props += ` src="${traits.image.src}"`;
|
|
418
|
-
if (traits.image?.alt) props += ` alt="${traits.image.alt}"`;
|
|
419
|
-
if (traits.link?.href) props += ` href="${traits.link.href}"`;
|
|
420
|
-
if (traits.input?.placeholder) props += ` placeholder="${traits.input.placeholder}"`;
|
|
421
|
-
if (traits.input?.type) props += ` type="${traits.input.type}"`;
|
|
422
|
-
if (traits.input?.required) props += ` required`;
|
|
423
|
-
const children = node.children || node.objects || [];
|
|
424
|
-
const childrenMarkup = children.map((child) => this.generateHTMLNode(child)).join("\n");
|
|
425
|
-
const content = traits.text?.content || traits.button?.content || traits.link?.content || traits.icon?.name;
|
|
426
|
-
if (tag === "img" || tag === "input") {
|
|
427
|
-
return `<${tag}${props}>`;
|
|
428
|
-
}
|
|
429
|
-
return `<${tag}${props}>
|
|
430
|
-
${content ? content : ""}
|
|
431
|
-
${childrenMarkup}
|
|
432
|
-
</${tag}>`;
|
|
433
|
-
}
|
|
434
|
-
// ============================================================================
|
|
435
|
-
// UTILITIES
|
|
436
|
-
// ============================================================================
|
|
437
|
-
extractTraits(obj) {
|
|
438
|
-
const map = {};
|
|
439
|
-
const node = obj;
|
|
440
|
-
if (!node.traits) return map;
|
|
441
|
-
for (const t of node.traits) {
|
|
442
|
-
map[t.name] = t.config || {};
|
|
443
|
-
if (t.name === "tailwind" && typeof t.config === "string") {
|
|
444
|
-
map[t.name] = { classes: t.config };
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
return map;
|
|
448
|
-
}
|
|
449
|
-
mapTextVariantToTag(variant) {
|
|
450
|
-
switch (variant) {
|
|
451
|
-
case "h1":
|
|
452
|
-
return "h1";
|
|
453
|
-
case "h2":
|
|
454
|
-
return "h2";
|
|
455
|
-
case "h3":
|
|
456
|
-
return "h3";
|
|
457
|
-
case "subtitle":
|
|
458
|
-
return "h4";
|
|
459
|
-
case "caption":
|
|
460
|
-
return "span";
|
|
461
|
-
case "emoji":
|
|
462
|
-
return "span";
|
|
463
|
-
default:
|
|
464
|
-
return "p";
|
|
465
|
-
}
|
|
466
|
-
}
|
|
467
|
-
buildStyles(traits) {
|
|
468
|
-
const styles = {};
|
|
469
|
-
const layout = traits.layout;
|
|
470
|
-
const theme = traits.theme;
|
|
471
|
-
if (layout) {
|
|
472
|
-
if (layout.flex) {
|
|
473
|
-
styles.display = "flex";
|
|
474
|
-
styles.flexDirection = layout.flex === "row" ? "row" : "column";
|
|
475
|
-
}
|
|
476
|
-
if (layout.grid) {
|
|
477
|
-
styles.display = "grid";
|
|
478
|
-
styles.gridTemplateColumns = `repeat(${layout.columns || 1}, minmax(0, 1fr))`;
|
|
479
|
-
}
|
|
480
|
-
if (layout.justify) styles.justifyContent = layout.justify;
|
|
481
|
-
if (layout.align) styles.alignItems = layout.align;
|
|
482
|
-
if (layout.gap) styles.gap = typeof layout.gap === "number" ? `${layout.gap}px` : layout.gap;
|
|
483
|
-
if (layout.padding)
|
|
484
|
-
styles.padding = typeof layout.padding === "number" ? `${layout.padding}px` : layout.padding;
|
|
485
|
-
}
|
|
486
|
-
if (theme) {
|
|
487
|
-
if (theme.backgroundColor) styles.backgroundColor = theme.backgroundColor;
|
|
488
|
-
if (theme.color) styles.color = theme.color;
|
|
489
|
-
if (theme.padding)
|
|
490
|
-
styles.padding = typeof theme.padding === "number" ? `${theme.padding}px` : theme.padding;
|
|
491
|
-
if (theme.borderRadius)
|
|
492
|
-
styles.borderRadius = typeof theme.borderRadius === "number" ? `${theme.borderRadius}px` : theme.borderRadius;
|
|
493
|
-
if (theme.border) styles.border = theme.border;
|
|
494
|
-
if (theme.borderTop) styles.borderTop = theme.borderTop;
|
|
495
|
-
}
|
|
496
|
-
if (traits.text) {
|
|
497
|
-
if (traits.text.align) styles.textAlign = traits.text.align;
|
|
498
|
-
if (traits.text.maxWidth)
|
|
499
|
-
styles.maxWidth = typeof traits.text.maxWidth === "number" ? `${traits.text.maxWidth}px` : traits.text.maxWidth;
|
|
500
|
-
if (traits.text.weight) styles.fontWeight = traits.text.weight;
|
|
501
|
-
}
|
|
502
|
-
return styles;
|
|
503
|
-
}
|
|
504
|
-
buildClasses(traits) {
|
|
505
|
-
const classes = [];
|
|
506
|
-
if (traits.text) {
|
|
507
|
-
if (traits.text.variant === "h1") classes.push("text-5xl font-bold tracking-tight");
|
|
508
|
-
if (traits.text.variant === "h2") classes.push("text-3xl font-bold");
|
|
509
|
-
if (traits.text.variant === "h3") classes.push("text-xl font-semibold");
|
|
510
|
-
if (traits.text.variant === "subtitle") classes.push("text-xl text-gray-400");
|
|
511
|
-
if (traits.text.variant === "caption") classes.push("text-sm text-gray-500");
|
|
512
|
-
if (traits.text.variant === "emoji") classes.push("text-2xl");
|
|
513
|
-
}
|
|
514
|
-
if (traits.button) {
|
|
515
|
-
classes.push("px-4 py-2 rounded-lg font-medium transition-all");
|
|
516
|
-
if (traits.button.variant === "primary")
|
|
517
|
-
classes.push("bg-blue-600 hover:bg-blue-700 text-white");
|
|
518
|
-
if (traits.button.variant === "outline")
|
|
519
|
-
classes.push("border border-gray-600 hover:bg-gray-800 text-white");
|
|
520
|
-
if (traits.button.variant === "ghost")
|
|
521
|
-
classes.push("hover:bg-gray-800 text-gray-300 hover:text-white");
|
|
522
|
-
if (traits.button.variant === "glow")
|
|
523
|
-
classes.push("bg-indigo-600 text-white glow-btn hover:bg-indigo-500");
|
|
524
|
-
if (traits.button.size === "lg") classes.push("px-6 py-3 text-lg");
|
|
525
|
-
if (traits.button.size === "sm") classes.push("px-3 py-1 text-sm");
|
|
526
|
-
}
|
|
527
|
-
if (traits.card) {
|
|
528
|
-
if (traits.card.shadow === "md") classes.push("shadow-md");
|
|
529
|
-
if (traits.card.shadow === "lg") classes.push("shadow-lg");
|
|
530
|
-
if (traits.card.hover === "glow") classes.push("lift-card");
|
|
531
|
-
}
|
|
532
|
-
if (traits.input) {
|
|
533
|
-
classes.push(
|
|
534
|
-
"px-4 py-2 rounded-lg border border-gray-700 bg-gray-900 text-white focus:ring-2 focus:ring-indigo-500 outline-none"
|
|
535
|
-
);
|
|
536
|
-
}
|
|
537
|
-
if (traits.tailwind?.classes) {
|
|
538
|
-
classes.push(traits.tailwind.classes);
|
|
539
|
-
}
|
|
540
|
-
return classes;
|
|
541
|
-
}
|
|
542
|
-
camelToKebab(str) {
|
|
543
|
-
return str.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
544
|
-
}
|
|
545
|
-
};
|
|
546
|
-
}
|
|
547
|
-
});
|
|
548
|
-
|
|
549
93
|
// src/compiler/NextJSAPICompiler.ts
|
|
550
94
|
var NextJSAPICompiler_exports = {};
|
|
551
95
|
__export(NextJSAPICompiler_exports, {
|
|
@@ -3399,7 +2943,7 @@ var DispatchPolicy = class {
|
|
|
3399
2943
|
});
|
|
3400
2944
|
}
|
|
3401
2945
|
async tryTier1Browser(op) {
|
|
3402
|
-
const available = isWebGpuEnvironmentPresent();
|
|
2946
|
+
const available = (this.config.webGpuProbe ?? isWebGpuEnvironmentPresent)();
|
|
3403
2947
|
const traitCompatible = this.isTraitSnnCompatible(op.trait);
|
|
3404
2948
|
if (!available || !traitCompatible) {
|
|
3405
2949
|
const reason = !available ? "WebGPU not available" : "Trait is not mapped to the SNN/WebGPU hot path";
|
|
@@ -3652,7 +3196,7 @@ async function runTier3CpuDirectExecutor(op) {
|
|
|
3652
3196
|
}
|
|
3653
3197
|
async function runTier1BrowserSnn(op) {
|
|
3654
3198
|
try {
|
|
3655
|
-
const snnWebgpu = await import('
|
|
3199
|
+
const snnWebgpu = await import('../dist-VD4L6V7Q.js');
|
|
3656
3200
|
const { GPUContext, LIFSimulator, DEFAULT_LIF_PARAMS } = snnWebgpu;
|
|
3657
3201
|
const ctx = new GPUContext();
|
|
3658
3202
|
await ctx.initialize();
|
|
@@ -5520,6 +5064,6 @@ var AndroidARCorePlugin = class {
|
|
|
5520
5064
|
};
|
|
5521
5065
|
platformPluginRegistry.register(new AndroidARCorePlugin());
|
|
5522
5066
|
|
|
5523
|
-
export { AgentTrustLedger, AlphaTracker, AndroidARCorePlugin, DEFAULT_DISPATCH_LATENCY_OPERATION, DialectRegistry, DispatchPolicy, DispatchTier, FlatSemanticCompiler, HoloGramMLSCompiler, MCPConfigCompiler, MatterpakCompiler,
|
|
5067
|
+
export { AgentTrustLedger, AlphaTracker, AndroidARCorePlugin, DEFAULT_DISPATCH_LATENCY_OPERATION, DialectRegistry, DispatchPolicy, DispatchTier, FlatSemanticCompiler, HoloGramMLSCompiler, MCPConfigCompiler, MatterpakCompiler, NextJSAPICompiler, NextJSCompiler, NodeServiceCompiler, SCMCompiler, WebGPUWGSLPlugin, byzantineResilientMerge, compileAllToNextJSAPI, compileToNextJSAPI, createDefaultDispatchLatencyScenarios, createHoloGramMLSCompiler, createMatterpakCompiler, createTier3CpuDirectOutput, detectWasmRuntime, ensureDialectsBooted, formatDispatchLatencyBenchmarkReport, generateTraitForTarget, getAllManifests, getTraitInfo, listTraitsForTarget, manifestFromPlugin, mergeSocialCausalModels, platformPluginRegistry, queryTrait, recommendDispatchPolicyDefaults, registerBuiltinDialects, runCompilerWasmSnnEmulator, runDispatchPolicyLatencyBenchmark, traitExists };
|
|
5524
5068
|
//# sourceMappingURL=index.js.map
|
|
5525
5069
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
3
|
+
var chunkNCWCUZNS_cjs = require('../chunk-NCWCUZNS.cjs');
|
|
4
|
+
require('../chunk-XB274MW5.cjs');
|
|
5
5
|
require('../chunk-S3MDHNKB.cjs');
|
|
6
|
-
require('../chunk-
|
|
6
|
+
require('../chunk-ROHLEP2W.cjs');
|
|
7
7
|
require('../chunk-5S7RKFGR.cjs');
|
|
8
8
|
require('../chunk-OIQYIIO3.cjs');
|
|
9
9
|
require('../chunk-AIA52I7T.cjs');
|
|
10
|
-
require('../chunk-
|
|
10
|
+
require('../chunk-HKEXJUWS.cjs');
|
|
11
11
|
require('../chunk-KKP7JKN4.cjs');
|
|
12
12
|
require('../chunk-5FSKKMR7.cjs');
|
|
13
13
|
require('../chunk-GTU2Z2WW.cjs');
|
|
@@ -18,7 +18,7 @@ require('../chunk-HCCQLAA4.cjs');
|
|
|
18
18
|
|
|
19
19
|
Object.defineProperty(exports, "MultiLayerCompiler", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkNCWCUZNS_cjs.MultiLayerCompiler; }
|
|
22
22
|
});
|
|
23
23
|
//# sourceMappingURL=multi-layer.cjs.map
|
|
24
24
|
//# sourceMappingURL=multi-layer.cjs.map
|