@lynx-js/luna-studio 0.0.0-oidc-bootstrap.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +416 -5
  3. package/dist/choreography/choreography-view.d.ts +9 -0
  4. package/dist/choreography/choreography-view.d.ts.map +1 -0
  5. package/dist/choreography/choreography-view.js +256 -0
  6. package/dist/choreography/choreography-view.js.map +1 -0
  7. package/dist/choreography/choreography.d.ts +10 -0
  8. package/dist/choreography/choreography.d.ts.map +1 -0
  9. package/dist/choreography/choreography.js +17 -0
  10. package/dist/choreography/choreography.js.map +1 -0
  11. package/dist/choreography/index.d.ts +3 -0
  12. package/dist/choreography/index.d.ts.map +1 -0
  13. package/dist/choreography/index.js +1 -0
  14. package/dist/index.d.ts +7 -0
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/index.js +3 -0
  17. package/dist/lynx-stage/index.d.ts +3 -0
  18. package/dist/lynx-stage/index.d.ts.map +1 -0
  19. package/dist/lynx-stage/index.js +1 -0
  20. package/dist/lynx-stage/studio-lynx-stage.d.ts +5 -0
  21. package/dist/lynx-stage/studio-lynx-stage.d.ts.map +1 -0
  22. package/dist/lynx-stage/studio-lynx-stage.js +26 -0
  23. package/dist/lynx-stage/studio-lynx-stage.js.map +1 -0
  24. package/dist/types/choreography.d.ts +106 -0
  25. package/dist/types/choreography.d.ts.map +1 -0
  26. package/dist/types/choreography.js +9 -0
  27. package/dist/types/choreography.js.map +1 -0
  28. package/dist/types/index.d.ts +4 -0
  29. package/dist/types/index.d.ts.map +1 -0
  30. package/dist/types/index.js +0 -0
  31. package/dist/types/lynx-stage.d.ts +20 -0
  32. package/dist/types/lynx-stage.d.ts.map +1 -0
  33. package/dist/types/lynx-stage.js +0 -0
  34. package/dist/types/studio.d.ts +115 -0
  35. package/dist/types/studio.d.ts.map +1 -0
  36. package/dist/types/studio.js +60 -0
  37. package/dist/types/studio.js.map +1 -0
  38. package/dist/types/utils.d.ts +4 -0
  39. package/dist/types/utils.d.ts.map +1 -0
  40. package/dist/types/utils.js +0 -0
  41. package/dist/utils/world.d.ts +28 -0
  42. package/dist/utils/world.d.ts.map +1 -0
  43. package/dist/utils/world.js +32 -0
  44. package/dist/utils/world.js.map +1 -0
  45. package/package.json +55 -5
@@ -0,0 +1,32 @@
1
+ const WORLD_ORIGIN = {
2
+ x: 0,
3
+ y: 0,
4
+ z: 0
5
+ };
6
+ function isForegroundStage(focusKey, activeFocusKey) {
7
+ return void 0 === focusKey || focusKey === activeFocusKey;
8
+ }
9
+ function getOrderDirection(orderOffset) {
10
+ if (0 === orderOffset) return 0;
11
+ return orderOffset > 0 ? 1 : -1;
12
+ }
13
+ function getStageWorldState({ mode, backgroundIndex, backgroundMidpoint, activeFocusIndex, escape }) {
14
+ const orderOffset = backgroundIndex - backgroundMidpoint;
15
+ const direction = getOrderDirection(orderOffset);
16
+ const theta = (20 * orderOffset + direction * activeFocusIndex * 2) / 180 * Math.PI;
17
+ const world = 'focus' === mode ? {
18
+ x: escape ? 0 : 600 * Math.sin(theta),
19
+ y: 0,
20
+ z: escape ? 0 : 600 * -Math.cos(theta)
21
+ } : WORLD_ORIGIN;
22
+ const zIndex = 'focus' === mode ? escape ? 100 : Math.ceil(2 * Math.abs(backgroundIndex - backgroundMidpoint)) : 0;
23
+ const maskOpacity = 'focus' === mode ? escape ? 0 : Math.max(0, Math.min(1, (1 - 0.6 * Math.abs(2 * theta / Math.PI)) * 0.5)) : 0;
24
+ return {
25
+ world,
26
+ zIndex,
27
+ maskOpacity
28
+ };
29
+ }
30
+ export { getStageWorldState, isForegroundStage };
31
+
32
+ //# sourceMappingURL=world.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils/world.js","sources":["../../src/utils/world.ts"],"sourcesContent":["// Copyright 2026 The Lynx Authors. All rights reserved.\n// Licensed under the Apache License Version 2.0 that can be found in the\n// LICENSE file in the root directory of this source tree.\n\nimport type { StudioViewMode } from '../types'\n\nexport interface WorldPos {\n x: number\n y: number\n z: number\n}\n\nexport interface StageWorldState {\n world: WorldPos\n zIndex: number\n maskOpacity: number\n}\n\nconst WORLD_ORIGIN: WorldPos = { x: 0, y: 0, z: 0 }\n\nexport function isForegroundStage(\n focusKey: string | undefined,\n activeFocusKey: string,\n): boolean {\n return focusKey === undefined || focusKey === activeFocusKey\n}\n\nfunction getOrderDirection(orderOffset: number): -1 | 0 | 1 {\n // Centered stages should not receive a focus-index angle offset.\n if (orderOffset === 0) return 0\n return orderOffset > 0 ? 1 : -1\n}\n\n/**\n * Resolves the presentation transform for a stage.\n *\n * In focus mode, `escape` marks foreground stages, which stay centered,\n * elevated, and unmasked. Focusable background stages use `backgroundIndex`\n * to fan out around the foreground, while `activeFocusIndex` adds a small\n * rotation offset so focus transitions preserve a sense of direction.\n */\nexport function getStageWorldState({\n mode,\n backgroundIndex,\n backgroundMidpoint,\n activeFocusIndex,\n escape,\n}: {\n mode: StudioViewMode\n backgroundIndex: number\n backgroundMidpoint: number\n activeFocusIndex: number\n escape: boolean\n}): StageWorldState {\n const orderOffset = backgroundIndex - backgroundMidpoint\n const direction = getOrderDirection(orderOffset)\n const theta = (orderOffset * 20 + direction * activeFocusIndex * 2)\n / 180 * Math.PI\n\n const world: WorldPos = mode === 'focus'\n ? {\n x: escape ? 0 : Math.sin(theta) * 600,\n y: 0,\n z: escape ? 0 : -Math.cos(theta) * 600,\n }\n : WORLD_ORIGIN\n\n const zIndex = mode === 'focus'\n ? (escape\n ? 100\n : Math.ceil(Math.abs(backgroundIndex - backgroundMidpoint) * 2))\n : 0\n\n const maskOpacity = mode === 'focus'\n ? (\n escape\n ? 0\n : Math.max(\n 0,\n Math.min(1, (1 - Math.abs(theta * 2 / Math.PI) * 0.6) * 0.5),\n )\n )\n : 0\n\n return {\n world,\n zIndex,\n maskOpacity,\n }\n}\n"],"names":["WORLD_ORIGIN","isForegroundStage","focusKey","activeFocusKey","undefined","getOrderDirection","orderOffset","getStageWorldState","mode","backgroundIndex","backgroundMidpoint","activeFocusIndex","escape","direction","theta","Math","world","zIndex","maskOpacity"],"mappings":"AAkBA,MAAMA,eAAyB;IAAE,GAAG;IAAG,GAAG;IAAG,GAAG;AAAE;AAE3C,SAASC,kBACdC,QAA4B,EAC5BC,cAAsB;IAEtB,OAAOD,AAAaE,WAAbF,YAA0BA,aAAaC;AAChD;AAEA,SAASE,kBAAkBC,WAAmB;IAE5C,IAAIA,AAAgB,MAAhBA,aAAmB,OAAO;IAC9B,OAAOA,cAAc,IAAI,IAAI;AAC/B;AAUO,SAASC,mBAAmB,EACjCC,IAAI,EACJC,eAAe,EACfC,kBAAkB,EAClBC,gBAAgB,EAChBC,MAAM,EAOP;IACC,MAAMN,cAAcG,kBAAkBC;IACtC,MAAMG,YAAYR,kBAAkBC;IACpC,MAAMQ,QAASR,AAAAA,CAAAA,AAAc,KAAdA,cAAmBO,YAAYF,mBAAmB,KAC7D,MAAMI,KAAK,EAAE;IAEjB,MAAMC,QAAkBR,AAAS,YAATA,OACpB;QACA,GAAGI,SAAS,IAAIG,AAAkB,MAAlBA,KAAK,GAAG,CAACD;QACzB,GAAG;QACH,GAAGF,SAAS,IAAI,AAAmB,MAAnB,CAACG,KAAK,GAAG,CAACD;IAC5B,IACEd;IAEJ,MAAMiB,SAAST,AAAS,YAATA,OACVI,SACC,MACAG,KAAK,IAAI,CAACA,AAAiD,IAAjDA,KAAK,GAAG,CAACN,kBAAkBC,uBACvC;IAEJ,MAAMQ,cAAcV,AAAS,YAATA,OAEhBI,SACI,IACAG,KAAK,GAAG,CACR,GACAA,KAAK,GAAG,CAAC,GAAI,KAAIA,AAAgC,MAAhCA,KAAK,GAAG,CAACD,AAAQ,IAARA,QAAYC,KAAK,EAAE,CAAM,IAAK,QAG5D;IAEJ,OAAO;QACLC;QACAC;QACAC;IACF;AACF"}
package/package.json CHANGED
@@ -1,14 +1,64 @@
1
1
  {
2
2
  "name": "@lynx-js/luna-studio",
3
- "version": "0.0.0-oidc-bootstrap.0",
4
- "description": "Reusable multi-stage choreography layer for the L.U.N.A project (OIDC bootstrap placeholder)",
3
+ "version": "0.1.1",
4
+ "description": "Reusable multi-stage choreography layer for the L.U.N.A project",
5
+ "keywords": [
6
+ "luna",
7
+ "studio",
8
+ "preview",
9
+ "choreography",
10
+ "react",
11
+ "lynx"
12
+ ],
13
+ "homepage": "https://github.com/lynx-family/lynx-ui/tree/main/luna/packages/luna-studio#readme",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/lynx-family/lynx-ui.git",
17
+ "directory": "luna/packages/luna-studio"
18
+ },
5
19
  "license": "Apache-2.0",
6
20
  "author": "The Lynx Authors",
21
+ "sideEffects": false,
22
+ "type": "module",
23
+ "exports": {
24
+ ".": {
25
+ "types": "./dist/index.d.ts",
26
+ "import": "./dist/index.js"
27
+ }
28
+ },
29
+ "main": "./dist/index.js",
30
+ "module": "./dist/index.js",
31
+ "types": "./dist/index.d.ts",
7
32
  "files": [
8
- "README.md",
9
- "LICENSE"
33
+ "dist",
34
+ "LICENSE",
35
+ "README.md"
10
36
  ],
37
+ "dependencies": {
38
+ "@lynx-js/luna-core": "0.2.1",
39
+ "@lynx-js/luna-stage": "0.1.0"
40
+ },
41
+ "devDependencies": {
42
+ "@lynx-js/web-core": "0.23.0",
43
+ "@rsbuild/plugin-react": "2.1.0",
44
+ "@rslib/core": "0.23.2",
45
+ "@types/react": "^18.3.8",
46
+ "motion": "12.42.2",
47
+ "react": "^18.3.1",
48
+ "react-dom": "^18.3.1",
49
+ "typescript": "^5.8.0",
50
+ "vitest": "2.1.9"
51
+ },
52
+ "peerDependencies": {
53
+ "@lynx-js/web-core": ">=0.20.0",
54
+ "motion": ">=12.23.16",
55
+ "react": ">=18.0.0"
56
+ },
11
57
  "publishConfig": {
12
58
  "access": "public"
59
+ },
60
+ "scripts": {
61
+ "build": "rslib build",
62
+ "test": "vitest run"
13
63
  }
14
- }
64
+ }