@lynx-js/luna-studio 0.0.0-oidc-bootstrap.0 → 0.1.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/LICENSE +1 -1
- package/README.md +416 -5
- package/dist/choreography/choreography-view.d.ts +9 -0
- package/dist/choreography/choreography-view.d.ts.map +1 -0
- package/dist/choreography/choreography-view.js +256 -0
- package/dist/choreography/choreography-view.js.map +1 -0
- package/dist/choreography/choreography.d.ts +10 -0
- package/dist/choreography/choreography.d.ts.map +1 -0
- package/dist/choreography/choreography.js +17 -0
- package/dist/choreography/choreography.js.map +1 -0
- package/dist/choreography/index.d.ts +3 -0
- package/dist/choreography/index.d.ts.map +1 -0
- package/dist/choreography/index.js +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/lynx-stage/index.d.ts +3 -0
- package/dist/lynx-stage/index.d.ts.map +1 -0
- package/dist/lynx-stage/index.js +1 -0
- package/dist/lynx-stage/studio-lynx-stage.d.ts +5 -0
- package/dist/lynx-stage/studio-lynx-stage.d.ts.map +1 -0
- package/dist/lynx-stage/studio-lynx-stage.js +26 -0
- package/dist/lynx-stage/studio-lynx-stage.js.map +1 -0
- package/dist/types/choreography.d.ts +106 -0
- package/dist/types/choreography.d.ts.map +1 -0
- package/dist/types/choreography.js +9 -0
- package/dist/types/choreography.js.map +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +0 -0
- package/dist/types/lynx-stage.d.ts +20 -0
- package/dist/types/lynx-stage.d.ts.map +1 -0
- package/dist/types/lynx-stage.js +0 -0
- package/dist/types/studio.d.ts +115 -0
- package/dist/types/studio.d.ts.map +1 -0
- package/dist/types/studio.js +60 -0
- package/dist/types/studio.js.map +1 -0
- package/dist/types/utils.d.ts +4 -0
- package/dist/types/utils.d.ts.map +1 -0
- package/dist/types/utils.js +0 -0
- package/dist/utils/world.d.ts +27 -0
- package/dist/utils/world.d.ts.map +1 -0
- package/dist/utils/world.js +29 -0
- package/dist/utils/world.js.map +1 -0
- package/package.json +55 -5
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const WORLD_ORIGIN = {
|
|
2
|
+
x: 0,
|
|
3
|
+
y: 0,
|
|
4
|
+
z: 0
|
|
5
|
+
};
|
|
6
|
+
function getOrderDirection(orderOffset) {
|
|
7
|
+
if (0 === orderOffset) return 0;
|
|
8
|
+
return orderOffset > 0 ? 1 : -1;
|
|
9
|
+
}
|
|
10
|
+
function getStageWorldState({ mode, compOrder, mid, focusedIndex, escape }) {
|
|
11
|
+
const orderOffset = compOrder - mid;
|
|
12
|
+
const direction = getOrderDirection(orderOffset);
|
|
13
|
+
const theta = (20 * orderOffset + direction * focusedIndex * 2) / 180 * Math.PI;
|
|
14
|
+
const world = 'focus' === mode ? {
|
|
15
|
+
x: escape ? 0 : 600 * Math.sin(theta),
|
|
16
|
+
y: 0,
|
|
17
|
+
z: escape ? 0 : 600 * -Math.cos(theta)
|
|
18
|
+
} : WORLD_ORIGIN;
|
|
19
|
+
const zIndex = 'focus' === mode ? escape ? 100 : Math.ceil(2 * Math.abs(compOrder - mid)) : 0;
|
|
20
|
+
const maskOpacity = 'focus' === mode ? escape ? 0 : Math.max(0, Math.min(1, (1 - 0.6 * Math.abs(2 * theta / Math.PI)) * 0.5)) : 0;
|
|
21
|
+
return {
|
|
22
|
+
world,
|
|
23
|
+
zIndex,
|
|
24
|
+
maskOpacity
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export { getStageWorldState };
|
|
28
|
+
|
|
29
|
+
//# 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\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 the active focused stage, which stays centered,\n * elevated, and unmasked. Non-focused stages use `compOrder` to fan out around\n * that active stage, while `focusedIndex` adds a small rotation offset so focus\n * transitions preserve a sense of direction.\n */\nexport function getStageWorldState({\n mode,\n compOrder,\n mid,\n focusedIndex,\n escape,\n}: {\n mode: StudioViewMode\n compOrder: number\n mid: number\n focusedIndex: number\n escape: boolean\n}): StageWorldState {\n const orderOffset = compOrder - mid\n const direction = getOrderDirection(orderOffset)\n const theta = (orderOffset * 20 + direction * focusedIndex * 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 ? 100 : Math.ceil(Math.abs(compOrder - mid) * 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","getOrderDirection","orderOffset","getStageWorldState","mode","compOrder","mid","focusedIndex","escape","direction","theta","Math","world","zIndex","maskOpacity"],"mappings":"AAkBA,MAAMA,eAAyB;IAAE,GAAG;IAAG,GAAG;IAAG,GAAG;AAAE;AAElD,SAASC,kBAAkBC,WAAmB;IAE5C,IAAIA,AAAgB,MAAhBA,aAAmB,OAAO;IAC9B,OAAOA,cAAc,IAAI,IAAI;AAC/B;AAUO,SAASC,mBAAmB,EACjCC,IAAI,EACJC,SAAS,EACTC,GAAG,EACHC,YAAY,EACZC,MAAM,EAOP;IACC,MAAMN,cAAcG,YAAYC;IAChC,MAAMG,YAAYR,kBAAkBC;IACpC,MAAMQ,QAASR,AAAAA,CAAAA,AAAc,KAAdA,cAAmBO,YAAYF,eAAe,KACzD,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,IACEV;IAEJ,MAAMa,SAAST,AAAS,YAATA,OACVI,SAAS,MAAMG,KAAK,IAAI,CAACA,AAA4B,IAA5BA,KAAK,GAAG,CAACN,YAAYC,QAC/C;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.
|
|
4
|
-
"description": "Reusable multi-stage choreography layer for the L.U.N.A project
|
|
3
|
+
"version": "0.1.0",
|
|
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
|
-
"
|
|
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
|
+
}
|