@plasmicapp/loader-nextjs 1.0.338 → 1.0.340

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/edge.d.ts CHANGED
@@ -1 +1,4 @@
1
+
1
2
  export * from "@plasmicapp/loader-edge";
3
+
4
+ export { }
package/dist/index.d.ts CHANGED
@@ -1,16 +1,79 @@
1
1
  /// <reference types="node" />
2
- import { InternalPlasmicComponentLoader, PlasmicComponentLoader, PlasmicRootProvider as CommonPlasmicRootProvider } from "@plasmicapp/loader-react";
3
- import { IncomingMessage, ServerResponse } from "http";
4
- import * as React from "react";
5
- import type { NextInitOptions } from "./shared-exports";
6
- export { DataCtxReader, DataProvider, extractPlasmicQueryData, PageParamsProvider, PlasmicCanvasContext, PlasmicCanvasHost, PlasmicComponent, plasmicPrepass, repeatedElement, useDataEnv, usePlasmicCanvasContext, usePlasmicComponent, usePlasmicQueryData, useSelector, useSelectors, } from "@plasmicapp/loader-react";
7
- export type { CodeComponentMeta, PlasmicTranslator, PropType, TokenRegistration, } from "@plasmicapp/loader-react";
8
- export * from "./shared-exports";
9
- type ServerRequest = IncomingMessage & {
10
- cookies: {
11
- [key: string]: string;
2
+
3
+ import { CodeComponentMeta } from '@plasmicapp/loader-react';
4
+ import { ComponentMeta } from '@plasmicapp/loader-react/react-server-conditional';
5
+ import { ComponentRenderData } from '@plasmicapp/loader-react/react-server-conditional';
6
+ import { DataCtxReader } from '@plasmicapp/loader-react';
7
+ import { DataProvider } from '@plasmicapp/loader-react';
8
+ import { extractPlasmicQueryData } from '@plasmicapp/loader-react';
9
+ import { IncomingMessage } from 'http';
10
+ import { InitOptions } from '@plasmicapp/loader-react/react-server-conditional';
11
+ import { InternalPlasmicComponentLoader } from '@plasmicapp/loader-react';
12
+ import { PageMeta } from '@plasmicapp/loader-react/react-server-conditional';
13
+ import { PageMetadata } from '@plasmicapp/loader-react/react-server-conditional';
14
+ import { PageParamsProvider } from '@plasmicapp/loader-react';
15
+ import { PlasmicCanvasContext } from '@plasmicapp/loader-react';
16
+ import { PlasmicCanvasHost } from '@plasmicapp/loader-react';
17
+ import { PlasmicComponent } from '@plasmicapp/loader-react';
18
+ import { PlasmicComponentLoader } from '@plasmicapp/loader-react';
19
+ import { plasmicPrepass } from '@plasmicapp/loader-react';
20
+ import { PlasmicRootProvider as PlasmicRootProvider_2 } from '@plasmicapp/loader-react';
21
+ import { PlasmicTranslator } from '@plasmicapp/loader-react';
22
+ import { PropType } from '@plasmicapp/loader-react';
23
+ import * as React_2 from 'react';
24
+ import { repeatedElement } from '@plasmicapp/loader-react';
25
+ import { ServerResponse } from 'http';
26
+ import { TokenRegistration } from '@plasmicapp/loader-react';
27
+ import { useDataEnv } from '@plasmicapp/loader-react';
28
+ import { usePlasmicCanvasContext } from '@plasmicapp/loader-react';
29
+ import { usePlasmicComponent } from '@plasmicapp/loader-react';
30
+ import { usePlasmicQueryData } from '@plasmicapp/loader-react';
31
+ import { useSelector } from '@plasmicapp/loader-react';
32
+ import { useSelectors } from '@plasmicapp/loader-react';
33
+
34
+ export { CodeComponentMeta }
35
+
36
+ export { ComponentMeta }
37
+
38
+ export { ComponentRenderData }
39
+
40
+ export { DataCtxReader }
41
+
42
+ export { DataProvider }
43
+
44
+ export { extractPlasmicQueryData }
45
+
46
+ export { InitOptions }
47
+
48
+ export declare function initPlasmicLoader(opts: NextInitOptions): NextJsPlasmicComponentLoader;
49
+
50
+ export declare interface NextInitOptions extends InitOptions {
51
+ /**
52
+ * next/navigation doesn't exist prior to Next.js 13, so Plasmic can't assume the dependency exists.
53
+ * If you use the App Router (which depends on next/navigation), you'll need to pass the module here.
54
+ *
55
+ * ```tsx
56
+ * import { initPlasmicLoader } from "@plasmicapp/loader-nextjs/react-server-conditional";
57
+ * import * as NextNavigation from "next/navigation";
58
+ *
59
+ * export const PLASMIC = initPlasmicLoader({
60
+ * nextNavigation: NextNavigation,
61
+ * projects: [
62
+ * // your projects
63
+ * ],
64
+ * });
65
+ * ```
66
+ */
67
+ nextNavigation?: {
68
+ notFound: unknown;
69
+ redirect: unknown;
70
+ useParams: unknown;
71
+ usePathname: unknown;
72
+ useRouter: unknown;
73
+ useSearchParams: unknown;
12
74
  };
13
- };
75
+ }
76
+
14
77
  export declare class NextJsPlasmicComponentLoader extends PlasmicComponentLoader {
15
78
  constructor(internal: InternalPlasmicComponentLoader);
16
79
  getActiveVariation(opts: {
@@ -20,5 +83,47 @@ export declare class NextJsPlasmicComponentLoader extends PlasmicComponentLoader
20
83
  traits: Record<string, string | number | boolean>;
21
84
  }): Promise<Record<string, string>>;
22
85
  }
23
- export declare function initPlasmicLoader(opts: NextInitOptions): NextJsPlasmicComponentLoader;
24
- export declare function PlasmicRootProvider(props: Omit<React.ComponentProps<typeof CommonPlasmicRootProvider>, "Head">): React.JSX.Element;
86
+
87
+ export { PageMeta }
88
+
89
+ export { PageMetadata }
90
+
91
+ export { PageParamsProvider }
92
+
93
+ export { PlasmicCanvasContext }
94
+
95
+ export { PlasmicCanvasHost }
96
+
97
+ export { PlasmicComponent }
98
+
99
+ export { plasmicPrepass }
100
+
101
+ export declare function PlasmicRootProvider(props: Omit<React_2.ComponentProps<typeof PlasmicRootProvider_2>, "Head">): React_2.JSX.Element;
102
+
103
+ export { PlasmicTranslator }
104
+
105
+ export { PropType }
106
+
107
+ export { repeatedElement }
108
+
109
+ declare type ServerRequest = IncomingMessage & {
110
+ cookies: {
111
+ [key: string]: string;
112
+ };
113
+ };
114
+
115
+ export { TokenRegistration }
116
+
117
+ export { useDataEnv }
118
+
119
+ export { usePlasmicCanvasContext }
120
+
121
+ export { usePlasmicComponent }
122
+
123
+ export { usePlasmicQueryData }
124
+
125
+ export { useSelector }
126
+
127
+ export { useSelectors }
128
+
129
+ export { }
@@ -1,5 +1,47 @@
1
- import "server-only";
2
- import { ReactServerPlasmicComponentLoader } from "@plasmicapp/loader-react/react-server";
3
- import type { NextInitOptions } from "./shared-exports";
4
- export * from "./shared-exports";
1
+ import { ComponentMeta } from '@plasmicapp/loader-react/react-server-conditional';
2
+ import { ComponentRenderData } from '@plasmicapp/loader-react/react-server-conditional';
3
+ import { InitOptions } from '@plasmicapp/loader-react/react-server-conditional';
4
+ import { PageMeta } from '@plasmicapp/loader-react/react-server-conditional';
5
+ import { PageMetadata } from '@plasmicapp/loader-react/react-server-conditional';
6
+ import { ReactServerPlasmicComponentLoader } from '@plasmicapp/loader-react/react-server';
7
+
8
+ export { ComponentMeta }
9
+
10
+ export { ComponentRenderData }
11
+
12
+ export { InitOptions }
13
+
5
14
  export declare function initPlasmicLoader(opts: NextInitOptions): ReactServerPlasmicComponentLoader;
15
+
16
+ export declare interface NextInitOptions extends InitOptions {
17
+ /**
18
+ * next/navigation doesn't exist prior to Next.js 13, so Plasmic can't assume the dependency exists.
19
+ * If you use the App Router (which depends on next/navigation), you'll need to pass the module here.
20
+ *
21
+ * ```tsx
22
+ * import { initPlasmicLoader } from "@plasmicapp/loader-nextjs/react-server-conditional";
23
+ * import * as NextNavigation from "next/navigation";
24
+ *
25
+ * export const PLASMIC = initPlasmicLoader({
26
+ * nextNavigation: NextNavigation,
27
+ * projects: [
28
+ * // your projects
29
+ * ],
30
+ * });
31
+ * ```
32
+ */
33
+ nextNavigation?: {
34
+ notFound: unknown;
35
+ redirect: unknown;
36
+ useParams: unknown;
37
+ usePathname: unknown;
38
+ useRouter: unknown;
39
+ useSearchParams: unknown;
40
+ };
41
+ }
42
+
43
+ export { PageMeta }
44
+
45
+ export { PageMetadata }
46
+
47
+ export { }
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.338",
2
+ "version": "1.0.340",
3
3
  "license": "MIT",
4
4
  "types": "./dist/index.d.ts",
5
5
  "main": "./dist/index.js",
@@ -48,9 +48,6 @@
48
48
  "build:index": "node ../../build.mjs ./src/index.tsx --use-client",
49
49
  "build:edge": "node ../../build.mjs ./src/edge.ts --no-esm",
50
50
  "build:react-server": "node ../../build.mjs ./src/react-server.ts",
51
- "postbuild": "yarn postbuild:index && yarn postbuild:react-server",
52
- "postbuild:index": "node ../../print-module-api.js ./packages/loader-nextjs/dist/index.js > index-api.txt",
53
- "postbuild:react-server": "node ../../print-module-api.js ./packages/loader-nextjs/dist/react-server.js > index-react-server-api.txt",
54
51
  "yalcp": "yalc publish --push",
55
52
  "test": "jest packages/loader-nextjs --config=../../jest.config.js --passWithNoTests",
56
53
  "coverage": "yarn test --coverage",
@@ -82,11 +79,11 @@
82
79
  "next": "^13.2.0"
83
80
  },
84
81
  "dependencies": {
85
- "@plasmicapp/loader-core": "1.0.119",
86
- "@plasmicapp/loader-edge": "1.0.50",
87
- "@plasmicapp/loader-react": "1.0.317",
88
- "@plasmicapp/watcher": "1.0.79",
82
+ "@plasmicapp/loader-core": "1.0.120",
83
+ "@plasmicapp/loader-edge": "1.0.51",
84
+ "@plasmicapp/loader-react": "1.0.319",
85
+ "@plasmicapp/watcher": "1.0.80",
89
86
  "server-only": "0.0.1"
90
87
  },
91
- "gitHead": "6f034859cd2316dfed75d01006abbc002149374c"
88
+ "gitHead": "e509f855bddb2f2a527bbf0b4fc5fed35e607e5c"
92
89
  }
package/dist/cache.d.ts DELETED
@@ -1,5 +0,0 @@
1
- import type { InitOptions } from "@plasmicapp/loader-react/react-server-conditional";
2
- import type { NextInitOptions } from "./shared-exports";
3
- export declare function initPlasmicLoaderWithCache<T extends {
4
- clearCache(): void;
5
- }>(initFn: (opts: InitOptions) => T, { nextNavigation, ...opts }: NextInitOptions): T;
@@ -1,4 +0,0 @@
1
- /// <reference types="node" />
2
- import type * as FS from "fs";
3
- export declare function serverRequire<T>(module: string): Promise<T>;
4
- export declare function serverRequireFs(): Promise<typeof FS>;
@@ -1,29 +0,0 @@
1
- /** Shared exports for both "default" and "react-server" exports live here. */
2
- import type { InitOptions as LoaderReactInitOptions } from "@plasmicapp/loader-react/react-server-conditional";
3
- export interface NextInitOptions extends LoaderReactInitOptions {
4
- /**
5
- * next/navigation doesn't exist prior to Next.js 13, so Plasmic can't assume the dependency exists.
6
- * If you use the App Router (which depends on next/navigation), you'll need to pass the module here.
7
- *
8
- * ```tsx
9
- * import { initPlasmicLoader } from "@plasmicapp/loader-nextjs/react-server-conditional";
10
- * import * as NextNavigation from "next/navigation";
11
- *
12
- * export const PLASMIC = initPlasmicLoader({
13
- * nextNavigation: NextNavigation,
14
- * projects: [
15
- * // your projects
16
- * ],
17
- * });
18
- * ```
19
- */
20
- nextNavigation?: {
21
- notFound: unknown;
22
- redirect: unknown;
23
- useParams: unknown;
24
- usePathname: unknown;
25
- useRouter: unknown;
26
- useSearchParams: unknown;
27
- };
28
- }
29
- export type { ComponentMeta, ComponentRenderData, InitOptions, PageMeta, PageMetadata, } from "@plasmicapp/loader-react/react-server-conditional";