@plasmicapp/loader-react 1.0.317 → 1.0.319
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/dist/index.d.ts +522 -14
- package/dist/index.esm.js +6 -6
- package/dist/index.esm.js.map +2 -2
- package/dist/index.js +4 -4
- package/dist/index.js.map +2 -2
- package/dist/react-server.d.ts +150 -4
- package/package.json +9 -12
- package/dist/PlasmicComponent.d.ts +0 -19
- package/dist/PlasmicRootProvider.d.ts +0 -112
- package/dist/bundles.d.ts +0 -7
- package/dist/component-lookup.d.ts +0 -21
- package/dist/global-variants.d.ts +0 -13
- package/dist/loader-react-server.d.ts +0 -92
- package/dist/loader.d.ts +0 -185
- package/dist/render.d.ts +0 -29
- package/dist/shared-exports.d.ts +0 -6
- package/dist/usePlasmicComponent.d.ts +0 -15
- package/dist/utils.d.ts +0 -31
- package/dist/variation.d.ts +0 -9
package/dist/render.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { ComponentRenderData, PlasmicComponentLoader } from "./loader";
|
|
2
|
-
import { GlobalVariantSpec } from "./PlasmicRootProvider";
|
|
3
|
-
import { ComponentLookupSpec } from "./utils";
|
|
4
|
-
export declare function renderToElement(loader: PlasmicComponentLoader, target: HTMLElement, lookup: ComponentLookupSpec, opts?: {
|
|
5
|
-
prefetchedData?: ComponentRenderData;
|
|
6
|
-
componentProps?: any;
|
|
7
|
-
globalVariants?: GlobalVariantSpec[];
|
|
8
|
-
prefetchedQueryData?: Record<string, any>;
|
|
9
|
-
pageParams?: Record<string, any>;
|
|
10
|
-
pageQuery?: Record<string, any>;
|
|
11
|
-
}): Promise<void>;
|
|
12
|
-
export declare function renderToString(loader: PlasmicComponentLoader, lookup: ComponentLookupSpec, opts?: {
|
|
13
|
-
prefetchedData?: ComponentRenderData;
|
|
14
|
-
componentProps?: any;
|
|
15
|
-
globalVariants?: GlobalVariantSpec[];
|
|
16
|
-
prefetchedQueryData?: Record<string, any>;
|
|
17
|
-
}): string;
|
|
18
|
-
export declare function extractPlasmicQueryDataFromElement(loader: PlasmicComponentLoader, lookup: ComponentLookupSpec, opts?: {
|
|
19
|
-
prefetchedData?: ComponentRenderData;
|
|
20
|
-
componentProps?: any;
|
|
21
|
-
globalVariants?: GlobalVariantSpec[];
|
|
22
|
-
prefetchedQueryData?: Record<string, any>;
|
|
23
|
-
}): Promise<Record<string, any>>;
|
|
24
|
-
export declare function hydrateFromElement(loader: PlasmicComponentLoader, target: HTMLElement, lookup: ComponentLookupSpec, opts?: {
|
|
25
|
-
prefetchedData?: ComponentRenderData;
|
|
26
|
-
componentProps?: any;
|
|
27
|
-
globalVariants?: GlobalVariantSpec[];
|
|
28
|
-
prefetchedQueryData?: Record<string, any>;
|
|
29
|
-
}): Promise<void>;
|
package/dist/shared-exports.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/** Shared exports for both "default" and "react-server" exports live here. */
|
|
2
|
-
export type { ComponentMeta, PageMeta, PageMetadata, } from "@plasmicapp/loader-core";
|
|
3
|
-
export { convertBundlesToComponentRenderData } from "./bundles";
|
|
4
|
-
export type { ComponentRenderData } from "./loader";
|
|
5
|
-
export type { InitOptions } from "./loader-react-server";
|
|
6
|
-
export { matchesPagePath } from "./utils";
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ComponentLookupSpec } from './utils';
|
|
3
|
-
/**
|
|
4
|
-
* Hook that fetches and returns a React component for rendering the argument
|
|
5
|
-
* Plasmic component. Returns undefined if the component data is still
|
|
6
|
-
* being fetched.
|
|
7
|
-
*
|
|
8
|
-
* @param opts.forceOriginal if you used PlasmicComponentLoader.registerComponent,
|
|
9
|
-
* then normally usePlasmicComponent will return the registered component.
|
|
10
|
-
* You can set forceOriginal to true if you want to return the Plasmic-generated
|
|
11
|
-
* component instead.
|
|
12
|
-
*/
|
|
13
|
-
export declare function usePlasmicComponent<P extends React.ComponentType = any>(spec: ComponentLookupSpec, opts?: {
|
|
14
|
-
forceOriginal?: boolean;
|
|
15
|
-
}): P;
|
package/dist/utils.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { ComponentMeta } from "@plasmicapp/loader-core";
|
|
2
|
-
export declare const isBrowser: boolean;
|
|
3
|
-
export type ComponentLookupSpec = string | {
|
|
4
|
-
name: string;
|
|
5
|
-
projectId?: string;
|
|
6
|
-
isCode?: boolean;
|
|
7
|
-
};
|
|
8
|
-
export declare function useForceUpdate(): () => void;
|
|
9
|
-
export declare function useStableLookupSpec(spec: ComponentLookupSpec): ComponentLookupSpec;
|
|
10
|
-
export declare function useStableLookupSpecs(...specs: ComponentLookupSpec[]): ComponentLookupSpec[];
|
|
11
|
-
export declare function useIsMounted(): () => boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Check if `lookup` resolves to `pagePath`. If it's a match, return an object
|
|
14
|
-
* containing path params; otherwise, return false.
|
|
15
|
-
*
|
|
16
|
-
* For example,
|
|
17
|
-
* - `matchesPagePath("/hello/[name]", "/hello/world")` -> `{params: {name:
|
|
18
|
-
* "world"}}`
|
|
19
|
-
* - `matchesPagePath("/hello/[name]", "/")` -> `false`
|
|
20
|
-
* - `matchesPagePath("/hello/[...catchall]", "/hello/a/b/c")` -> `{params: {catchall: ["a", "b", "c"]}}`
|
|
21
|
-
* - `matchesPagePath("/", "")` -> `{params: {}}`
|
|
22
|
-
*/
|
|
23
|
-
export declare function matchesPagePath(pagePath: string, lookup: string): {
|
|
24
|
-
params: Record<string, string | string[]>;
|
|
25
|
-
} | false;
|
|
26
|
-
export declare function isDynamicPagePath(path: string): boolean;
|
|
27
|
-
export declare function getCompMetas(metas: ComponentMeta[], lookup: ComponentLookupSpec): (ComponentMeta & {
|
|
28
|
-
params?: Record<string, string | string[]> | undefined;
|
|
29
|
-
})[];
|
|
30
|
-
export declare function getLookupSpecName(lookup: ComponentLookupSpec): string;
|
|
31
|
-
export declare function uniq<T>(elements: T[]): T[];
|
package/dist/variation.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Split } from "@plasmicapp/loader-core";
|
|
2
|
-
import type { GlobalVariantSpec } from "./PlasmicRootProvider";
|
|
3
|
-
export declare function getPlasmicCookieValues(): {
|
|
4
|
-
[k: string]: string;
|
|
5
|
-
};
|
|
6
|
-
export declare function updatePlasmicCookieValue(key: string, value: string): void;
|
|
7
|
-
export declare function ensureVariationCookies(variation?: Record<string, string>): void;
|
|
8
|
-
export declare const getGlobalVariantsFromSplits: (splits: Split[], variation: Record<string, string>) => GlobalVariantSpec[];
|
|
9
|
-
export declare const mergeGlobalVariantsSpec: (target: GlobalVariantSpec[], from: GlobalVariantSpec[]) => GlobalVariantSpec[];
|