Skip to content

Commit a493075

Browse files
update panorama api and css
1 parent badb98f commit a493075

5 files changed

Lines changed: 52 additions & 4 deletions

File tree

‎.github/workflows/deploy.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
push:
55
branches: source
66
workflow_dispatch: # <-- добавлен ручной триггер
7+
repository_dispatch: # <-- триггер от внешнего репозитория
8+
types: [dota-data-updated]
79

810
jobs:
911
deploy:

‎api/src/components/layout/NavBar.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export const NavBar = () => (
1515
<NavBarLink to="/vscripts">Lua API</NavBarLink>
1616
<NavBarLink to="/events">Game Events</NavBarLink>
1717
<NavBarLink to="/panorama/api">Panorama API</NavBarLink>
18+
<NavBarLink to="/panorama/css">Panorama CSS</NavBarLink>
1819
<NavBarLink to="/panorama/events">Panorama Events</NavBarLink>
1920
<NavBarLink to="/modifiers">Modifiers</NavBarLink>
2021
<NavBarLink to="/convars">Convars</NavBarLink>

‎api/src/pages/data.ts‎

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { Declaration } from "~components/Docs/api";
33
import vscriptsEvents from "@moddota/dota-data/files/events";
44
import panoramaEvents from "@moddota/dota-data/files/panorama/events";
55
import panoramaEnums from "@moddota/dota-data/files/panorama/enums";
6+
import panoramaApi from "@moddota/dota-data/files/panorama/api";
7+
import panoramaCss from "@moddota/dota-data/files/panorama/css";
68
import { orderBy } from "lodash";
79
import { DeclarationsContextType } from "~components/Docs/DeclarationsContext";
810

@@ -76,9 +78,27 @@ export const scopes = {
7678
},
7779
panorama: {
7880
root: "/panorama/api",
79-
declarations: sort(
80-
panoramaEnums.map((declaration) => ({
81-
kind: "enum",
81+
declarations: sort([
82+
// Add API interfaces as classes with methods
83+
...panoramaApi.map((iface) => ({
84+
kind: "class" as const,
85+
name: iface.name,
86+
description: iface.description,
87+
isStarred: false,
88+
members: iface.members.map((member) => ({
89+
kind: "function" as const,
90+
name: member.name,
91+
description: member.description,
92+
args: member.args.map((arg) => ({
93+
name: arg.name,
94+
types: arg.type ? [arg.type] : ["any"],
95+
})),
96+
returns: member.returns ? [member.returns] : ["void"],
97+
})),
98+
})),
99+
// Add enums
100+
...panoramaEnums.map((declaration) => ({
101+
kind: "enum" as const,
82102
name: declaration.name,
83103
isStarred: false,
84104
members: declaration.members.map((member) => ({
@@ -87,6 +107,22 @@ export const scopes = {
87107
value: member.value,
88108
})),
89109
})),
110+
]),
111+
},
112+
panoramaCss: {
113+
root: "/panorama/css",
114+
declarations: sort(
115+
Object.entries(panoramaCss).map(([name, property]) => ({
116+
kind: "function" as const,
117+
name: name,
118+
description: property.description,
119+
isStarred: false,
120+
args: property.examples?.map((example, i) => ({
121+
name: `example${i + 1}`,
122+
types: [example],
123+
})) || [],
124+
returns: ["void"],
125+
})),
90126
),
91127
},
92128
panoramaEvents: {

‎api/src/pages/index.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import styled from "styled-components";
44

55
const EventsPage = React.lazy(() => import(/* webpackChunkName: "events" */ "./events"));
66
const VScriptsPage = React.lazy(() => import(/* webpackChunkName: "vscripts" */ "./vscripts"));
7-
const PanoramaApiPage = React.lazy(() => import(/* webpackChunkName: "panorama_events" */ "./panorama/api"));
7+
const PanoramaApiPage = React.lazy(() => import(/* webpackChunkName: "panorama_api" */ "./panorama/api"));
8+
const PanoramaCssPage = React.lazy(() => import(/* webpackChunkName: "panorama_css" */ "./panorama/css"));
89
const PanoramaEventsPage = React.lazy(() => import(/* webpackChunkName: "panorama_events" */ "./panorama/events"));
910
const ModifiersPage = React.lazy(() => import(/* webpackChunkName: "modifiers" */ "./modifiers"));
1011
const ConvarsPage = React.lazy(() => import(/* webpackChunkName: "convars" */ "./convars"));
@@ -25,6 +26,7 @@ export function AppRoutes() {
2526
<Route path="/events/:scope?" component={EventsPage} />
2627
<Route path="/vscripts/:scope?" component={VScriptsPage} />
2728
<Route path="/panorama/api/:scope?" component={PanoramaApiPage} />
29+
<Route path="/panorama/css/:scope?" component={PanoramaCssPage} />
2830
<Route path="/panorama/events/:scope?" component={PanoramaEventsPage} />
2931
<Route path="/modifiers" component={ModifiersPage} />
3032
<Route path="/convars" component={ConvarsPage} />
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import React from "react";
2+
import { scopes } from "../../data";
3+
import DeclarationsPage from "../../DeclarationsPage";
4+
5+
export default function PanoramaCssPage() {
6+
return <DeclarationsPage context={scopes.panoramaCss} hoist={[]}></DeclarationsPage>;
7+
}

0 commit comments

Comments
 (0)