builder.io 1.0.2 → 1.1.13-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.
- package/README.md +100 -1
- package/angular/index.cjs +1 -0
- package/angular/index.d.ts +1 -0
- package/angular/index.mjs +1 -0
- package/cli/index.cjs +1201 -0
- package/core/index.cjs +808 -0
- package/core/index.d.ts +1 -0
- package/core/index.mjs +808 -0
- package/figma/index.cjs +1 -0
- package/figma/index.d.ts +1 -0
- package/figma/index.mjs +1 -0
- package/figma/jsx-runtime/index.cjs +7 -0
- package/figma/jsx-runtime/index.d.ts +46 -0
- package/figma/jsx-runtime/index.js +7 -0
- package/figma/jsx-runtime/prop-types.d.ts +125 -0
- package/figma/jsx-runtime/react.d.ts +5221 -0
- package/next/index.cjs +36 -0
- package/next/index.d.ts +8 -0
- package/next/index.mjs +36 -0
- package/node/index.cjs +1 -0
- package/node/index.d.ts +1 -0
- package/node/index.mjs +1 -0
- package/package.json +28 -8
- package/remix/build.cjs +1 -0
- package/remix/index.cjs +3 -0
- package/remix/index.d.ts +1 -0
- package/remix/index.mjs +1 -0
- package/remix/server-build/index.cjs +99 -0
- package/remix/server-build/index.d.ts +1 -0
- package/remix/server-build/index.mjs +60 -0
- package/remix/server-build/package.json +6 -0
- package/server/index.cjs +249 -0
- package/server/index.d.ts +1 -0
- package/server/index.mjs +249 -0
- package/types/angular/index.d.ts +1 -0
- package/types/cli/builder-add/interface.d.ts +36 -0
- package/types/cli/builder-add/options.d.ts +7 -0
- package/types/cli/credentials.d.ts +41 -0
- package/types/cli/download.d.ts +10 -0
- package/types/cli/figma-publish.d.ts +22 -0
- package/types/cli/figma.d.ts +11 -0
- package/types/cli/generate.d.ts +53 -0
- package/types/cli/help.d.ts +1 -0
- package/types/cli/index.d.ts +2 -0
- package/types/cli/kv.d.ts +20 -0
- package/types/cli/prettier.d.ts +1 -0
- package/types/client/client-api.d.ts +11 -0
- package/types/client/edit-button/document-listeners.d.ts +2 -0
- package/types/client/edit-button/index.d.ts +8 -0
- package/types/client/index.d.ts +1 -0
- package/types/client/menu/index.d.ts +5 -0
- package/types/client/menu/pages/component-detail.d.ts +4 -0
- package/types/client/menu/pages/component-input.d.ts +3 -0
- package/types/client/menu/pages/component-list.d.ts +3 -0
- package/types/client/menu/pages/home.d.ts +1 -0
- package/types/client/menu/pages/settings.d.ts +1 -0
- package/types/client/menu/toggle/menu-toggle.d.ts +2 -0
- package/types/client/setup-ui/connected.d.ts +1 -0
- package/types/client/setup-ui/index.d.ts +1 -0
- package/types/client/setup-ui/overview.d.ts +4 -0
- package/types/client/tracking.d.ts +22 -0
- package/types/client/utils.d.ts +14 -0
- package/types/common/ast/app-dependencies.d.ts +4 -0
- package/types/common/ast/component-info.d.ts +8 -0
- package/types/common/ast/component-input-types.d.ts +24 -0
- package/types/common/ast/component-registry.d.ts +9 -0
- package/types/common/ast/convert-values.d.ts +11 -0
- package/types/common/ast/convert-values.unit.d.ts +1 -0
- package/types/common/ast/ensure-array-statement.d.ts +7 -0
- package/types/common/ast/ensure-array-statement.unit.d.ts +1 -0
- package/types/common/ast/ensure-comments.d.ts +1 -0
- package/types/common/ast/ensure-imports.d.ts +9 -0
- package/types/common/ast/ensure-imports.unit.d.ts +1 -0
- package/types/common/ast/exported-statements.d.ts +8 -0
- package/types/common/ast/exported-statements.unit.d.ts +1 -0
- package/types/common/ast/normalize-statements.d.ts +7 -0
- package/types/common/ast/normalize-statements.unit.d.ts +1 -0
- package/types/common/ast/remove-unused-imports.d.ts +3 -0
- package/types/common/ast/remove-unused-imports.unit.d.ts +1 -0
- package/types/common/ast/transform.d.ts +5 -0
- package/types/common/ast/utils.d.ts +26 -0
- package/types/common/ast/utils.unit.d.ts +1 -0
- package/types/common/builder/builder-api.d.ts +26 -0
- package/types/common/builder/builder-sdks.d.ts +9 -0
- package/types/common/builder/content-generation.d.ts +8 -0
- package/types/common/builder/content-ids.d.ts +3 -0
- package/types/common/cache.d.ts +3 -0
- package/types/common/constants.d.ts +14 -0
- package/types/common/dotenv.d.ts +6 -0
- package/types/common/fs.d.ts +4 -0
- package/types/common/mem-sys.d.ts +8 -0
- package/types/common/node-request.d.ts +7 -0
- package/types/common/path.d.ts +4 -0
- package/types/common/test-utils.d.ts +7 -0
- package/types/common/typescript.d.ts +9 -0
- package/types/common/utils.d.ts +17 -0
- package/types/common/utils.unit.d.ts +1 -0
- package/types/core/adapters/angular/angular-api-key.d.ts +10 -0
- package/types/core/adapters/angular/angular-api-key.unit.d.ts +1 -0
- package/types/core/adapters/angular/angular-app-module-imports.d.ts +3 -0
- package/types/core/adapters/angular/angular-app-module-imports.unit.d.ts +1 -0
- package/types/core/adapters/angular/angular-components.d.ts +18 -0
- package/types/core/adapters/angular/angular-components.unit.d.ts +1 -0
- package/types/core/adapters/angular/angular-ensure-builder-setup.d.ts +5 -0
- package/types/core/adapters/angular/angular-ensure-config-plugin.d.ts +9 -0
- package/types/core/adapters/angular/angular-ensure-config-plugin.unit.d.ts +1 -0
- package/types/core/adapters/angular/angular-registry-parse.d.ts +16 -0
- package/types/core/adapters/angular/angular-registry-parse.unit.d.ts +1 -0
- package/types/core/adapters/angular/angular-registry.d.ts +3 -0
- package/types/core/adapters/angular/angular-registry.unit.d.ts +1 -0
- package/types/core/adapters/angular/angular-test-utils.d.ts +6 -0
- package/types/core/adapters/angular/index.d.ts +13 -0
- package/types/core/adapters/next/index.d.ts +14 -0
- package/types/core/adapters/next/next-api-key.d.ts +4 -0
- package/types/core/adapters/next/next-component-info.d.ts +5 -0
- package/types/core/adapters/next/next-component-info.unit.d.ts +1 -0
- package/types/core/adapters/next/next-component-inputs.unit.d.ts +1 -0
- package/types/core/adapters/next/next-component-source-inputs.unit.d.ts +1 -0
- package/types/core/adapters/next/next-components.d.ts +4 -0
- package/types/core/adapters/next/next-ensure-builder-setup.d.ts +4 -0
- package/types/core/adapters/next/next-ensure-config-plugin.d.ts +3 -0
- package/types/core/adapters/next/next-ensure-config-plugin.unit.d.ts +1 -0
- package/types/core/adapters/next/next-registry-parse.d.ts +14 -0
- package/types/core/adapters/next/next-registry-parse.unit.d.ts +1 -0
- package/types/core/adapters/next/next-registry.d.ts +3 -0
- package/types/core/adapters/next/next-registry.unit.d.ts +1 -0
- package/types/core/adapters/next/next-test-utils.d.ts +16 -0
- package/types/core/adapters/qwik-city/index.d.ts +8 -0
- package/types/core/adapters/qwik-city/qwik-api-key.d.ts +4 -0
- package/types/core/adapters/qwik-city/qwik-component-source-inputs.d.ts +3 -0
- package/types/core/adapters/qwik-city/qwik-components.d.ts +15 -0
- package/types/core/adapters/qwik-city/qwik-components.unit.d.ts +1 -0
- package/types/core/adapters/qwik-city/qwik-ensure-builder-setup.d.ts +4 -0
- package/types/core/adapters/qwik-city/qwik-ensure-config-plugin.d.ts +2 -0
- package/types/core/adapters/qwik-city/qwik-registry-parse.d.ts +16 -0
- package/types/core/adapters/qwik-city/qwik-registry-parse.unit.d.ts +1 -0
- package/types/core/adapters/qwik-city/qwik-registry.d.ts +3 -0
- package/types/core/adapters/qwik-city/qwik-registry.unit.d.ts +1 -0
- package/types/core/adapters/qwik-city/qwik-test-utils.d.ts +6 -0
- package/types/core/adapters/qwik-city/qwik-ts-program.d.ts +2 -0
- package/types/core/adapters/react/index.d.ts +13 -0
- package/types/core/adapters/react/react-api-key.d.ts +6 -0
- package/types/core/adapters/react/react-builder-sdk-setup.d.ts +2 -0
- package/types/core/adapters/react/react-component-info.d.ts +5 -0
- package/types/core/adapters/react/react-components.d.ts +18 -0
- package/types/core/adapters/react/react-components.unit.d.ts +1 -0
- package/types/core/adapters/react/react-ensure-builder-setup.d.ts +4 -0
- package/types/core/adapters/react/react-registry-parse.d.ts +12 -0
- package/types/core/adapters/react/react-registry-parse.unit.d.ts +1 -0
- package/types/core/adapters/react/react-registry.d.ts +3 -0
- package/types/core/adapters/react/react-registry.unit.d.ts +1 -0
- package/types/core/adapters/react/react-test-utils.d.ts +6 -0
- package/types/core/adapters/react/react-ts-program.d.ts +2 -0
- package/types/core/adapters/remix/index.d.ts +12 -0
- package/types/core/adapters/remix/remix-api-key.d.ts +4 -0
- package/types/core/adapters/remix/remix-components.d.ts +4 -0
- package/types/core/adapters/remix/remix-ensure-builder-setup.d.ts +5 -0
- package/types/core/adapters/remix/remix-ensure-config-plugin.d.ts +3 -0
- package/types/core/adapters/remix/remix-ensure-config-plugin.unit.d.ts +1 -0
- package/types/core/adapters/remix/remix-registry-parse.d.ts +16 -0
- package/types/core/adapters/remix/remix-registry.d.ts +3 -0
- package/types/core/adapters/remix/remix-registry.unit.d.ts +1 -0
- package/types/core/adapters/remix/remix-test-utils.d.ts +6 -0
- package/types/core/adapters/vite/vite-ensure-config-plugin.d.ts +3 -0
- package/types/core/adapters/vite/vite-ensure-config-plugin.unit.d.ts +1 -0
- package/types/core/adapters/webpack/webpack-ensure-config-plugin.d.ts +3 -0
- package/types/core/client-script.d.ts +1 -0
- package/types/core/create-dev-tools.d.ts +2 -0
- package/types/core/detect-frameworks.d.ts +3 -0
- package/types/core/ensure-config-plugin.d.ts +3 -0
- package/types/core/import-export-registry.d.ts +3 -0
- package/types/core/index.d.ts +8 -0
- package/types/figma/index.d.ts +76 -0
- package/types/figma/jsx-runtime/index.d.cts +2 -0
- package/types/figma/jsx-runtime/index.d.ts +2 -0
- package/types/next/index.d.cts +4 -0
- package/types/next/index.d.mts +4 -0
- package/types/node/index.d.ts +2 -0
- package/types/node/node-sys.d.ts +11 -0
- package/types/remix/index-shim.d.cts +2 -0
- package/types/remix/index.d.ts +6 -0
- package/types/server/auth.d.ts +2 -0
- package/types/server/builder-connect.d.ts +3 -0
- package/types/server/client-script.d.ts +3 -0
- package/types/server/create-dev-tools-server.d.ts +2 -0
- package/types/server/dev-tools-api.d.ts +2 -0
- package/types/server/dev-tools-http-server.d.ts +2 -0
- package/types/server/index.d.ts +3 -0
- package/types/server/request-handler.d.ts +4 -0
- package/types/types.d.ts +415 -0
- package/types/vite/index.d.ts +7 -0
- package/types/webpack/index.d.ts +9 -0
- package/vite/index.cjs +3 -0
- package/vite/index.d.ts +1 -0
- package/vite/index.mjs +3 -0
- package/webpack/index.cjs +30 -0
- package/webpack/index.d.ts +1 -0
- package/webpack/index.mjs +30 -0
- package/index.js +0 -80
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function builderDevTools(): Promise<void>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { CliOptions } from "./options";
|
|
2
|
+
interface Snippet {
|
|
3
|
+
createdDate: number;
|
|
4
|
+
code: string;
|
|
5
|
+
framework: string;
|
|
6
|
+
suggestedName: string;
|
|
7
|
+
id: string;
|
|
8
|
+
sessionKey?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface SyncInfo {
|
|
11
|
+
snippet: Snippet;
|
|
12
|
+
pathInput: string;
|
|
13
|
+
writtenFiles: Array<FileNode>;
|
|
14
|
+
timeStamp: number;
|
|
15
|
+
}
|
|
16
|
+
export declare function addCommand(opts: CliOptions): Promise<SyncInfo | undefined>;
|
|
17
|
+
interface FileNode {
|
|
18
|
+
name: string;
|
|
19
|
+
code: string;
|
|
20
|
+
path: string;
|
|
21
|
+
isLoading?: boolean;
|
|
22
|
+
}
|
|
23
|
+
interface FolderNode {
|
|
24
|
+
name: string;
|
|
25
|
+
path: string;
|
|
26
|
+
files: (FileNode | FolderNode)[];
|
|
27
|
+
}
|
|
28
|
+
interface Snippet {
|
|
29
|
+
createdDate: number;
|
|
30
|
+
code: string;
|
|
31
|
+
framework: string;
|
|
32
|
+
suggestedName: string;
|
|
33
|
+
id: string;
|
|
34
|
+
files: Array<FileNode | FolderNode>;
|
|
35
|
+
}
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { DevToolsSys } from "../types";
|
|
2
|
+
import type { FigmaArgs } from "./figma";
|
|
3
|
+
export interface CredentialsOptions {
|
|
4
|
+
builderPublicKey?: boolean;
|
|
5
|
+
builderPrivateKey?: boolean;
|
|
6
|
+
figmaAuth?: boolean;
|
|
7
|
+
force?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface FigmaAuth {
|
|
10
|
+
access_token: string;
|
|
11
|
+
oauth: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface BuilderAuth {
|
|
14
|
+
privateKey: string;
|
|
15
|
+
spaceId: string;
|
|
16
|
+
spaceName: string;
|
|
17
|
+
userId: string;
|
|
18
|
+
}
|
|
19
|
+
export interface Credentials {
|
|
20
|
+
figmaAuth?: FigmaAuth;
|
|
21
|
+
builderPublicKey?: string;
|
|
22
|
+
builderPrivateKey?: string;
|
|
23
|
+
spaceName?: string;
|
|
24
|
+
userId?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const isCI: (args: FigmaArgs) => boolean;
|
|
27
|
+
export declare const getCredentials: (sys: DevToolsSys, args: FigmaArgs, opts: CredentialsOptions) => Promise<{
|
|
28
|
+
figmaAuth: FigmaAuth | undefined;
|
|
29
|
+
builderPublicKey: string | undefined;
|
|
30
|
+
builderPrivateKey: string | undefined;
|
|
31
|
+
spaceName?: undefined;
|
|
32
|
+
userId?: undefined;
|
|
33
|
+
} | {
|
|
34
|
+
figmaAuth: FigmaAuth | undefined;
|
|
35
|
+
builderPublicKey: string | undefined;
|
|
36
|
+
builderPrivateKey: string | undefined;
|
|
37
|
+
spaceName: string | undefined;
|
|
38
|
+
userId: string | undefined;
|
|
39
|
+
}>;
|
|
40
|
+
export declare function getFigmaAuth(): Promise<FigmaAuth>;
|
|
41
|
+
export declare function getBuilderAuth(sys: DevToolsSys): Promise<BuilderAuth>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { FigmaArgs } from "./figma";
|
|
2
|
+
import type { DevToolsSys } from "../types";
|
|
3
|
+
import { type FigmaBuilderLink } from "./figma-publish";
|
|
4
|
+
interface KVGetRequest {
|
|
5
|
+
privateKey: string;
|
|
6
|
+
spaceId: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const runFigmaMigrate: (sys: DevToolsSys, args: FigmaArgs) => Promise<void>;
|
|
9
|
+
export declare function getBuilderSpaceFigmaLinks(kvReq: KVGetRequest): Promise<FigmaBuilderLink[]>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { DevTools, DevToolsSys, ExportType } from "../types";
|
|
2
|
+
import type { FigmaArgs } from "./figma";
|
|
3
|
+
export interface FigmaBuilderLink {
|
|
4
|
+
builderName: string;
|
|
5
|
+
figmaName: string;
|
|
6
|
+
figmaKey: string;
|
|
7
|
+
figmaUrl?: string;
|
|
8
|
+
inputMapper?: string;
|
|
9
|
+
originalInputMapper?: string;
|
|
10
|
+
exportType?: ExportType;
|
|
11
|
+
importName?: string;
|
|
12
|
+
importPath?: string;
|
|
13
|
+
source: string;
|
|
14
|
+
loc?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const runFigmaPublish: (sys: DevToolsSys, args: FigmaArgs) => Promise<void>;
|
|
17
|
+
export declare const FIGMA_CONNECT_CALL = "figmaMapping";
|
|
18
|
+
export declare function findAllMappingFiles(sys: DevToolsSys): Promise<string[]>;
|
|
19
|
+
export interface FigmaBuilderData {
|
|
20
|
+
figmaBuilderLinks: FigmaBuilderLink[];
|
|
21
|
+
}
|
|
22
|
+
export declare function setPublicKey(sys: DevToolsSys, publicKey: string, devTools: DevTools | undefined): Promise<boolean>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { DevToolsSys } from "../types";
|
|
2
|
+
export interface FigmaArgs {
|
|
3
|
+
privateKey?: string;
|
|
4
|
+
figmaToken?: string;
|
|
5
|
+
ci?: boolean;
|
|
6
|
+
help?: boolean;
|
|
7
|
+
force?: boolean;
|
|
8
|
+
printJson?: boolean;
|
|
9
|
+
_: string[];
|
|
10
|
+
}
|
|
11
|
+
export declare const runFigmaCommand: (sys: DevToolsSys, subCommand: string, args: FigmaArgs) => Promise<void>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/// <reference types="@figma/plugin-typings" />
|
|
2
|
+
import type { ComponentInfo, ComponentInput, ComponentRegistry, DevToolsSys } from "../types";
|
|
3
|
+
import type { FigmaArgs } from "./figma";
|
|
4
|
+
export declare const runFigmaGenerate: (sys: DevToolsSys, args: FigmaArgs) => Promise<void>;
|
|
5
|
+
export interface FigmaComponentInput {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
value?: any;
|
|
9
|
+
type: string;
|
|
10
|
+
baseType: "text" | "variant" | "boolean" | "slot";
|
|
11
|
+
variantOptions?: string[];
|
|
12
|
+
isDefault: boolean;
|
|
13
|
+
ref?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface FigmaComponentInfo {
|
|
16
|
+
documentName: string;
|
|
17
|
+
key: string;
|
|
18
|
+
tree: string;
|
|
19
|
+
jsx: string;
|
|
20
|
+
name: string;
|
|
21
|
+
inputs: FigmaComponentInput[];
|
|
22
|
+
description: string;
|
|
23
|
+
documentationLinks: string[];
|
|
24
|
+
instanceId: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const parseFigmaURL: (str: string) => {
|
|
27
|
+
fileID: string;
|
|
28
|
+
nodeId: string;
|
|
29
|
+
} | null;
|
|
30
|
+
export declare const getFigmaNodeData: (auth: {
|
|
31
|
+
access_token: string;
|
|
32
|
+
oauth: boolean;
|
|
33
|
+
}, fileId: string, nodeIds: string, depth?: number) => Promise<any>;
|
|
34
|
+
export declare function getInputsSlotsFromComponentPropertyDefinitions(mainComponent: ComponentSetNode | ComponentNode): {
|
|
35
|
+
inputs: FigmaComponentInput[];
|
|
36
|
+
nameMap: (key: string) => string;
|
|
37
|
+
};
|
|
38
|
+
export declare const REMOVE_EMOJI: RegExp;
|
|
39
|
+
export declare function getFigmaComponentName(name: string): string;
|
|
40
|
+
export interface MappingCodeV2 {
|
|
41
|
+
figmaInterface: string;
|
|
42
|
+
reactInterface: string;
|
|
43
|
+
componentRegistry: string;
|
|
44
|
+
figmaComponentName: string;
|
|
45
|
+
figmaTree: string;
|
|
46
|
+
meta?: Record<string, any>;
|
|
47
|
+
previousCode?: string;
|
|
48
|
+
prompt?: string;
|
|
49
|
+
}
|
|
50
|
+
export declare function getMappingData(figmaNode: FigmaComponentInfo, registeredCmp: ComponentInfo, cmpRegistry: ComponentRegistry, useJSX: boolean): MappingCodeV2;
|
|
51
|
+
export declare const getTypeFromComponentInput: (input: ComponentInput) => string;
|
|
52
|
+
export declare const getPropertyAccessor: (name: string) => string;
|
|
53
|
+
export declare function getMappingPrompt(figmaNode: FigmaComponentInfo, registeredCmp: ComponentInfo, cmpRegistry: ComponentRegistry, useJSX?: boolean): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function printHelp(subcommand?: string): void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface KVGetRequest {
|
|
2
|
+
privateKey: string;
|
|
3
|
+
spaceId: string;
|
|
4
|
+
docId: string;
|
|
5
|
+
}
|
|
6
|
+
interface KVPutRequest {
|
|
7
|
+
privateKey: string;
|
|
8
|
+
spaceId: string;
|
|
9
|
+
docId: string;
|
|
10
|
+
/**
|
|
11
|
+
* Must be an object but not an array. TS is a fool sometimes.
|
|
12
|
+
* https://stackoverflow.com/a/70448528/1520787
|
|
13
|
+
*/
|
|
14
|
+
data: Record<string, any> & {
|
|
15
|
+
length?: never;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export declare function putBuilderSpaceKv(kvReq: KVPutRequest): Promise<any>;
|
|
19
|
+
export declare function getBuilderSpaceKv(kvReq: KVGetRequest): Promise<any>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function prettierFormat(code: string, parser?: string): Promise<string>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ComponentRegistry, ConnectedBuilder, GetRegistryOptions, LaunchEditorFile, LoadComponentOptions, RegisterComponentOptions, SetComponentInfoOptions, SetComponentInputOptions, UnregisterComponentOptions, ValidatedBuilder } from "../types";
|
|
2
|
+
export declare const apiConnectBuilder: (publicApiKey: string, privateAuthKey: string) => Promise<ConnectedBuilder>;
|
|
3
|
+
export declare const apiValidateBuilder: () => Promise<ValidatedBuilder>;
|
|
4
|
+
export declare const apiLaunchEditor: (file: LaunchEditorFile) => Promise<unknown>;
|
|
5
|
+
export declare const apiRegistry: (opts?: GetRegistryOptions) => Promise<ComponentRegistry>;
|
|
6
|
+
export declare const apiLoadComponent: (opts: LoadComponentOptions) => Promise<ComponentRegistry>;
|
|
7
|
+
export declare const apiRegisterComponent: (opts: RegisterComponentOptions) => Promise<ComponentRegistry>;
|
|
8
|
+
export declare const apiSetComponentInfo: (opts: SetComponentInfoOptions) => Promise<ComponentRegistry>;
|
|
9
|
+
export declare const apiSetComponentInput: (opts: SetComponentInputOptions) => Promise<ComponentRegistry>;
|
|
10
|
+
export declare const apiUnregisterComponent: (opts: UnregisterComponentOptions) => Promise<ComponentRegistry>;
|
|
11
|
+
export declare const apiDevToolsEnabled: (enabled: boolean) => Promise<ComponentRegistry>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare class BuilderDevToolsEditButton extends HTMLElement {
|
|
2
|
+
openInBuilder: HTMLAnchorElement | null;
|
|
3
|
+
block: HTMLElement | null;
|
|
4
|
+
constructor();
|
|
5
|
+
connectedCallback(): void;
|
|
6
|
+
show(contentElm: HTMLElement, blockElm: HTMLElement): string | null;
|
|
7
|
+
hide(): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ComponentInfo } from "../../../types";
|
|
2
|
+
export declare function initComponentDetailSection(shadow: ShadowRoot): void;
|
|
3
|
+
export declare function loadComponentDetail(shadow: ShadowRoot, opt: "load" | "update"): Promise<void>;
|
|
4
|
+
export declare function renderComponentDetail(shadow: ShadowRoot, cmpId: string): ComponentInfo | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function initHomeSection(shadow: ShadowRoot): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function initSettingsSection(shadow: ShadowRoot): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const checkBuilderIntegration: () => Promise<void>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const dispatch: (eventName: TriggerName) => void;
|
|
2
|
+
export declare const initTracking: () => void;
|
|
3
|
+
export declare const getBuilderUserId: () => string;
|
|
4
|
+
export declare const setBuilderUserId: (builderUserId: string) => void;
|
|
5
|
+
export declare const getTracking: () => ClientTracking;
|
|
6
|
+
export declare const hasCTA: (ctaName: string) => boolean;
|
|
7
|
+
export declare const setCTA: (ctaName: string) => ClientTracking;
|
|
8
|
+
interface ClientTracking {
|
|
9
|
+
/**
|
|
10
|
+
* first time visit timestamp
|
|
11
|
+
*/
|
|
12
|
+
firstVisitTs: number;
|
|
13
|
+
/**
|
|
14
|
+
* Name of the call to actions and timestamps when they happened
|
|
15
|
+
*/
|
|
16
|
+
ctas: {
|
|
17
|
+
[ctaName: string]: number;
|
|
18
|
+
};
|
|
19
|
+
builderUserId: string;
|
|
20
|
+
}
|
|
21
|
+
export type TriggerName = "init" | "menuOpen" | "menuClose" | "registryUpdate";
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ComponentRegistry } from "../types";
|
|
2
|
+
export declare const goToSection: (shadow: ShadowRoot, view: string) => void;
|
|
3
|
+
export declare const initBackButtons: (shadow: ShadowRoot) => void;
|
|
4
|
+
export declare const showToast: (shadow: ShadowRoot, html: string) => void;
|
|
5
|
+
export declare const closeToasts: (shadow: ShadowRoot) => void;
|
|
6
|
+
export declare const isEditEnabled: () => boolean;
|
|
7
|
+
export declare const enableEdit: (enable: boolean) => void;
|
|
8
|
+
export declare const getEditorUrl: () => string;
|
|
9
|
+
export declare const getBuilderContentUrl: (contentId?: string | null, blockId?: string | null) => string;
|
|
10
|
+
export declare const DEV_TOOLS_URL = "__DEV_TOOLS_URL__";
|
|
11
|
+
export declare const APP_STATE: AppState;
|
|
12
|
+
export declare const updateAppState: (registry: ComponentRegistry) => void;
|
|
13
|
+
export interface AppState extends ComponentRegistry {
|
|
14
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { AppDependency, ComponentInfo, DevToolsSys } from "../../types";
|
|
2
|
+
import type ts from "typescript";
|
|
3
|
+
export declare function getSourceDependencies(sys: DevToolsSys, typeChecker: ts.TypeChecker | null, fnNode: ts.Node): AppDependency[] | undefined;
|
|
4
|
+
export declare function getAppDependencies(cmps: ComponentInfo[]): AppDependency[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type ts from "typescript";
|
|
2
|
+
import type { ComponentInfo, ComponentInput, DevToolsSys } from "../../types";
|
|
3
|
+
export declare function parseRegisteredComponentInfo(sys: DevToolsSys, cmpInfo: ComponentInfo, cmpObjLit: ts.ObjectLiteralExpression): ComponentInfo;
|
|
4
|
+
export declare function updateComponentObjLiteralInfoProperties(sys: DevToolsSys, cmpObjExp: ts.ObjectLiteralExpression, cmpInfo: ComponentInfo): ts.ObjectLiteralExpression;
|
|
5
|
+
export declare function updateComponentInputsArrayLiteralExp(sys: DevToolsSys, arrExp: ts.ArrayLiteralExpression, inputs: ComponentInput[]): ts.ArrayLiteralExpression;
|
|
6
|
+
export declare function mergeComponentInputs(cmp: ComponentInfo, inputs: ComponentInput[]): void;
|
|
7
|
+
export declare function componentAcceptsChildren(cmp: ComponentInfo): boolean;
|
|
8
|
+
export declare function normalizeComponentInput(input: ComponentInput): ComponentInput;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type ts from "typescript";
|
|
2
|
+
import type { ComponentInput, DevToolsSys } from "../../types";
|
|
3
|
+
export declare function parseComponentSourcePropsFromNode(sys: DevToolsSys, typeChecker: ts.TypeChecker, fnNode: ts.Node | undefined): ComponentInput[];
|
|
4
|
+
export declare function normalizeBuilderInputType(t: string): {
|
|
5
|
+
builderType: string;
|
|
6
|
+
knownType: boolean;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* https://www.builder.io/c/docs/custom-components-input-types
|
|
10
|
+
*/
|
|
11
|
+
export declare const INPUT_TYPES: {
|
|
12
|
+
value: string;
|
|
13
|
+
text: string;
|
|
14
|
+
}[];
|
|
15
|
+
export declare const STRING_TYPES: string[];
|
|
16
|
+
export declare const NUMBER_TYPES: string[];
|
|
17
|
+
export declare const BOOLEAN_TYPES: string[];
|
|
18
|
+
export declare const ARRAY_TYPES: string[];
|
|
19
|
+
export declare const OBJECT_TYPES: string[];
|
|
20
|
+
export declare function getPrimitiveType(t: string): "string" | "object" | "number" | "boolean" | "array";
|
|
21
|
+
export declare function removeQuotes(text: string): string;
|
|
22
|
+
export declare const resolveType: (sys: DevToolsSys, checker: ts.TypeChecker, type: ts.Type) => string[] | undefined;
|
|
23
|
+
export declare const typeToString: (sys: DevToolsSys, checker: ts.TypeChecker, type: ts.Type) => string;
|
|
24
|
+
export declare const parseDocsType: (sys: DevToolsSys, checker: ts.TypeChecker, type: ts.Type, parts: Set<string>) => void;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ComponentInfo, SetComponentInfoOptions, SetComponentInputOptions } from "../../types";
|
|
2
|
+
export declare function updateRegistry(cmpId: string, srcCmps: ComponentInfo[], regCmps: ComponentInfo[], registerCmp: boolean, unregisterCmp: boolean, setCmpInfo: SetComponentInfoOptions | null, setCmpInput: SetComponentInputOptions | null): {
|
|
3
|
+
addCmpToRegistry: ComponentInfo | null;
|
|
4
|
+
removeCmpFromRegistry: ComponentInfo | null;
|
|
5
|
+
updateRegisteredCmp: ComponentInfo | null;
|
|
6
|
+
nodeIndex: number;
|
|
7
|
+
components: ComponentInfo[];
|
|
8
|
+
};
|
|
9
|
+
export declare function mergeComponents(sourceComponents: ComponentInfo[], registeredCmps: ComponentInfo[]): ComponentInfo[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type ts from "typescript";
|
|
2
|
+
import type { DevToolsSys } from "../../types";
|
|
3
|
+
export declare function setObjectExpressionProperty(sys: DevToolsSys, obj: ts.ObjectLiteralExpression, propName: string, propValue: any, deleteIfNullOrUndefined?: boolean): ts.ObjectLiteralExpression;
|
|
4
|
+
export declare function getObjLiteralPropertyIndex(sys: DevToolsSys, obj: ts.ObjectLiteralExpression, propName: string): number;
|
|
5
|
+
export declare function expressionToValue(sys: DevToolsSys, exp: ts.Expression): any;
|
|
6
|
+
export declare function objectExpressionToObjectValue(sys: DevToolsSys, objectLiteral: ts.ObjectLiteralExpression): {
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
};
|
|
9
|
+
export declare function convertArrayExpressionToJsArray(sys: DevToolsSys, arr: ts.ArrayLiteralExpression): any[];
|
|
10
|
+
export declare function getTextOfPropertyName(sys: DevToolsSys, prop: ts.PropertyAssignment | ts.ObjectLiteralElementLike | undefined): string | undefined;
|
|
11
|
+
export declare function valueToExpression(sys: DevToolsSys, val: any): ts.ObjectLiteralExpression | ts.Identifier | ts.StringLiteral | ts.NumericLiteral | ts.TrueLiteral | ts.FalseLiteral | ts.ArrayLiteralExpression;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type ts from "typescript";
|
|
2
|
+
import type { DevToolsSys } from "../../types";
|
|
3
|
+
export declare function ensureArrayStatement(sys: DevToolsSys, sourceFile: ts.SourceFile, opts: EnsureArrayStatementOptions): ts.SourceFile;
|
|
4
|
+
export interface EnsureArrayStatementOptions {
|
|
5
|
+
variableName: string;
|
|
6
|
+
arrayType?: string;
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ensureComments(code: string, commentText: string[], lineTextAfterComments: string): string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type ts from "typescript";
|
|
2
|
+
import type { DevToolsSys, ModuleFormat } from "../../types";
|
|
3
|
+
export declare function ensureImport(sys: DevToolsSys, sourceFile: ts.SourceFile, opts: EnsureImportOptions, moduleType?: ModuleFormat): ts.SourceFile;
|
|
4
|
+
export interface EnsureImportOptions {
|
|
5
|
+
defaultImport?: string;
|
|
6
|
+
namedImports?: string[];
|
|
7
|
+
importPath: string;
|
|
8
|
+
isTypeOnly?: boolean;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type ts from "typescript";
|
|
2
|
+
import type { DevToolsSys, ModuleFormat } from "../../types";
|
|
3
|
+
export declare function getExportedStatements(sys: DevToolsSys, sourceFile: ts.SourceFile, moduleType?: ModuleFormat): ExportedStatement[];
|
|
4
|
+
export interface ExportedStatement {
|
|
5
|
+
isDefaultExport: boolean;
|
|
6
|
+
statement: ts.Statement;
|
|
7
|
+
node: ts.Node;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type ts from "typescript";
|
|
2
|
+
import type { DevToolsSys } from "../../types";
|
|
3
|
+
export declare function normalizeImports(sys: DevToolsSys, sourceFile: ts.SourceFile): ts.SourceFile;
|
|
4
|
+
export declare function normalizeLineBreaks(code: string): string;
|
|
5
|
+
export declare function ensureUseClientStringLiteral(code: string): string;
|
|
6
|
+
export declare function removeUseClientStringLiteral(sys: DevToolsSys, sourceFile: ts.SourceFile): ts.SourceFile;
|
|
7
|
+
export declare function normalizeRegisteredArrayElements(sys: DevToolsSys, elements: ts.Expression[]): ts.Expression[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type ts from "typescript";
|
|
2
|
+
import type { DevToolsSys } from "../../types";
|
|
3
|
+
export declare function codeToSource(sys: DevToolsSys, code?: string | null): ts.SourceFile;
|
|
4
|
+
export declare function codeToStatement(sys: DevToolsSys, code?: string | null): ts.Statement;
|
|
5
|
+
export declare function sourceToCode(sys: DevToolsSys, node: ts.Node | null | undefined, removeComments?: boolean): string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type ts from "typescript";
|
|
2
|
+
import type { DevToolsSys, ExportType } from "../../types";
|
|
3
|
+
export declare function getImportPathFromIdentifier(sys: DevToolsSys, sourceFile: ts.SourceFile, identifierName: string): {
|
|
4
|
+
importPath: string;
|
|
5
|
+
exportType: ExportType;
|
|
6
|
+
} | null;
|
|
7
|
+
export declare function getFilePathFromIdentifier(sys: DevToolsSys, containerPath: string, sourceFile: ts.SourceFile, identifierName: string): Promise<{
|
|
8
|
+
displayFilePath: string;
|
|
9
|
+
filePath: string;
|
|
10
|
+
relFilePath: string;
|
|
11
|
+
importPath: string;
|
|
12
|
+
exportType: ExportType;
|
|
13
|
+
} | null>;
|
|
14
|
+
export declare function findVariableStatement(sys: DevToolsSys, sourceFile: ts.SourceFile, variableName: string): {
|
|
15
|
+
statement: ts.VariableStatement;
|
|
16
|
+
statementIndex: number;
|
|
17
|
+
} | null;
|
|
18
|
+
export declare function findArrayStatementInitializer(sys: DevToolsSys, sourceFile: ts.SourceFile, variableName: string): {
|
|
19
|
+
statement: ts.VariableStatement;
|
|
20
|
+
statementIndex: number;
|
|
21
|
+
variableDeclaration: ts.VariableDeclaration;
|
|
22
|
+
arrayLiteralExp: ts.ArrayLiteralExpression;
|
|
23
|
+
} | null;
|
|
24
|
+
export declare function hasJsxNode(sys: DevToolsSys, n: ts.Node | undefined): boolean;
|
|
25
|
+
export declare function resolveComponentPath(sys: DevToolsSys, filePath: string): Promise<string>;
|
|
26
|
+
export declare const RESOLVE_EXTS: string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { DevToolsSys } from "packages/dev-tools/types";
|
|
2
|
+
export declare function hasBuilderContentViaQueryAPI(opts: {
|
|
3
|
+
publicApiKey: string;
|
|
4
|
+
privateAuthKey: string;
|
|
5
|
+
model: string;
|
|
6
|
+
pageUrl: string;
|
|
7
|
+
}): Promise<any>;
|
|
8
|
+
export declare function hasBuilderContentUrl(sys: DevToolsSys, opts: {
|
|
9
|
+
publicApiKey: string;
|
|
10
|
+
privateAuthKey: string;
|
|
11
|
+
model: string;
|
|
12
|
+
pageUrl: string;
|
|
13
|
+
}): Promise<boolean>;
|
|
14
|
+
export declare function getBuilderContent(sys: DevToolsSys, opts: {
|
|
15
|
+
publicApiKey: string;
|
|
16
|
+
model: string;
|
|
17
|
+
pageUrl?: string;
|
|
18
|
+
id?: string;
|
|
19
|
+
}): Promise<{
|
|
20
|
+
results: any[];
|
|
21
|
+
}>;
|
|
22
|
+
export declare function writeBuilderContent(sys: DevToolsSys, opts: {
|
|
23
|
+
privateAuthKey: string;
|
|
24
|
+
body: string;
|
|
25
|
+
model: string;
|
|
26
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { SDKVersionInfo } from "../../types";
|
|
2
|
+
export declare const SUPPORTED_FRAMEWORKS: {
|
|
3
|
+
react: string;
|
|
4
|
+
remix: string;
|
|
5
|
+
angular: string;
|
|
6
|
+
next: string;
|
|
7
|
+
qwik: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function getSDKDetailsForFramework(framework: string): SDKVersionInfo[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DevToolsSys } from "packages/dev-tools/types";
|
|
2
|
+
export declare function createBuilderPage(sys: DevToolsSys, opts: {
|
|
3
|
+
templateContentId: string;
|
|
4
|
+
publicApiKey: string;
|
|
5
|
+
privateAuthKey: string;
|
|
6
|
+
pathname: string;
|
|
7
|
+
title: string;
|
|
8
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const PUBLIC_API_KEY_QS = "api-key";
|
|
2
|
+
export declare const PRIVATE_AUTH_KEY_QS = "p-key";
|
|
3
|
+
export declare const PREVIEW_URL_QS = "preview-url";
|
|
4
|
+
export declare const USER_ID_QS = "user-id";
|
|
5
|
+
export declare const CONNECTED_USER_ID_QS = "_b-uid";
|
|
6
|
+
export declare const FRAMEWORK_QS = "framework";
|
|
7
|
+
export declare const PLATFORM_QS = "platform";
|
|
8
|
+
export declare const NODE_VERSION_QS = "node";
|
|
9
|
+
export declare const BUILDER_AUTH_CONNECT_PATH = "/~builder-connect";
|
|
10
|
+
export declare const BUILDER_AUTH_RETURN_PATH = "/~builder-connected";
|
|
11
|
+
export declare const DEV_TOOLS_API_PATH = "/~builder-dev-tools";
|
|
12
|
+
export declare const DEV_TOOLS_CLIENT_SCRIPT_PATH = "/~builder-dev-tools.js";
|
|
13
|
+
export declare const DEV_TOOLS_SERVER_CLOSE_PATH = "/~builder-dev-tools-close";
|
|
14
|
+
export declare const AMPLITUDE_PROXY_URL = "https://cdn.builder.io/api/v1/proxy-api?url=https://api2.amplitude.com/2/httpapi";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { DevToolsSys, EnvInfo } from "../types";
|
|
2
|
+
export declare function getDotEnvValue(sys: DevToolsSys, dotEnvFileNames: string[], envKey: string): Promise<EnvInfo>;
|
|
3
|
+
export declare function setDotEnvValue(sys: DevToolsSys, dotEnvFileNames: string[], envKey: string, envValue: string): Promise<EnvInfo>;
|
|
4
|
+
export declare function parseDotEnvFile(sys: DevToolsSys, envPath: string): Promise<Record<string, string> | null>;
|
|
5
|
+
export declare function parseDotEnvContent(envContent: string): Record<string, string>;
|
|
6
|
+
export declare function setDotEnvVar(sys: DevToolsSys, envPath: string, key: string, value: string): Promise<"create" | "update" | null>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DevToolsSys, PackageJSON } from "../types";
|
|
2
|
+
export declare function findPackageJson(sys: DevToolsSys, dir: string): Promise<PackageJSON | null>;
|
|
3
|
+
export declare function findUpNodeModules(sys: DevToolsSys, p: string): Promise<string>;
|
|
4
|
+
export declare function recursiveFindDir(sys: DevToolsSys, dir: string, findDirectoryName: string): Promise<string | undefined>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DevToolsSys } from "../types";
|
|
2
|
+
export declare function createDevToolsSys(opts: CreateDevToolsSysOptions): Promise<DevToolsSys>;
|
|
3
|
+
export interface CreateDevToolsSysOptions extends Partial<DevToolsSys> {
|
|
4
|
+
/**
|
|
5
|
+
* TypeScript compiler instance.
|
|
6
|
+
*/
|
|
7
|
+
ts: any;
|
|
8
|
+
}
|