@praeko/studio-kit 0.1.0 → 0.2.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.
@@ -0,0 +1,31 @@
1
+ import type { Theme } from "@praeko/studio-core";
2
+ export type LongCoverSpec = {
3
+ id: string;
4
+ title: [string, string];
5
+ mascot?: string;
6
+ code?: {
7
+ title: string;
8
+ lines: {
9
+ s: string;
10
+ hl?: boolean;
11
+ }[];
12
+ };
13
+ chips?: {
14
+ text: string;
15
+ color?: string;
16
+ }[];
17
+ color?: string;
18
+ glow?: string;
19
+ };
20
+ export declare const LongCover16x9: React.FC<{
21
+ spec: LongCoverSpec;
22
+ }>;
23
+ /** Vertical (Instagram): two-line title, code card, chips and the mascot, inside the Shorts cover `Frame`. */
24
+ export declare const LongCoverVertical: React.FC<{
25
+ spec: LongCoverSpec;
26
+ }>;
27
+ /** The two Stills of a long-video cover: `<id>` (1280x720) and `<id>Vertical` (1080x1920). */
28
+ export declare const LongCovers: React.FC<{
29
+ spec: LongCoverSpec;
30
+ theme: Theme;
31
+ }>;
@@ -0,0 +1,67 @@
1
+ import type { LongData, Theme, Word } from "@praeko/studio-core";
2
+ import type { LongCoverSpec } from "./long-cover.js";
3
+ export type Time = number | string | {
4
+ when: string;
5
+ nth?: number;
6
+ after?: number;
7
+ plus?: number;
8
+ };
9
+ type Pos = {
10
+ left?: number;
11
+ top?: number;
12
+ w?: number;
13
+ h?: number;
14
+ };
15
+ export type ItemL = {
16
+ type: string;
17
+ when?: Time;
18
+ pos?: Pos;
19
+ color?: string;
20
+ size?: number;
21
+ text?: string;
22
+ parts?: {
23
+ text: string;
24
+ color?: string;
25
+ mono?: boolean;
26
+ }[];
27
+ [k: string]: any;
28
+ };
29
+ export type LongSceneSpec = {
30
+ n?: string;
31
+ title: string;
32
+ start: number;
33
+ items?: ItemL[];
34
+ component?: string;
35
+ };
36
+ export type LongSpec = {
37
+ id: string;
38
+ durS: number;
39
+ voice: string;
40
+ engine?: string;
41
+ scenes: LongSceneSpec[];
42
+ cover?: LongCoverSpec;
43
+ endcard?: {
44
+ start: number;
45
+ text?: string;
46
+ link?: string;
47
+ image?: string;
48
+ };
49
+ mascot?: {
50
+ when: Time;
51
+ name: string;
52
+ plus?: number;
53
+ }[];
54
+ };
55
+ export declare function longDataFromSpec(spec: LongSpec, words: Word[], T: Theme, components?: Record<string, React.FC<{
56
+ t: number;
57
+ }>>): LongData;
58
+ /** Registers the long video Composition (1920x1080). */
59
+ export declare const LongDecl: React.FC<{
60
+ spec: LongSpec;
61
+ words: Word[];
62
+ theme: Theme;
63
+ components?: Record<string, React.FC<{
64
+ t: number;
65
+ }>>;
66
+ }>;
67
+ export {};
@@ -1,22 +1,22 @@
1
- /** 0 → 1 a partir de `q` (linear, d = 0,3 s), como nos longos. */
2
- export declare const surgeL: (t: number, q: number, d?: number) => number;
3
- /** Colore uma linha de código/SQL (palavras-chave, funções, números, strings, comentários). */
1
+ /** 0 -> 1 from `q` (linear, d = 0.3 s), as in long videos. */
2
+ export declare const appearL: (t: number, q: number, d?: number) => number;
3
+ /** Colors a line of code/SQL (keywords, functions, numbers, strings, comments). */
4
4
  export declare const colorize: (s: string, c: {
5
- texto: string;
6
- suave: string;
5
+ text: string;
6
+ muted: string;
7
7
  ok: string;
8
- destaque: string;
8
+ accent: string;
9
9
  info: string;
10
10
  }) => (import("react/jsx-runtime").JSX.Element | null)[];
11
- export type LinhaCodigo = {
11
+ export type CodeLine = {
12
12
  s: string;
13
13
  hl?: [number, number];
14
14
  red?: boolean;
15
15
  };
16
- /** Bloco de código com linhas que acendem entre `hl[0]` e `hl[1]` (s globais). */
17
- export declare const CodigoL: React.FC<{
18
- titulo: string;
19
- lines: LinhaCodigo[];
16
+ /** Code block whose lines light up between `hl[0]` and `hl[1]` (global s). */
17
+ export declare const CodeL: React.FC<{
18
+ title: string;
19
+ lines: CodeLine[];
20
20
  t: number;
21
21
  q: number;
22
22
  w: number;
@@ -24,14 +24,14 @@ export declare const CodigoL: React.FC<{
24
24
  left: number;
25
25
  top: number;
26
26
  }>;
27
- export declare const CartaoL: React.FC<{
27
+ export declare const CardL: React.FC<{
28
28
  t: number;
29
29
  q: number;
30
30
  left: number;
31
31
  top: number;
32
32
  w: number;
33
33
  h?: number;
34
- cor?: string;
34
+ color?: string;
35
35
  children: React.ReactNode;
36
36
  }>;
37
37
  export declare const ChipL: React.FC<{
@@ -39,18 +39,18 @@ export declare const ChipL: React.FC<{
39
39
  q: number;
40
40
  left: number;
41
41
  top: number;
42
- cor?: string;
42
+ color?: string;
43
43
  size?: number;
44
44
  children: React.ReactNode;
45
45
  }>;
46
- export declare const TxtL: React.FC<{
46
+ export declare const TextL: React.FC<{
47
47
  t: number;
48
48
  q: number;
49
49
  left: number;
50
50
  top: number;
51
51
  w?: number;
52
52
  size?: number;
53
- cor?: string;
53
+ color?: string;
54
54
  align?: "left" | "center";
55
55
  mono?: boolean;
56
56
  children: React.ReactNode;
@@ -0,0 +1,90 @@
1
+ /** Central panel of a Short: always the same size and place (70 px margin, clear of the label and the captions). */
2
+ export declare const Panel: React.FC<{
3
+ title: string;
4
+ dur: number;
5
+ children: React.ReactNode;
6
+ }>;
7
+ export declare const Box: React.FC<{
8
+ t: number;
9
+ q: number;
10
+ color: string;
11
+ children: React.ReactNode;
12
+ mono?: boolean;
13
+ size?: number;
14
+ dim?: boolean;
15
+ dash?: boolean;
16
+ }>;
17
+ export declare const Line: React.FC<{
18
+ t: number;
19
+ q: number;
20
+ color?: string;
21
+ size?: number;
22
+ children: React.ReactNode;
23
+ }>;
24
+ export declare const Big: React.FC<{
25
+ t: number;
26
+ q: number;
27
+ color?: string;
28
+ size: number;
29
+ mono?: boolean;
30
+ children: React.ReactNode;
31
+ }>;
32
+ export declare const Bubble: React.FC<{
33
+ t: number;
34
+ q: number;
35
+ color: string;
36
+ children: React.ReactNode;
37
+ author?: string;
38
+ }>;
39
+ /** Code block with marked lines (the marked line color comes in `color`). */
40
+ export declare const Code: React.FC<{
41
+ t: number;
42
+ q: number;
43
+ title: string;
44
+ color: string;
45
+ lines: {
46
+ s: string;
47
+ color?: string;
48
+ mark?: boolean;
49
+ }[];
50
+ }>;
51
+ /** Real footage (of the game, or any recorded app) in a framed window, with optional crop and a slow camera push. */
52
+ export declare const Window: React.FC<{
53
+ t: number;
54
+ q: number;
55
+ src: string;
56
+ clipDuration: number;
57
+ from: number;
58
+ left: number;
59
+ top: number;
60
+ w: number;
61
+ reg?: [number, number, number, number];
62
+ tag?: string;
63
+ dur: number;
64
+ }>;
65
+ /** Vertical recording (phone) in a device frame. */
66
+ export declare const Phone: React.FC<{
67
+ t: number;
68
+ q: number;
69
+ src: string;
70
+ clipDuration: number;
71
+ from: number;
72
+ left: number;
73
+ top: number;
74
+ w: number;
75
+ dur: number;
76
+ }>;
77
+ /** Pixel-art mascot on a card. The image path comes from the theme (`mascotPath`, default `mascots/{name}.png`); `path` overrides it. */
78
+ export declare const Mascot: React.FC<{
79
+ name: string;
80
+ size?: number;
81
+ path?: string;
82
+ }>;
83
+ /** Frame of the vertical covers (content between y=260 and y=1660, the 3:4 crop of the Instagram grid). */
84
+ export declare const Frame: React.FC<{
85
+ glow: string;
86
+ title: [string, string, string?];
87
+ color: string;
88
+ children: React.ReactNode;
89
+ size?: number;
90
+ }>;
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@praeko/studio-kit",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
- "description": "Peças de cena do Praeko Studio (painel, caixa, linha, balão, código, janela, celular, moldura) e o episódio declarativo que lê o episodio.yaml compilado. Biblioteca para projetos criados com `praeko studio init`.",
5
+ "description": "Praeko Studio scene parts (panel, box, line, bubble, code, window, phone, frame) and the declarative episode that reads the compiled episode.yaml. A library for projects created with `praeko studio init`.",
6
6
  "license": "MIT",
7
7
  "keywords": [
8
8
  "praeko",
@@ -44,10 +44,11 @@
44
44
  "scripts": {
45
45
  "build": "node ../../../scripts/build-studio.mjs kit",
46
46
  "prepack": "npm run build",
47
- "typecheck": "tsc --noEmit -p tsconfig.json"
47
+ "typecheck": "tsc --noEmit -p tsconfig.json",
48
+ "test": "node --test test/*.test.ts"
48
49
  },
49
50
  "peerDependencies": {
50
- "@praeko/studio-core": "^0.1.0",
51
+ "@praeko/studio-core": "^0.2.0",
51
52
  "react": "^19.0.0",
52
53
  "remotion": "^4.0.539"
53
54
  },
@@ -1,31 +0,0 @@
1
- import { Tema } from "@praeko/studio-core";
2
- export type CapaLongoSpec = {
3
- id: string;
4
- titulo: [string, string];
5
- gato?: string;
6
- codigo?: {
7
- titulo: string;
8
- linhas: {
9
- s: string;
10
- hl?: boolean;
11
- }[];
12
- };
13
- chips?: {
14
- texto: string;
15
- cor?: string;
16
- }[];
17
- cor?: string;
18
- glow?: string;
19
- };
20
- export declare const CapaLongo16x9: React.FC<{
21
- spec: CapaLongoSpec;
22
- }>;
23
- /** Vertical (Instagram): título em duas linhas, cartão de código, chips e o gato, dentro da `Moldura` das capas dos Shorts. */
24
- export declare const CapaLongoVertical: React.FC<{
25
- spec: CapaLongoSpec;
26
- }>;
27
- /** As duas Stills de uma capa de longo: `<id>` (1280×720) e `<id>Vertical` (1080×1920). */
28
- export declare const CapasLongo: React.FC<{
29
- spec: CapaLongoSpec;
30
- tema: Tema;
31
- }>;
@@ -1,65 +0,0 @@
1
- import { EpData, Palavra, Tema } from "@praeko/studio-core";
2
- type Cor = string;
3
- export type Item = {
4
- tipo: string;
5
- quando?: string | [string, number];
6
- em?: number;
7
- pos?: {
8
- left?: number;
9
- right?: number;
10
- top?: number;
11
- bottom?: number;
12
- w?: number;
13
- h?: number;
14
- };
15
- [k: string]: any;
16
- };
17
- export type CenaSpec = {
18
- inicio: number;
19
- fim?: number;
20
- rotulo?: string;
21
- sons?: {
22
- at: number;
23
- f: "pop" | "ding" | "thump" | "whoosh";
24
- v?: number;
25
- }[];
26
- layout?: "painel" | "livre";
27
- titulo?: string;
28
- itens?: Item[];
29
- componente?: string;
30
- };
31
- export type EpSpec = {
32
- id: string;
33
- durS: number;
34
- legendaPx?: number;
35
- voz: string;
36
- fundoLinhas?: string[];
37
- golpes?: {
38
- at: number;
39
- tipo: "shake" | "zoom" | "flash" | "tudo";
40
- }[];
41
- fechamento: {
42
- a: number;
43
- cta: string;
44
- };
45
- cenas: CenaSpec[];
46
- capa?: {
47
- id: string;
48
- componente?: string;
49
- titulo?: [string, string, string?];
50
- cor?: Cor;
51
- glow?: string;
52
- tam?: number;
53
- itens?: Item[];
54
- };
55
- };
56
- /** Monta o EpData: cada cena vira um componente (declarativo ou, com `componente`, um TSX do projeto). */
57
- export declare function epDataDeSpec(spec: EpSpec, palavras: Palavra[], pecas?: Record<string, React.FC<any>>): EpData;
58
- /** `<EpisodioDecl spec palavras tema pecas />` registra a Composition do episódio e a Still da capa. */
59
- export declare const EpisodioDecl: React.FC<{
60
- spec: EpSpec;
61
- palavras: Palavra[];
62
- tema: Tema;
63
- pecas?: Record<string, React.FC<any>>;
64
- }>;
65
- export {};
@@ -1,61 +0,0 @@
1
- import { LongoData, Palavra, Tema } from "@praeko/studio-core";
2
- import { CapaLongoSpec } from "./capa-longo";
3
- export type Tempo = number | string | {
4
- quando: string;
5
- nth?: number;
6
- depois?: number;
7
- mais?: number;
8
- };
9
- type Pos = {
10
- left?: number;
11
- top?: number;
12
- w?: number;
13
- h?: number;
14
- };
15
- export type ItemL = {
16
- tipo: string;
17
- quando?: Tempo;
18
- pos?: Pos;
19
- cor?: string;
20
- tamanho?: number;
21
- texto?: string;
22
- partes?: {
23
- texto: string;
24
- cor?: string;
25
- mono?: boolean;
26
- }[];
27
- [k: string]: any;
28
- };
29
- export type CenaLSpec = {
30
- n?: string;
31
- titulo: string;
32
- inicio: number;
33
- itens?: ItemL[];
34
- componente?: string;
35
- };
36
- export type LongoSpec = {
37
- id: string;
38
- durS: number;
39
- voz: string;
40
- cenas: CenaLSpec[];
41
- capa?: CapaLongoSpec;
42
- fecho?: {
43
- inicio: number;
44
- texto?: string;
45
- link?: string;
46
- imagem?: string;
47
- };
48
- };
49
- export declare function longoDeSpec(spec: LongoSpec, palavras: Palavra[], T: Tema, pecas?: Record<string, React.FC<{
50
- t: number;
51
- }>>): LongoData;
52
- /** Registra a Composition do longo (1920×1080). */
53
- export declare const LongoDecl: React.FC<{
54
- spec: LongoSpec;
55
- palavras: Palavra[];
56
- tema: Tema;
57
- pecas?: Record<string, React.FC<{
58
- t: number;
59
- }>>;
60
- }>;
61
- export {};
package/dist/pecas.d.ts DELETED
@@ -1,89 +0,0 @@
1
- /** Painel central de um Short: mesmo tamanho e lugar sempre (margem de 70 px, longe do rótulo e da legenda). */
2
- export declare const PainelD: React.FC<{
3
- titulo: string;
4
- dur: number;
5
- children: React.ReactNode;
6
- }>;
7
- export declare const Caixa: React.FC<{
8
- t: number;
9
- q: number;
10
- cor: string;
11
- children: React.ReactNode;
12
- mono?: boolean;
13
- size?: number;
14
- dim?: boolean;
15
- dash?: boolean;
16
- }>;
17
- export declare const Linha: React.FC<{
18
- t: number;
19
- q: number;
20
- cor?: string;
21
- size?: number;
22
- children: React.ReactNode;
23
- }>;
24
- export declare const Big: React.FC<{
25
- t: number;
26
- q: number;
27
- cor?: string;
28
- size: number;
29
- mono?: boolean;
30
- children: React.ReactNode;
31
- }>;
32
- export declare const Balao: React.FC<{
33
- t: number;
34
- q: number;
35
- cor: string;
36
- children: React.ReactNode;
37
- autor?: string;
38
- }>;
39
- /** Bloco de código com linhas marcadas (a cor da linha marcada vem em `cor`). */
40
- export declare const Codigo: React.FC<{
41
- t: number;
42
- q: number;
43
- titulo: string;
44
- cor: string;
45
- linhas: {
46
- s: string;
47
- cor?: string;
48
- marca?: boolean;
49
- }[];
50
- }>;
51
- /** Cena real do jogo (ou de qualquer app gravado) numa janela com moldura, recorte opcional e empurrão lento de câmera. */
52
- export declare const Janela: React.FC<{
53
- t: number;
54
- q: number;
55
- src: string;
56
- duracao: number;
57
- de: number;
58
- left: number;
59
- top: number;
60
- w: number;
61
- reg?: [number, number, number, number];
62
- tag?: string;
63
- dur: number;
64
- }>;
65
- /** Gravação vertical (celular) com moldura de aparelho. */
66
- export declare const Celular: React.FC<{
67
- t: number;
68
- q: number;
69
- src: string;
70
- duracao: number;
71
- de: number;
72
- left: number;
73
- top: number;
74
- w: number;
75
- dur: number;
76
- }>;
77
- /** Mascote em pixel art num cartão (arquivo `gatos/gato-<nome>.png`; troque o prefixo no projeto se o mascote for outro). */
78
- export declare const Gato: React.FC<{
79
- nome: string;
80
- tam?: number;
81
- }>;
82
- /** Moldura das capas verticais (conteúdo entre y=260 e y=1660, recorte 3:4 da grade do Instagram). */
83
- export declare const Moldura: React.FC<{
84
- glow: string;
85
- titulo: [string, string, string?];
86
- cor: string;
87
- children: React.ReactNode;
88
- tam?: number;
89
- }>;