@almadar/shell-web 0.0.0-stage → 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/bundling.d.mts +18 -0
- package/bundling.mjs +28 -0
- package/dist/ArbitraryClassCompiler-CO_iASBn.d.ts +195 -0
- package/dist/AvlGlyph-EPJKFEO3.js +6 -0
- package/dist/AvlStateMachine-RKZIKNGC.js +9 -0
- package/dist/AvlTransitionDetail-63SD6GZF.js +11 -0
- package/dist/AvlTransitionExplainer-ZBTLOM3T.js +12 -0
- package/dist/BehaviorView-YS5G4GNB.js +11 -0
- package/dist/Canvas3DHost-BkZQB5l2.d.ts +552 -0
- package/dist/EventBusProvider-BFFHfN4O.d.ts +296 -0
- package/dist/FileTree-BCFnBEuQ.d.ts +254 -0
- package/dist/FlowCanvas-3JRMNJLV.css +1756 -0
- package/dist/FlowCanvas-AUMTWMNG.js +26 -0
- package/dist/GameAudioProvider-ceM_n0ey.d.ts +90 -0
- package/dist/KaTeX_AMS-Regular-CYEKBG2K.woff +0 -0
- package/dist/KaTeX_AMS-Regular-JKX5W2C4.ttf +0 -0
- package/dist/KaTeX_AMS-Regular-U6PRYMIZ.woff2 +0 -0
- package/dist/KaTeX_Caligraphic-Bold-5QL5CMTE.woff2 +0 -0
- package/dist/KaTeX_Caligraphic-Bold-WZ3QSGD3.woff +0 -0
- package/dist/KaTeX_Caligraphic-Bold-ZTS3R3HK.ttf +0 -0
- package/dist/KaTeX_Caligraphic-Regular-3LKEU76G.woff +0 -0
- package/dist/KaTeX_Caligraphic-Regular-A7XRTZ5Q.ttf +0 -0
- package/dist/KaTeX_Caligraphic-Regular-KX5MEWCF.woff2 +0 -0
- package/dist/KaTeX_Fraktur-Bold-2QVFK6NQ.woff2 +0 -0
- package/dist/KaTeX_Fraktur-Bold-T4SWXBMT.woff +0 -0
- package/dist/KaTeX_Fraktur-Bold-WGHVTYOR.ttf +0 -0
- package/dist/KaTeX_Fraktur-Regular-2PEIFJSJ.woff2 +0 -0
- package/dist/KaTeX_Fraktur-Regular-5U4OPH2X.ttf +0 -0
- package/dist/KaTeX_Fraktur-Regular-PQMHCIK6.woff +0 -0
- package/dist/KaTeX_Main-Bold-2GA4IZIN.woff +0 -0
- package/dist/KaTeX_Main-Bold-W5FBVCZM.ttf +0 -0
- package/dist/KaTeX_Main-Bold-YP5VVQRP.woff2 +0 -0
- package/dist/KaTeX_Main-BoldItalic-4P4C7HJH.woff +0 -0
- package/dist/KaTeX_Main-BoldItalic-N4V3DX7S.woff2 +0 -0
- package/dist/KaTeX_Main-BoldItalic-ODMLBJJQ.ttf +0 -0
- package/dist/KaTeX_Main-Italic-I43T2HSR.ttf +0 -0
- package/dist/KaTeX_Main-Italic-RELBIK7M.woff2 +0 -0
- package/dist/KaTeX_Main-Italic-SASNQFN2.woff +0 -0
- package/dist/KaTeX_Main-Regular-ARRPAO67.woff2 +0 -0
- package/dist/KaTeX_Main-Regular-P5I74A2A.woff +0 -0
- package/dist/KaTeX_Main-Regular-W74P5G27.ttf +0 -0
- package/dist/KaTeX_Math-BoldItalic-6EBV3DK5.woff +0 -0
- package/dist/KaTeX_Math-BoldItalic-K4WTGH3J.woff2 +0 -0
- package/dist/KaTeX_Math-BoldItalic-VB447A4D.ttf +0 -0
- package/dist/KaTeX_Math-Italic-6KGCHLFN.woff2 +0 -0
- package/dist/KaTeX_Math-Italic-KKK3USB2.woff +0 -0
- package/dist/KaTeX_Math-Italic-SON4MRCA.ttf +0 -0
- package/dist/KaTeX_SansSerif-Bold-RRNVJFFW.woff2 +0 -0
- package/dist/KaTeX_SansSerif-Bold-STQ6RXC7.ttf +0 -0
- package/dist/KaTeX_SansSerif-Bold-X5M5EMOD.woff +0 -0
- package/dist/KaTeX_SansSerif-Italic-HMPFTM52.woff2 +0 -0
- package/dist/KaTeX_SansSerif-Italic-PSN4QKYX.woff +0 -0
- package/dist/KaTeX_SansSerif-Italic-WTBAZBGY.ttf +0 -0
- package/dist/KaTeX_SansSerif-Regular-2TL3USAE.ttf +0 -0
- package/dist/KaTeX_SansSerif-Regular-OQCII6EP.woff +0 -0
- package/dist/KaTeX_SansSerif-Regular-XIQ62X4E.woff2 +0 -0
- package/dist/KaTeX_Script-Regular-72OLXYNA.ttf +0 -0
- package/dist/KaTeX_Script-Regular-A5IFOEBS.woff +0 -0
- package/dist/KaTeX_Script-Regular-APUWIHLP.woff2 +0 -0
- package/dist/KaTeX_Size1-Regular-4HRHTS65.woff +0 -0
- package/dist/KaTeX_Size1-Regular-5LRUTBFT.woff2 +0 -0
- package/dist/KaTeX_Size1-Regular-7K6AASVL.ttf +0 -0
- package/dist/KaTeX_Size2-Regular-222HN3GT.ttf +0 -0
- package/dist/KaTeX_Size2-Regular-K5ZHAIS6.woff +0 -0
- package/dist/KaTeX_Size2-Regular-LELKET5D.woff2 +0 -0
- package/dist/KaTeX_Size3-Regular-TLFPAHDE.woff +0 -0
- package/dist/KaTeX_Size3-Regular-UFCO6WCA.ttf +0 -0
- package/dist/KaTeX_Size3-Regular-WQRQ47UD.woff2 +0 -0
- package/dist/KaTeX_Size4-Regular-7PGNVPQK.ttf +0 -0
- package/dist/KaTeX_Size4-Regular-CDMV7U5C.woff2 +0 -0
- package/dist/KaTeX_Size4-Regular-PKMWZHNC.woff +0 -0
- package/dist/KaTeX_Typewriter-Regular-3F5K6SQ6.ttf +0 -0
- package/dist/KaTeX_Typewriter-Regular-MJMFSK64.woff +0 -0
- package/dist/KaTeX_Typewriter-Regular-VBYJ4NRC.woff2 +0 -0
- package/dist/KernelEngineContext-CcxGYtlr.d.ts +33 -0
- package/dist/LayersPanel-M2LHWUFF.js +6 -0
- package/dist/ModuleCard-QHDGK5XK.js +7 -0
- package/dist/OrbInspector-MHLJ6OEE.css +1756 -0
- package/dist/OrbInspector-QCPEPUPH.js +26 -0
- package/dist/Select-B-iDdnvE.d.ts +185 -0
- package/dist/ServerBridge-Bqsj-lOU.d.ts +124 -0
- package/dist/ThemeContext-DJmO59xd.d.ts +147 -0
- package/dist/UISlotContext-Dl_ewwCI.d.ts +79 -0
- package/dist/UISlotRenderer-C7WWOK43.js +26 -0
- package/dist/UISlotRenderer-KVFO6J7R.css +1756 -0
- package/dist/auth/browser/index.d.ts +2 -0
- package/dist/auth/browser/index.js +2 -0
- package/dist/auth/react/index.d.ts +56 -0
- package/dist/auth/react/index.js +157 -0
- package/dist/avl/index.css +1756 -0
- package/dist/avl/index.d.ts +2248 -0
- package/dist/avl/index.js +2693 -0
- package/dist/avl-3d-context-BycmO6tG.d.ts +201 -0
- package/dist/avl-schema-parser-CtJxJ9KU.d.ts +132 -0
- package/dist/avl-zoom-state-CKMVuBFg.d.ts +17 -0
- package/dist/chunk-3BBUBJFF.js +339 -0
- package/dist/chunk-3S54FWRC.js +131 -0
- package/dist/chunk-3VZ36ZKO.js +775 -0
- package/dist/chunk-4T3P43NS.js +1133 -0
- package/dist/chunk-4YXBKHHM.js +11488 -0
- package/dist/chunk-57DC34LY.js +525 -0
- package/dist/chunk-5QTYQTPS.js +15 -0
- package/dist/chunk-A2LR6VQQ.js +349 -0
- package/dist/chunk-AB3X7QTE.js +505 -0
- package/dist/chunk-AE7VCQB6.js +561 -0
- package/dist/chunk-AGXD77SL.js +98 -0
- package/dist/chunk-AU7O65OX.js +66 -0
- package/dist/chunk-CPLN6NBQ.js +701 -0
- package/dist/chunk-DZBQA2OW.js +176 -0
- package/dist/chunk-E6KA4J6N.js +227 -0
- package/dist/chunk-EOWMARUB.js +16 -0
- package/dist/chunk-G7DCAZ22.js +19 -0
- package/dist/chunk-GFXCPUMX.js +1334 -0
- package/dist/chunk-HH5KSMH5.js +311 -0
- package/dist/chunk-ILQXJ2AR.js +280 -0
- package/dist/chunk-ILZ7ORX7.js +432 -0
- package/dist/chunk-K4MOPSEL.js +674 -0
- package/dist/chunk-LHP2TK7O.js +47587 -0
- package/dist/chunk-P4ZFUQFF.js +93 -0
- package/dist/chunk-PCR37T3U.js +296 -0
- package/dist/chunk-PRXQGGCO.js +580 -0
- package/dist/chunk-REXYVBUO.js +191 -0
- package/dist/chunk-ROICKAU7.js +24 -0
- package/dist/chunk-SP5CDJ6K.js +338 -0
- package/dist/chunk-TUPZWTRE.js +1051 -0
- package/dist/chunk-TXAUOLWZ.js +490 -0
- package/dist/chunk-TZZBINQY.js +82 -0
- package/dist/chunk-UTDC2NEA.js +14 -0
- package/dist/chunk-UU57VNS2.js +1053 -0
- package/dist/chunk-UXLE3IPR.js +421 -0
- package/dist/chunk-VO2TTLS5.js +94 -0
- package/dist/chunk-X3DMMX27.js +11 -0
- package/dist/chunk-YHMRX6YA.js +455 -0
- package/dist/components/index.css +1756 -0
- package/dist/components/index.d.ts +11299 -0
- package/dist/components/index.js +1110 -0
- package/dist/context/index.d.ts +8 -0
- package/dist/context/index.js +8 -0
- package/dist/core.d.ts +2599 -0
- package/dist/core.js +3 -0
- package/dist/design-classes/index.cjs +431 -0
- package/dist/design-classes/index.d.cts +165 -0
- package/dist/design-classes/index.d.ts +165 -0
- package/dist/design-classes/index.js +399 -0
- package/dist/emojiItems-QGSNAABW.js +20 -0
- package/dist/fx-CmQjnHmT.d.ts +371 -0
- package/dist/hooks/index.d.ts +971 -0
- package/dist/hooks/index.js +8 -0
- package/dist/index.d.ts +408 -0
- package/dist/index.js +178 -0
- package/dist/katexPlugin-FA7NX4PE.css +1161 -0
- package/dist/katexPlugin-NCDKOOQY.js +2 -0
- package/dist/kernel-client-TZKGHJRY.js +516 -0
- package/dist/kernel-wire-wNdAPfhJ.d.ts +88 -0
- package/dist/lib/index.d.ts +602 -0
- package/dist/lib/index.js +1289 -0
- package/dist/paintDispatch-CuJLsr9Y.d.ts +688 -0
- package/dist/parseLessonSegments-GpCeMrb2.d.ts +334 -0
- package/dist/perf-CKiBKbkw.d.ts +22 -0
- package/dist/perf-Dr28-AgT.d.ts +57 -0
- package/dist/prism-X5YWKXO5.js +136 -0
- package/dist/providers/index.css +1756 -0
- package/dist/providers/index.d.ts +355 -0
- package/dist/providers/index.js +29 -0
- package/dist/renderer/index.d.ts +465 -0
- package/dist/renderer/index.js +4 -0
- package/dist/runtime/index.css +1756 -0
- package/dist/runtime/index.d.ts +239 -0
- package/dist/runtime/index.js +28 -0
- package/dist/slot-host-CPzrxLo9.d.ts +48 -0
- package/dist/ssr/index.cjs +9739 -0
- package/dist/ssr/index.d.cts +464 -0
- package/dist/ssr/index.d.ts +464 -0
- package/dist/ssr/index.js +9703 -0
- package/dist/storage/browser/index.d.ts +1 -0
- package/dist/storage/browser/index.js +2 -0
- package/dist/test-support.d.ts +42 -0
- package/dist/test-support.js +181 -0
- package/dist/themeTokens-CRd8AEDF.d.ts +125 -0
- package/dist/three/index.css +503 -0
- package/dist/three/index.d.ts +1185 -0
- package/dist/three/index.js +3908 -0
- package/dist/useUISlots-CiobNFGb.d.ts +211 -0
- package/dist/verification-C5pTeMJv.d.ts +66 -0
- package/dist/verificationRegistry-CVrcxG1s.d.ts +122 -0
- package/dist/wrapCallbackForEvent-B9QLbhxX.d.ts +19 -0
- package/index.css +199 -0
- package/package.json +273 -3
- package/src/core/lib/band-shapes.json +7 -0
- package/src/core/locales/ar.json +1276 -0
- package/src/core/locales/en.json +1276 -0
- package/src/core/locales/index.ts +54 -0
- package/src/core/locales/sl.json +1276 -0
- package/src/core/tokens/native-tokens.json +369 -0
- package/tailwind-compile.cjs +29 -0
- package/tailwind-preset.cjs +1020 -0
- package/themes/_base.css +451 -0
- package/themes/_contract.md +307 -0
- package/themes/_fonts-kenney.css +11 -0
- package/themes/_fonts.css +12 -0
- package/themes/_foundation.css +105 -0
- package/themes/_head.css +22 -0
- package/themes/_presets.css +67 -0
- package/themes/almadar-heritage.css +455 -0
- package/themes/almadar-website.css +269 -0
- package/themes/almadar.css +269 -0
- package/themes/aqua.css +455 -0
- package/themes/arabesque.css +459 -0
- package/themes/art-deco.css +457 -0
- package/themes/art-nouveau.css +459 -0
- package/themes/atelier.css +463 -0
- package/themes/bauhaus.css +461 -0
- package/themes/bloomberg-dense.css +463 -0
- package/themes/blueprint.css +457 -0
- package/themes/clay.css +449 -0
- package/themes/comic.css +453 -0
- package/themes/constructivist.css +457 -0
- package/themes/corporate.css +449 -0
- package/themes/cyberpunk.css +453 -0
- package/themes/frutiger-aero.css +458 -0
- package/themes/game-adventure.css +201 -0
- package/themes/game-rpg.css +203 -0
- package/themes/game-sci-fi.css +201 -0
- package/themes/game-ui-pack.css +200 -0
- package/themes/gazette.css +449 -0
- package/themes/glass.css +457 -0
- package/themes/gothic.css +453 -0
- package/themes/index.css +21 -0
- package/themes/ink-wash.css +459 -0
- package/themes/kawaii.css +459 -0
- package/themes/kflow.css +310 -0
- package/themes/kiosk.css +449 -0
- package/themes/linear-clean.css +463 -0
- package/themes/luxury.css +451 -0
- package/themes/mac-classic.css +455 -0
- package/themes/material.css +463 -0
- package/themes/memphis.css +453 -0
- package/themes/mid-century.css +455 -0
- package/themes/minimalist.css +449 -0
- package/themes/mudcloth.css +459 -0
- package/themes/nata.css +310 -0
- package/themes/neon.css +453 -0
- package/themes/neumorphic.css +451 -0
- package/themes/newsprint.css +455 -0
- package/themes/notion-editorial.css +463 -0
- package/themes/orb.css +465 -0
- package/themes/pixel.css +449 -0
- package/themes/prism.css +309 -0
- package/themes/rawi.css +310 -0
- package/themes/retro.css +452 -0
- package/themes/risograph.css +463 -0
- package/themes/scandi.css +469 -0
- package/themes/sketch.css +455 -0
- package/themes/solarpunk.css +469 -0
- package/themes/steampunk.css +451 -0
- package/themes/swiss.css +455 -0
- package/themes/terminal.css +466 -0
- package/themes/trait-wars.css +487 -0
- package/themes/ukiyo-e.css +459 -0
- package/themes/vaporwave.css +455 -0
- package/themes/victorian.css +453 -0
- package/themes/wabi-sabi.css +459 -0
- package/themes/win95.css +455 -0
- package/themes/wireframe.css +439 -0
- package/themes/zine.css +455 -0
- package/README.md +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@almadar/shell-browser/storage';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { KernelServerClass, KernelModule } from '@almadar/shell-runtime/kernel/wire';
|
|
2
|
+
import { OrbitalSchema } from '@almadar/core';
|
|
3
|
+
import { KernelEngineValue } from './providers/index.js';
|
|
4
|
+
import { KernelModule as KernelModule$1 } from './providers/index.js';
|
|
5
|
+
import { EventTransport } from '@almadar/shell-runtime';
|
|
6
|
+
import 'react';
|
|
7
|
+
import '@almadar/shell-runtime/kernel/os-port';
|
|
8
|
+
import '@almadar/shell-browser/kv';
|
|
9
|
+
import './verification-C5pTeMJv.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* A whole `KernelModule` around a scripted `Server`, for tests that drive the engine without the wasm. Every member a
|
|
13
|
+
* test does not name throws when called, so a double never falls behind the module's surface.
|
|
14
|
+
*/
|
|
15
|
+
declare function stubKernelModule(Server: KernelServerClass, overrides?: Partial<Omit<KernelModule, 'Server'>>): KernelModule;
|
|
16
|
+
|
|
17
|
+
declare const KERNEL_AVAILABLE: boolean;
|
|
18
|
+
/** The type-contract stamp every test program carries, typed from core's `OrbitalSchema` so a version bump there fails here. */
|
|
19
|
+
declare const TEST_TYPE_CONTRACT_VERSION: NonNullable<OrbitalSchema['typeContractVersion']>;
|
|
20
|
+
/** The stamp option a hook under test hands the kernel: the same version, as a program's stamp. */
|
|
21
|
+
declare const TEST_STAMP: Pick<OrbitalSchema, 'typeContractVersion'>;
|
|
22
|
+
/** The installed language as the bundle a browser host hands a kernel it opens over a local store. */
|
|
23
|
+
declare const TEST_LANGUAGE: string;
|
|
24
|
+
/** The shared kernel module, loaded once, with the render evaluator installed from it. */
|
|
25
|
+
declare function loadTestKernel(): Promise<KernelModule$1>;
|
|
26
|
+
declare const KERNEL_ENGINE: KernelEngineValue;
|
|
27
|
+
declare const ENGINES: ReadonlyArray<readonly [string, KernelEngineValue]>;
|
|
28
|
+
/** A client-build kernel instance of its own, as a browser loads it: initialised, with the language installed once, as the browser kernel loader does. */
|
|
29
|
+
declare function loadFreshClientKernel(): Promise<KernelModule$1>;
|
|
30
|
+
/** Load the WebAssembly and the adapter chunk before a timing-sensitive test: the first dispatch otherwise waits on both. */
|
|
31
|
+
declare function warmKernel(): Promise<void>;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The hosted playground's stateless topology: the program is registered once, and every request runs on a fresh
|
|
35
|
+
* session of it (`KernelEngine.fork`) over the kernel's own memory store, the client carrying the circuit state on the leg.
|
|
36
|
+
*/
|
|
37
|
+
declare function statelessKernelTransport(schema: OrbitalSchema): EventTransport;
|
|
38
|
+
|
|
39
|
+
/** A `.lolo` program (with any files beside it, such as `locales/en/<app>.json`) as the installed `orb` compiles it for a browser kernel: the stamp, `_metadata.protocols` and dispatch facts included. */
|
|
40
|
+
declare function clientProgram(source: string, files?: Readonly<Record<string, string>>): OrbitalSchema;
|
|
41
|
+
|
|
42
|
+
export { ENGINES, KERNEL_AVAILABLE, KERNEL_ENGINE, TEST_LANGUAGE, TEST_STAMP, TEST_TYPE_CONTRACT_VERSION, clientProgram, loadFreshClientKernel, loadTestKernel, statelessKernelTransport, stubKernelModule, warmKernel };
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { openLocalKernel, nativeMemoryPersistence } from './chunk-3VZ36ZKO.js';
|
|
3
|
+
import './chunk-G7DCAZ22.js';
|
|
4
|
+
import { existsSync, readFileSync, mkdtempSync, writeFileSync, mkdirSync, rmSync } from 'fs';
|
|
5
|
+
import { createRequire } from 'module';
|
|
6
|
+
import { join, dirname } from 'path';
|
|
7
|
+
import { pathToFileURL } from 'url';
|
|
8
|
+
import { installKernelEvaluator, parseOrbitalSchema } from '@almadar/core';
|
|
9
|
+
import { installNativeLanguages } from '@almadar/syntax';
|
|
10
|
+
import { readLanguageBundle } from '@almadar/core/language-data';
|
|
11
|
+
import { createInProcessTransport, evaluateOnKernel } from '@almadar/shell-runtime';
|
|
12
|
+
import { execFileSync } from 'child_process';
|
|
13
|
+
import { tmpdir } from 'os';
|
|
14
|
+
|
|
15
|
+
// src/test-support/stub-kernel-module.ts
|
|
16
|
+
function stubKernelModule(Server, overrides = {}) {
|
|
17
|
+
const unexpected = (name) => () => {
|
|
18
|
+
throw new Error(`stub kernel module: ${name} was not expected`);
|
|
19
|
+
};
|
|
20
|
+
return {
|
|
21
|
+
Server,
|
|
22
|
+
osGlobMatches: () => false,
|
|
23
|
+
isPublicAddress: () => false,
|
|
24
|
+
osDeferringOps: () => "[]",
|
|
25
|
+
contractQueryWithoutProgram: () => "null",
|
|
26
|
+
osStreamOps: () => "[]",
|
|
27
|
+
osCompletionEvent: () => "null",
|
|
28
|
+
substrateCompletionEvent: () => "null",
|
|
29
|
+
tabUrlMatches: () => false,
|
|
30
|
+
parseEventRequest: unexpected("parseEventRequest"),
|
|
31
|
+
installLanguage: unexpected("installLanguage"),
|
|
32
|
+
evaluateMany: unexpected("evaluateMany"),
|
|
33
|
+
resolveValues: unexpected("resolveValues"),
|
|
34
|
+
evaluateGuards: unexpected("evaluateGuards"),
|
|
35
|
+
evaluateTraced: unexpected("evaluateTraced"),
|
|
36
|
+
traceEffects: unexpected("traceEffects"),
|
|
37
|
+
mapListenPayload: unexpected("mapListenPayload"),
|
|
38
|
+
scopeRows: unexpected("scopeRows"),
|
|
39
|
+
checkMutationAccess: unexpected("checkMutationAccess"),
|
|
40
|
+
resolveRowBinding: unexpected("resolveRowBinding"),
|
|
41
|
+
eventWires: unexpected("eventWires"),
|
|
42
|
+
validatePacks: unexpected("validatePacks"),
|
|
43
|
+
expandFxLayer: unexpected("expandFxLayer"),
|
|
44
|
+
resolveFxView: unexpected("resolveFxView"),
|
|
45
|
+
fxLifecycle: unexpected("fxLifecycle"),
|
|
46
|
+
fxHash01: unexpected("fxHash01"),
|
|
47
|
+
skinWorldMatrices: unexpected("skinWorldMatrices"),
|
|
48
|
+
skinVertices: unexpected("skinVertices"),
|
|
49
|
+
skinComposeAffine: unexpected("skinComposeAffine"),
|
|
50
|
+
skinInvertAffine: unexpected("skinInvertAffine"),
|
|
51
|
+
skinApplyAffine: unexpected("skinApplyAffine"),
|
|
52
|
+
skinTriangleAffine: unexpected("skinTriangleAffine"),
|
|
53
|
+
skinVertexBounds: unexpected("skinVertexBounds"),
|
|
54
|
+
...overrides
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
var resolveInstalled = createRequire(import.meta.url).resolve;
|
|
58
|
+
function kernelFiles() {
|
|
59
|
+
const dir = process.env.ALMADAR_KERNEL_DIR;
|
|
60
|
+
if (dir !== void 0 && dir !== "") {
|
|
61
|
+
return { glue: join(dir, "pkg/orbital_wasm.js"), wasm: join(dir, "pkg/orbital_wasm_bg.wasm") };
|
|
62
|
+
}
|
|
63
|
+
return { glue: resolveInstalled("@almadar/kernel"), wasm: resolveInstalled("@almadar/kernel/kernel.wasm") };
|
|
64
|
+
}
|
|
65
|
+
function kernelAvailable() {
|
|
66
|
+
try {
|
|
67
|
+
return existsSync(kernelFiles().glue);
|
|
68
|
+
} catch {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
var KERNEL_AVAILABLE = kernelAvailable();
|
|
73
|
+
async function load() {
|
|
74
|
+
const files = kernelFiles();
|
|
75
|
+
const glue = await import(
|
|
76
|
+
/* @vite-ignore */
|
|
77
|
+
pathToFileURL(files.glue).href
|
|
78
|
+
);
|
|
79
|
+
glue.initSync({ module: readFileSync(files.wasm) });
|
|
80
|
+
glue.installLanguage(TEST_LANGUAGE);
|
|
81
|
+
installKernelEvaluator(glue);
|
|
82
|
+
installNativeLanguages();
|
|
83
|
+
return glue;
|
|
84
|
+
}
|
|
85
|
+
var TEST_TYPE_CONTRACT_VERSION = 1;
|
|
86
|
+
var TEST_STAMP = { typeContractVersion: TEST_TYPE_CONTRACT_VERSION };
|
|
87
|
+
var TEST_LANGUAGE = JSON.stringify(readLanguageBundle(process.cwd()));
|
|
88
|
+
var shared;
|
|
89
|
+
function loadTestKernel() {
|
|
90
|
+
return shared ??= load();
|
|
91
|
+
}
|
|
92
|
+
var KERNEL_ENGINE = { loadModule: () => loadTestKernel() };
|
|
93
|
+
var ENGINES = KERNEL_AVAILABLE ? [["kernel", KERNEL_ENGINE]] : [];
|
|
94
|
+
async function loadFreshClientKernel() {
|
|
95
|
+
const dir = process.env.ALMADAR_KERNEL_DIR;
|
|
96
|
+
const files = dir !== void 0 && dir !== "" ? { glue: join(dir, "pkg-client/orbital_wasm.js"), wasm: join(dir, "pkg-client/orbital_wasm_bg.wasm") } : { glue: resolveInstalled("@almadar/kernel/client"), wasm: resolveInstalled("@almadar/kernel/client.wasm") };
|
|
97
|
+
const glue = await import(
|
|
98
|
+
/* @vite-ignore */
|
|
99
|
+
`${pathToFileURL(files.glue).href}?fresh=${Math.random()}`
|
|
100
|
+
);
|
|
101
|
+
glue.initSync({ module: readFileSync(files.wasm) });
|
|
102
|
+
glue.installLanguage(TEST_LANGUAGE);
|
|
103
|
+
installKernelEvaluator(glue);
|
|
104
|
+
installNativeLanguages();
|
|
105
|
+
return glue;
|
|
106
|
+
}
|
|
107
|
+
async function warmKernel() {
|
|
108
|
+
if (!KERNEL_AVAILABLE) return;
|
|
109
|
+
await KERNEL_ENGINE.loadModule();
|
|
110
|
+
await import('./kernel-client-TZKGHJRY.js');
|
|
111
|
+
}
|
|
112
|
+
function statelessKernelTransport(schema) {
|
|
113
|
+
let template;
|
|
114
|
+
return createInProcessTransport(async (orbital, request) => {
|
|
115
|
+
template ??= loadTestKernel().then((kernel) => openLocalKernel({ kernel, schema, persistence: nativeMemoryPersistence(kernel) }));
|
|
116
|
+
const engine = (await template).fork();
|
|
117
|
+
try {
|
|
118
|
+
return await evaluateOnKernel({ engine, orbital }, request, request.locale);
|
|
119
|
+
} finally {
|
|
120
|
+
engine.dispose();
|
|
121
|
+
}
|
|
122
|
+
}, { carriesCircuitState: true });
|
|
123
|
+
}
|
|
124
|
+
var lowered = /* @__PURE__ */ new Map();
|
|
125
|
+
var lockDir = join(tmpdir(), "almadar-client-program.lock");
|
|
126
|
+
function holderAlive() {
|
|
127
|
+
try {
|
|
128
|
+
process.kill(Number(readFileSync(join(lockDir, "pid"), "utf8")), 0);
|
|
129
|
+
return true;
|
|
130
|
+
} catch {
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
function compileExclusively(compile) {
|
|
135
|
+
const wait = new Int32Array(new SharedArrayBuffer(4));
|
|
136
|
+
for (; ; ) {
|
|
137
|
+
try {
|
|
138
|
+
mkdirSync(lockDir);
|
|
139
|
+
writeFileSync(join(lockDir, "pid"), String(process.pid));
|
|
140
|
+
break;
|
|
141
|
+
} catch (error) {
|
|
142
|
+
if (!(error instanceof Error) || !("code" in error) || error.code !== "EEXIST") throw error;
|
|
143
|
+
if (!holderAlive()) rmSync(lockDir, { recursive: true, force: true });
|
|
144
|
+
Atomics.wait(wait, 0, 0, 25);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
try {
|
|
148
|
+
return compile();
|
|
149
|
+
} finally {
|
|
150
|
+
rmSync(lockDir, { recursive: true, force: true });
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
function clientProgram(source, files = {}) {
|
|
154
|
+
const bin = process.env.ORB_BIN;
|
|
155
|
+
if (bin === void 0 || bin === "") throw new Error("clientProgram: set ORB_BIN to the installed orb binary that lowers the test programs");
|
|
156
|
+
const key = JSON.stringify([source, files]);
|
|
157
|
+
const known = lowered.get(key);
|
|
158
|
+
if (known !== void 0) return structuredClone(known);
|
|
159
|
+
const dir = mkdtempSync(join(tmpdir(), "client-program-"));
|
|
160
|
+
try {
|
|
161
|
+
const file = join(dir, "program.lolo");
|
|
162
|
+
writeFileSync(file, source);
|
|
163
|
+
const served = join(dir, "out/packages/client/public");
|
|
164
|
+
for (const [path, text] of Object.entries(files)) {
|
|
165
|
+
for (const target of [join(dir, path), join(served, path)]) {
|
|
166
|
+
mkdirSync(dirname(target), { recursive: true });
|
|
167
|
+
writeFileSync(target, text);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
const schema = compileExclusively(() => {
|
|
171
|
+
execFileSync(bin, ["compile", file, "-o", join(dir, "out"), "--mode", "client"], { cwd: dir, stdio: "pipe" });
|
|
172
|
+
return parseOrbitalSchema(JSON.parse(readFileSync(join(served, "program.client.orb"), "utf8")));
|
|
173
|
+
});
|
|
174
|
+
lowered.set(key, schema);
|
|
175
|
+
return structuredClone(schema);
|
|
176
|
+
} finally {
|
|
177
|
+
rmSync(dir, { recursive: true, force: true });
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export { ENGINES, KERNEL_AVAILABLE, KERNEL_ENGINE, TEST_LANGUAGE, TEST_STAMP, TEST_TYPE_CONTRACT_VERSION, clientProgram, loadFreshClientKernel, loadTestKernel, statelessKernelTransport, stubKernelModule, warmKernel };
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { ThemeRef, ThemeDefinition, ThemeTokens, ThemeVariant, DensityTokens, DiagramTokens, ElevationTokens, GeometryTokens, IconographyTokens, MotionDurationKey, MotionEasingKey, MotionIntentMap, MotionShapeTokens, SceneTokens, SurfaceTokens, TypeScaleTokens, TypeIntentMap, TypeSizeKey, EnterAnimation } from '@almadar/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* themeTokens — runtime mirror of the orbital compiler's theme codegen.
|
|
5
|
+
*
|
|
6
|
+
* The compile path (orbital-rust/crates/orbital-shell-typescript/src/codegen/theme.rs)
|
|
7
|
+
* reads `OrbitalDefinition.theme.tokens` and emits CSS custom-property
|
|
8
|
+
* declarations into a `[data-theme="<name>-<mode>"]` block. The runtime
|
|
9
|
+
* does not parse compiled CSS — it reads the same `tokens` object directly
|
|
10
|
+
* and produces the same `{ '--color-primary': '…', '--radius-md': '…' }` map
|
|
11
|
+
* that the compiler emits.
|
|
12
|
+
*
|
|
13
|
+
* Keeping the two paths byte-identical at the variable level is the contract:
|
|
14
|
+
* editing tokens via the Studio Design System tab must produce the exact
|
|
15
|
+
* same rendered result as editing them in source and running `orbital
|
|
16
|
+
* compile`. The mapping rules here mirror `generate_tokens_css` /
|
|
17
|
+
* `generate_tokens_css_dark` (theme.rs:122–351).
|
|
18
|
+
*
|
|
19
|
+
* Compile vs runtime difference (intentional):
|
|
20
|
+
* - Compile emits the FULL set: schema overrides on top of defaults. This is
|
|
21
|
+
* needed because the compiled CSS replaces the theme entirely.
|
|
22
|
+
* - Runtime emits ONLY the keys present in `tokens` (and `variants.dark`).
|
|
23
|
+
* Missing keys cascade from the parent `[data-theme]` rule on the document
|
|
24
|
+
* element. The provider scopes overrides to an orbital subtree without
|
|
25
|
+
* shadowing inherited defaults.
|
|
26
|
+
*
|
|
27
|
+
* The per-axis var tables below (`DENSITY_SPACING_VARS`, `TYPE_INTENT_VARS`, …)
|
|
28
|
+
* are the ONE mapping between a typed-axis field and its CSS variable name.
|
|
29
|
+
* `themeTokensToCssVars` reads them forward (token → CSS); `almadar-core`'s
|
|
30
|
+
* one-time `scripts/migrate-css-themes.ts` reads them in reverse (CSS →
|
|
31
|
+
* token) to build `packages/almadar-core/themes/*.json` from the checked-in
|
|
32
|
+
* preset CSS — see that script for the inverse direction.
|
|
33
|
+
*
|
|
34
|
+
* @packageDocumentation
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
/** Resolved color mode. Mirrors `ThemeContext.resolvedMode`. */
|
|
38
|
+
type ThemeMode = 'light' | 'dark';
|
|
39
|
+
/** The keys of `T` whose value is a plain (optional) string — excludes
|
|
40
|
+
* nested-object fields like `DensityTokens['spacing']` or
|
|
41
|
+
* `TypeScaleTokens['scale']`, which are never single CSS values. */
|
|
42
|
+
type StringValueKey<T> = {
|
|
43
|
+
[K in keyof T]-?: T[K] extends string | undefined ? K : never;
|
|
44
|
+
}[keyof T] & string;
|
|
45
|
+
/** One flat scalar field on an axis object and the CSS var name it maps to. */
|
|
46
|
+
interface FlatVarEntry<T> {
|
|
47
|
+
readonly cssVar: string;
|
|
48
|
+
readonly key: StringValueKey<T>;
|
|
49
|
+
}
|
|
50
|
+
/** Density axis — spacing scale steps (`density.spacing.space<N>` → `--space-<N>`). */
|
|
51
|
+
declare const DENSITY_SPACING_VARS: ReadonlyArray<FlatVarEntry<NonNullable<DensityTokens['spacing']>>>;
|
|
52
|
+
/** Density axis — per-element heights + paddings. */
|
|
53
|
+
declare const DENSITY_ELEMENT_VARS: ReadonlyArray<FlatVarEntry<DensityTokens>>;
|
|
54
|
+
/** Type axis — family triplet. */
|
|
55
|
+
declare const TYPE_FAMILY_VARS: ReadonlyArray<FlatVarEntry<TypeScaleTokens>>;
|
|
56
|
+
/** Type axis — heading voice (weight/case/tracking/style/shadow of every heading). */
|
|
57
|
+
declare const TYPE_HEADING_VARS: ReadonlyArray<FlatVarEntry<TypeScaleTokens>>;
|
|
58
|
+
/** Type axis — size scale keys, ordered exactly as emitted. Each pairs `--text-<k>` / `--leading-<k>`. */
|
|
59
|
+
declare const TYPE_SIZE_KEYS: ReadonlyArray<TypeSizeKey>;
|
|
60
|
+
/** Type axis — intent names, ordered exactly as emitted. Each is 3 vars: `-size` / `-weight` / `-leading`. */
|
|
61
|
+
declare const TYPE_INTENT_VARS: ReadonlyArray<{
|
|
62
|
+
key: keyof TypeIntentMap & string;
|
|
63
|
+
cssName: string;
|
|
64
|
+
}>;
|
|
65
|
+
/** Motion axis — duration palette keys, ordered exactly as emitted. */
|
|
66
|
+
declare const MOTION_DURATION_KEYS: ReadonlyArray<MotionDurationKey>;
|
|
67
|
+
/** Motion axis — easing palette keys, ordered exactly as emitted. */
|
|
68
|
+
declare const MOTION_EASING_KEYS: ReadonlyArray<MotionEasingKey>;
|
|
69
|
+
/** Motion axis — intent names, ordered exactly as emitted. Each is 2 vars: `-duration` / `-easing`. */
|
|
70
|
+
declare const MOTION_INTENT_VARS: ReadonlyArray<{
|
|
71
|
+
key: keyof MotionIntentMap & string;
|
|
72
|
+
cssName: string;
|
|
73
|
+
}>;
|
|
74
|
+
/** Motion axis — per-surface shapes (the enter-from / exit-to transform endpoints). */
|
|
75
|
+
declare const MOTION_SHAPE_VARS: ReadonlyArray<FlatVarEntry<MotionShapeTokens>>;
|
|
76
|
+
/** Iconography axis — flat fields. */
|
|
77
|
+
declare const ICONOGRAPHY_VARS: ReadonlyArray<FlatVarEntry<IconographyTokens>>;
|
|
78
|
+
/** Elevation axis — flat fields. */
|
|
79
|
+
declare const ELEVATION_VARS: ReadonlyArray<FlatVarEntry<ElevationTokens>>;
|
|
80
|
+
/** Geometry axis — flat fields. */
|
|
81
|
+
declare const GEOMETRY_VARS: ReadonlyArray<FlatVarEntry<GeometryTokens>>;
|
|
82
|
+
/** Surface axis — panel/page material. */
|
|
83
|
+
declare const SURFACE_VARS: ReadonlyArray<FlatVarEntry<SurfaceTokens>>;
|
|
84
|
+
/** Diagram axis — how marks are drawn on every drawing surface. */
|
|
85
|
+
declare const DIAGRAM_VARS: ReadonlyArray<FlatVarEntry<DiagramTokens>>;
|
|
86
|
+
/** Scene axis — 3D material and lighting. */
|
|
87
|
+
declare const SCENE_VARS: ReadonlyArray<FlatVarEntry<SceneTokens>>;
|
|
88
|
+
/** Legacy free-form map prefixes (`ThemeTokens.colors`/`radii`/`spacing`/`shadows`). `typography` has no prefix — see below. */
|
|
89
|
+
declare const LEGACY_PREFIXES: {
|
|
90
|
+
readonly colors: "--color-";
|
|
91
|
+
readonly radii: "--radius-";
|
|
92
|
+
readonly spacing: "--space-";
|
|
93
|
+
readonly shadows: "--shadow-";
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Convert `ThemeTokens` (+ optional dark variant) into a CSS custom-property
|
|
97
|
+
* map keyed by variable name (e.g. `--color-primary`).
|
|
98
|
+
*
|
|
99
|
+
* Mapping rules (mirror theme.rs):
|
|
100
|
+
* - `tokens.colors.<k>` → `--color-<k>`
|
|
101
|
+
* - `tokens.radii.<k>` → `--radius-<k>`
|
|
102
|
+
* - `tokens.spacing.<k>` → `--space-<k>`
|
|
103
|
+
* - `tokens.typography.<k>` → `--<k>` (keys already include their `font-`/
|
|
104
|
+
* `letter-`/`line-` prefix)
|
|
105
|
+
* - `tokens.shadows.<k>` → `--shadow-<k>` (schema key has no prefix)
|
|
106
|
+
*
|
|
107
|
+
* In `'dark'` mode, the `darkVariant` overrides are merged on top of the
|
|
108
|
+
* base tokens per category — same precedence the Rust compiler uses
|
|
109
|
+
* (`generate_tokens_css_dark`). Categories not present in `darkVariant` fall
|
|
110
|
+
* back to the base tokens.
|
|
111
|
+
*/
|
|
112
|
+
declare function themeTokensToCssVars(tokens: ThemeTokens, mode?: ThemeMode, darkVariant?: ThemeVariant): Record<string, string>;
|
|
113
|
+
/** The keyframe name an entry keyword plays (`none` stays `none`). */
|
|
114
|
+
declare function enterKeyframe(enter: EnterAnimation): string;
|
|
115
|
+
/**
|
|
116
|
+
* `ThemeRef` is `ThemeDefinition | string`. When it's a string, it's an
|
|
117
|
+
* unresolved import reference (e.g. `"Ocean.theme"`) that should have been
|
|
118
|
+
* inlined by the compiler's import phase before runtime. If we still see a
|
|
119
|
+
* string here, the upstream resolution path didn't run — return `undefined`
|
|
120
|
+
* rather than guess. `OrbitalThemeProvider` falls through to passthrough.
|
|
121
|
+
*/
|
|
122
|
+
declare function resolveThemeForRuntime(theme: ThemeRef | undefined): ThemeDefinition | undefined;
|
|
123
|
+
|
|
124
|
+
export { DENSITY_ELEMENT_VARS as D, ELEVATION_VARS as E, GEOMETRY_VARS as G, ICONOGRAPHY_VARS as I, LEGACY_PREFIXES as L, MOTION_DURATION_KEYS as M, SCENE_VARS as S, DENSITY_SPACING_VARS as a, DIAGRAM_VARS as b, MOTION_EASING_KEYS as c, MOTION_INTENT_VARS as d, MOTION_SHAPE_VARS as e, SURFACE_VARS as f, TYPE_FAMILY_VARS as h, TYPE_HEADING_VARS as i, TYPE_INTENT_VARS as j, TYPE_SIZE_KEYS as k, enterKeyframe as l, resolveThemeForRuntime as r, themeTokensToCssVars as t };
|
|
125
|
+
export type { FlatVarEntry as F, ThemeMode as T, StringValueKey as g };
|