create-plasmic-app 0.0.104 → 0.0.106
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/cpa-out/.gitignore +4 -0
- package/cpa-out/react-codegen-js/eslint.config.js +9 -13
- package/cpa-out/react-codegen-js/package.json +12 -12
- package/cpa-out/react-codegen-js/plasmic.json +2 -2
- package/cpa-out/react-codegen-js/src/components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen.jsx +8 -0
- package/cpa-out/react-codegen-ts/eslint.config.js +10 -15
- package/cpa-out/react-codegen-ts/package.json +14 -14
- package/cpa-out/react-codegen-ts/plasmic.json +2 -2
- package/cpa-out/react-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen.tsx +9 -0
- package/cpa-out/tanstack-codegen-ts/package.json +42 -0
- package/cpa-out/tanstack-codegen-ts/plasmic.json +136 -0
- package/cpa-out/tanstack-codegen-ts/src/components/Button.tsx +35 -0
- package/cpa-out/tanstack-codegen-ts/src/components/Header.tsx +21 -0
- package/cpa-out/tanstack-codegen-ts/src/components/RandomDynamicPageButton.tsx +44 -0
- package/cpa-out/tanstack-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicButton.tsx +870 -0
- package/cpa-out/tanstack-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicDynamicPage.tsx +309 -0
- package/cpa-out/tanstack-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen.tsx +28 -0
- package/cpa-out/tanstack-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicHomepage.tsx +351 -0
- package/cpa-out/tanstack-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicRandomDynamicPageButton.tsx +279 -0
- package/cpa-out/tanstack-codegen-ts/src/components/plasmic/create_plasmic_app/icons/PlasmicIcon__CheckSvg.tsx +44 -0
- package/cpa-out/tanstack-codegen-ts/src/components/plasmic/create_plasmic_app/icons/PlasmicIcon__Icon.tsx +41 -0
- package/cpa-out/tanstack-codegen-ts/src/routeTree.gen.ts +95 -0
- package/cpa-out/tanstack-codegen-ts/src/router.tsx +24 -0
- package/cpa-out/tanstack-codegen-ts/src/routes/__root.tsx +37 -0
- package/cpa-out/tanstack-codegen-ts/src/routes/dynamic/$slug/index.tsx +49 -0
- package/cpa-out/tanstack-codegen-ts/src/routes/index.tsx +49 -0
- package/cpa-out/tanstack-codegen-ts/src/routes/plasmic-host.tsx +20 -0
- package/cpa-out/tanstack-codegen-ts/tsconfig.json +28 -0
- package/cpa-out/tanstack-codegen-ts/vite.config.ts +26 -0
- package/dist/tanstack/tanstack.js +1 -1
- package/dist/tanstack/templates/file-router/config.d.ts +1 -1
- package/dist/tanstack/templates/file-router/config.js +27 -27
- package/package.json +2 -2
- package/src/tanstack/tanstack.ts +3 -3
- package/src/tanstack/templates/file-router/config.ts +25 -25
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
/* prettier-ignore-start */
|
|
5
|
+
|
|
6
|
+
/** @jsxRuntime classic */
|
|
7
|
+
/** @jsx createPlasmicElementProxy */
|
|
8
|
+
/** @jsxFrag React.Fragment */
|
|
9
|
+
|
|
10
|
+
// This class is auto-generated by Plasmic; please do not edit!
|
|
11
|
+
// Plasmic Project: 47tFXWjN2C4NyHFGGpaYQ3
|
|
12
|
+
// Component: Q23H1_1M_P
|
|
13
|
+
|
|
14
|
+
import * as React from "react";
|
|
15
|
+
|
|
16
|
+
import { useRouter, Link } from "@tanstack/react-router";
|
|
17
|
+
import type { LinkProps } from "@tanstack/react-router";
|
|
18
|
+
|
|
19
|
+
import {
|
|
20
|
+
Flex as Flex__,
|
|
21
|
+
MultiChoiceArg,
|
|
22
|
+
PlasmicDataSourceContextProvider as PlasmicDataSourceContextProvider__,
|
|
23
|
+
PlasmicIcon as PlasmicIcon__,
|
|
24
|
+
PlasmicImg as PlasmicImg__,
|
|
25
|
+
PlasmicLink as PlasmicLink__,
|
|
26
|
+
PlasmicPageGuard as PlasmicPageGuard__,
|
|
27
|
+
SingleBooleanChoiceArg,
|
|
28
|
+
SingleChoiceArg,
|
|
29
|
+
Stack as Stack__,
|
|
30
|
+
StrictProps,
|
|
31
|
+
Trans as Trans__,
|
|
32
|
+
classNames,
|
|
33
|
+
createPlasmicElementProxy,
|
|
34
|
+
deriveRenderOpts,
|
|
35
|
+
ensureGlobalVariants,
|
|
36
|
+
generateOnMutateForSpec,
|
|
37
|
+
generateStateOnChangeProp,
|
|
38
|
+
generateStateOnChangePropForCodeComponents,
|
|
39
|
+
generateStateValueProp,
|
|
40
|
+
get as $stateGet,
|
|
41
|
+
hasVariant,
|
|
42
|
+
initializeCodeComponentStates,
|
|
43
|
+
initializePlasmicStates,
|
|
44
|
+
makeFragment,
|
|
45
|
+
omit,
|
|
46
|
+
pick,
|
|
47
|
+
renderPlasmicSlot,
|
|
48
|
+
set as $stateSet,
|
|
49
|
+
useCurrentUser,
|
|
50
|
+
useDollarState,
|
|
51
|
+
usePlasmicTranslator,
|
|
52
|
+
useTrigger,
|
|
53
|
+
wrapWithClassName
|
|
54
|
+
} from "@plasmicapp/react-web";
|
|
55
|
+
import {
|
|
56
|
+
DataCtxReader as DataCtxReader__,
|
|
57
|
+
useDataEnv,
|
|
58
|
+
useGlobalActions
|
|
59
|
+
} from "@plasmicapp/react-web/lib/host";
|
|
60
|
+
|
|
61
|
+
import Button from "../../Button"; // plasmic-import: TQcvW_pSKi3/component
|
|
62
|
+
|
|
63
|
+
import globalcss from "@plasmicapp/react-web/lib/plasmic.css?url";
|
|
64
|
+
import defaultcss from "../plasmic__default_style.css?url"; // plasmic-import: global/defaultcss
|
|
65
|
+
|
|
66
|
+
import projectcss from "./plasmic.css?url"; // plasmic-import: 47tFXWjN2C4NyHFGGpaYQ3/projectcss
|
|
67
|
+
import sty from "./PlasmicRandomDynamicPageButton.css?url"; // plasmic-import: Q23H1_1M_P/css
|
|
68
|
+
|
|
69
|
+
import CheckSvgIcon from "./icons/PlasmicIcon__CheckSvg"; // plasmic-import: gj-_D7n31Ho/icon
|
|
70
|
+
import IconIcon from "./icons/PlasmicIcon__Icon"; // plasmic-import: 6PNxx3YMyDQ/icon
|
|
71
|
+
|
|
72
|
+
createPlasmicElementProxy;
|
|
73
|
+
|
|
74
|
+
export type PlasmicRandomDynamicPageButton__VariantMembers = {};
|
|
75
|
+
export type PlasmicRandomDynamicPageButton__VariantsArgs = {};
|
|
76
|
+
type VariantPropType = keyof PlasmicRandomDynamicPageButton__VariantsArgs;
|
|
77
|
+
export const PlasmicRandomDynamicPageButton__VariantProps =
|
|
78
|
+
new Array<VariantPropType>();
|
|
79
|
+
|
|
80
|
+
export type PlasmicRandomDynamicPageButton__ArgsType = {};
|
|
81
|
+
type ArgPropType = keyof PlasmicRandomDynamicPageButton__ArgsType;
|
|
82
|
+
export const PlasmicRandomDynamicPageButton__ArgProps =
|
|
83
|
+
new Array<ArgPropType>();
|
|
84
|
+
|
|
85
|
+
export type PlasmicRandomDynamicPageButton__OverridesType = {
|
|
86
|
+
root?: Flex__<typeof Button>;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export interface DefaultRandomDynamicPageButtonProps {
|
|
90
|
+
className?: string;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const $$ = {};
|
|
94
|
+
|
|
95
|
+
function useTanStackRouter() {
|
|
96
|
+
try {
|
|
97
|
+
return useRouter();
|
|
98
|
+
} catch {}
|
|
99
|
+
return undefined;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function PlasmicRandomDynamicPageButton__RenderFunc(props: {
|
|
103
|
+
variants: PlasmicRandomDynamicPageButton__VariantsArgs;
|
|
104
|
+
args: PlasmicRandomDynamicPageButton__ArgsType;
|
|
105
|
+
overrides: PlasmicRandomDynamicPageButton__OverridesType;
|
|
106
|
+
forNode?: string;
|
|
107
|
+
}) {
|
|
108
|
+
const { variants, overrides, forNode } = props;
|
|
109
|
+
|
|
110
|
+
const args = React.useMemo(
|
|
111
|
+
() =>
|
|
112
|
+
Object.assign(
|
|
113
|
+
{},
|
|
114
|
+
Object.fromEntries(
|
|
115
|
+
Object.entries(props.args).filter(([_, v]) => v !== undefined)
|
|
116
|
+
)
|
|
117
|
+
),
|
|
118
|
+
[props.args]
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
const $props = {
|
|
122
|
+
...args,
|
|
123
|
+
...variants
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const __tanstackRouter = useTanStackRouter();
|
|
127
|
+
const $ctx = useDataEnv?.() || {};
|
|
128
|
+
const refsRef = React.useRef({});
|
|
129
|
+
const $refs = refsRef.current;
|
|
130
|
+
|
|
131
|
+
return (
|
|
132
|
+
<Button
|
|
133
|
+
data-plasmic-name={"root"}
|
|
134
|
+
data-plasmic-override={overrides.root}
|
|
135
|
+
data-plasmic-root={true}
|
|
136
|
+
data-plasmic-for-node={forNode}
|
|
137
|
+
className={classNames(
|
|
138
|
+
"__wab_instance",
|
|
139
|
+
"RandomDynamicPageButton__root__yStMk"
|
|
140
|
+
)}
|
|
141
|
+
onClick={async event => {
|
|
142
|
+
const $steps = {};
|
|
143
|
+
|
|
144
|
+
$steps["goToDynamicPage"] = true
|
|
145
|
+
? (() => {
|
|
146
|
+
const actionArgs = {
|
|
147
|
+
destination: `/dynamic/${(() => {
|
|
148
|
+
try {
|
|
149
|
+
return Math.random().toString(36).slice(2);
|
|
150
|
+
} catch (e) {
|
|
151
|
+
if (
|
|
152
|
+
e instanceof TypeError ||
|
|
153
|
+
e?.plasmicType === "PlasmicUndefinedDataError"
|
|
154
|
+
) {
|
|
155
|
+
return "value";
|
|
156
|
+
}
|
|
157
|
+
throw e;
|
|
158
|
+
}
|
|
159
|
+
})()}`
|
|
160
|
+
};
|
|
161
|
+
return (({ destination }) => {
|
|
162
|
+
if (
|
|
163
|
+
typeof destination === "string" &&
|
|
164
|
+
destination.startsWith("#")
|
|
165
|
+
) {
|
|
166
|
+
document
|
|
167
|
+
.getElementById(destination.substr(1))
|
|
168
|
+
.scrollIntoView({ behavior: "smooth" });
|
|
169
|
+
} else {
|
|
170
|
+
location.assign(destination);
|
|
171
|
+
}
|
|
172
|
+
})?.apply(null, [actionArgs]);
|
|
173
|
+
})()
|
|
174
|
+
: undefined;
|
|
175
|
+
if (
|
|
176
|
+
$steps["goToDynamicPage"] != null &&
|
|
177
|
+
typeof $steps["goToDynamicPage"] === "object" &&
|
|
178
|
+
typeof $steps["goToDynamicPage"].then === "function"
|
|
179
|
+
) {
|
|
180
|
+
$steps["goToDynamicPage"] = await $steps["goToDynamicPage"];
|
|
181
|
+
}
|
|
182
|
+
}}
|
|
183
|
+
submitsForm={true}
|
|
184
|
+
>
|
|
185
|
+
{"Random Dynamic Page"}
|
|
186
|
+
</Button>
|
|
187
|
+
) as React.ReactElement | null;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
const PlasmicDescendants = {
|
|
191
|
+
root: ["root"]
|
|
192
|
+
} as const;
|
|
193
|
+
type NodeNameType = keyof typeof PlasmicDescendants;
|
|
194
|
+
type DescendantsType<T extends NodeNameType> =
|
|
195
|
+
(typeof PlasmicDescendants)[T][number];
|
|
196
|
+
type NodeDefaultElementType = {
|
|
197
|
+
root: typeof Button;
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
type ReservedPropsType = "variants" | "args" | "overrides";
|
|
201
|
+
type NodeOverridesType<T extends NodeNameType> = Pick<
|
|
202
|
+
PlasmicRandomDynamicPageButton__OverridesType,
|
|
203
|
+
DescendantsType<T>
|
|
204
|
+
>;
|
|
205
|
+
type NodeComponentProps<T extends NodeNameType> =
|
|
206
|
+
// Explicitly specify variants, args, and overrides as objects
|
|
207
|
+
{
|
|
208
|
+
variants?: PlasmicRandomDynamicPageButton__VariantsArgs;
|
|
209
|
+
args?: PlasmicRandomDynamicPageButton__ArgsType;
|
|
210
|
+
overrides?: NodeOverridesType<T>;
|
|
211
|
+
} & Omit<PlasmicRandomDynamicPageButton__VariantsArgs, ReservedPropsType> & // Specify variants directly as props
|
|
212
|
+
// Specify args directly as props
|
|
213
|
+
Omit<PlasmicRandomDynamicPageButton__ArgsType, ReservedPropsType> &
|
|
214
|
+
// Specify overrides for each element directly as props
|
|
215
|
+
Omit<
|
|
216
|
+
NodeOverridesType<T>,
|
|
217
|
+
ReservedPropsType | VariantPropType | ArgPropType
|
|
218
|
+
> &
|
|
219
|
+
// Specify props for the root element
|
|
220
|
+
Omit<
|
|
221
|
+
Partial<React.ComponentProps<NodeDefaultElementType[T]>>,
|
|
222
|
+
ReservedPropsType | VariantPropType | ArgPropType | DescendantsType<T>
|
|
223
|
+
>;
|
|
224
|
+
|
|
225
|
+
function makeNodeComponent<NodeName extends NodeNameType>(nodeName: NodeName) {
|
|
226
|
+
type PropsType = NodeComponentProps<NodeName> & { key?: React.Key };
|
|
227
|
+
const func = function <T extends PropsType>(
|
|
228
|
+
props: T & StrictProps<T, PropsType>
|
|
229
|
+
) {
|
|
230
|
+
const { variants, args, overrides } = React.useMemo(
|
|
231
|
+
() =>
|
|
232
|
+
deriveRenderOpts(props, {
|
|
233
|
+
name: nodeName,
|
|
234
|
+
descendantNames: PlasmicDescendants[nodeName],
|
|
235
|
+
internalArgPropNames: PlasmicRandomDynamicPageButton__ArgProps,
|
|
236
|
+
internalVariantPropNames: PlasmicRandomDynamicPageButton__VariantProps
|
|
237
|
+
}),
|
|
238
|
+
[props, nodeName]
|
|
239
|
+
);
|
|
240
|
+
return PlasmicRandomDynamicPageButton__RenderFunc({
|
|
241
|
+
variants,
|
|
242
|
+
args,
|
|
243
|
+
overrides,
|
|
244
|
+
forNode: nodeName
|
|
245
|
+
});
|
|
246
|
+
};
|
|
247
|
+
if (nodeName === "root") {
|
|
248
|
+
func.displayName = "PlasmicRandomDynamicPageButton";
|
|
249
|
+
} else {
|
|
250
|
+
func.displayName = `PlasmicRandomDynamicPageButton.${nodeName}`;
|
|
251
|
+
}
|
|
252
|
+
return func;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export const PlasmicRandomDynamicPageButton = Object.assign(
|
|
256
|
+
// Top-level PlasmicRandomDynamicPageButton renders the root element
|
|
257
|
+
makeNodeComponent("root"),
|
|
258
|
+
{
|
|
259
|
+
// Helper components rendering sub-elements
|
|
260
|
+
|
|
261
|
+
// Metadata about props expected for PlasmicRandomDynamicPageButton
|
|
262
|
+
internalVariantProps: PlasmicRandomDynamicPageButton__VariantProps,
|
|
263
|
+
internalArgProps: PlasmicRandomDynamicPageButton__ArgProps
|
|
264
|
+
}
|
|
265
|
+
);
|
|
266
|
+
|
|
267
|
+
export const PlasmicRandomDynamicPageButton__HeadOptions = {
|
|
268
|
+
meta: [{ name: "twitter:card", content: "summary" }],
|
|
269
|
+
|
|
270
|
+
links: [
|
|
271
|
+
{ rel: "stylesheet", href: globalcss },
|
|
272
|
+
{ rel: "stylesheet", href: defaultcss },
|
|
273
|
+
{ rel: "stylesheet", href: projectcss },
|
|
274
|
+
{ rel: "stylesheet", href: sty }
|
|
275
|
+
]
|
|
276
|
+
} as Record<"meta" | "links", Array<Record<string, string>>>;
|
|
277
|
+
|
|
278
|
+
export default PlasmicRandomDynamicPageButton;
|
|
279
|
+
/* prettier-ignore-end */
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
/* prettier-ignore-start */
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { classNames } from "@plasmicapp/react-web";
|
|
7
|
+
|
|
8
|
+
export type CheckSvgIconProps = React.ComponentProps<"svg"> & {
|
|
9
|
+
title?: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export function CheckSvgIcon(props: CheckSvgIconProps) {
|
|
13
|
+
const { className, style, title, ...restProps } = props;
|
|
14
|
+
return (
|
|
15
|
+
<svg
|
|
16
|
+
xmlns={"http://www.w3.org/2000/svg"}
|
|
17
|
+
fill={"none"}
|
|
18
|
+
viewBox={"0 0 24 24"}
|
|
19
|
+
height={"1em"}
|
|
20
|
+
width={"1em"}
|
|
21
|
+
style={{
|
|
22
|
+
fill: "currentcolor",
|
|
23
|
+
|
|
24
|
+
...(style || {}),
|
|
25
|
+
}}
|
|
26
|
+
className={classNames("plasmic-default__svg", className)}
|
|
27
|
+
{...restProps}
|
|
28
|
+
>
|
|
29
|
+
{title && <title>{title}</title>}
|
|
30
|
+
|
|
31
|
+
<path
|
|
32
|
+
fillRule={"evenodd"}
|
|
33
|
+
clipRule={"evenodd"}
|
|
34
|
+
d={
|
|
35
|
+
"M18.416 5.876a.75.75 0 01.208 1.04L11.42 17.721a1.75 1.75 0 01-2.871.06l-3.156-4.34a.75.75 0 111.214-.882l3.155 4.339a.25.25 0 00.41-.009l7.204-10.805a.75.75 0 011.04-.208z"
|
|
36
|
+
}
|
|
37
|
+
fill={"currentColor"}
|
|
38
|
+
></path>
|
|
39
|
+
</svg>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export default CheckSvgIcon;
|
|
44
|
+
/* prettier-ignore-end */
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
/* prettier-ignore-start */
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { classNames } from "@plasmicapp/react-web";
|
|
7
|
+
|
|
8
|
+
export type IconIconProps = React.ComponentProps<"svg"> & {
|
|
9
|
+
title?: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export function IconIcon(props: IconIconProps) {
|
|
13
|
+
const { className, style, title, ...restProps } = props;
|
|
14
|
+
return (
|
|
15
|
+
<svg
|
|
16
|
+
xmlns={"http://www.w3.org/2000/svg"}
|
|
17
|
+
stroke={"currentColor"}
|
|
18
|
+
fill={"currentColor"}
|
|
19
|
+
strokeWidth={"0"}
|
|
20
|
+
viewBox={"0 0 16 16"}
|
|
21
|
+
height={"1em"}
|
|
22
|
+
width={"1em"}
|
|
23
|
+
className={classNames("plasmic-default__svg", className)}
|
|
24
|
+
style={style}
|
|
25
|
+
{...restProps}
|
|
26
|
+
>
|
|
27
|
+
{title && <title>{title}</title>}
|
|
28
|
+
|
|
29
|
+
<path
|
|
30
|
+
fillRule={"evenodd"}
|
|
31
|
+
d={
|
|
32
|
+
"M1 8a.5.5 0 01.5-.5h11.793l-3.147-3.146a.5.5 0 01.708-.708l4 4a.5.5 0 010 .708l-4 4a.5.5 0 01-.708-.708L13.293 8.5H1.5A.5.5 0 011 8z"
|
|
33
|
+
}
|
|
34
|
+
stroke={"none"}
|
|
35
|
+
></path>
|
|
36
|
+
</svg>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export default IconIcon;
|
|
41
|
+
/* prettier-ignore-end */
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
|
|
5
|
+
// noinspection JSUnusedGlobalSymbols
|
|
6
|
+
|
|
7
|
+
// This file was automatically generated by TanStack Router.
|
|
8
|
+
// You should NOT make any changes in this file as it will be overwritten.
|
|
9
|
+
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
|
|
10
|
+
|
|
11
|
+
import { Route as rootRouteImport } from './routes/__root'
|
|
12
|
+
import { Route as PlasmicHostRouteImport } from './routes/plasmic-host'
|
|
13
|
+
import { Route as IndexRouteImport } from './routes/index'
|
|
14
|
+
import { Route as DynamicSlugIndexRouteImport } from './routes/dynamic/$slug/index'
|
|
15
|
+
|
|
16
|
+
const PlasmicHostRoute = PlasmicHostRouteImport.update({
|
|
17
|
+
id: '/plasmic-host',
|
|
18
|
+
path: '/plasmic-host',
|
|
19
|
+
getParentRoute: () => rootRouteImport,
|
|
20
|
+
} as any)
|
|
21
|
+
const IndexRoute = IndexRouteImport.update({
|
|
22
|
+
id: '/',
|
|
23
|
+
path: '/',
|
|
24
|
+
getParentRoute: () => rootRouteImport,
|
|
25
|
+
} as any)
|
|
26
|
+
const DynamicSlugIndexRoute = DynamicSlugIndexRouteImport.update({
|
|
27
|
+
id: '/dynamic/$slug/',
|
|
28
|
+
path: '/dynamic/$slug/',
|
|
29
|
+
getParentRoute: () => rootRouteImport,
|
|
30
|
+
} as any)
|
|
31
|
+
|
|
32
|
+
export interface FileRoutesByFullPath {
|
|
33
|
+
'/': typeof IndexRoute
|
|
34
|
+
'/plasmic-host': typeof PlasmicHostRoute
|
|
35
|
+
'/dynamic/$slug': typeof DynamicSlugIndexRoute
|
|
36
|
+
}
|
|
37
|
+
export interface FileRoutesByTo {
|
|
38
|
+
'/': typeof IndexRoute
|
|
39
|
+
'/plasmic-host': typeof PlasmicHostRoute
|
|
40
|
+
'/dynamic/$slug': typeof DynamicSlugIndexRoute
|
|
41
|
+
}
|
|
42
|
+
export interface FileRoutesById {
|
|
43
|
+
__root__: typeof rootRouteImport
|
|
44
|
+
'/': typeof IndexRoute
|
|
45
|
+
'/plasmic-host': typeof PlasmicHostRoute
|
|
46
|
+
'/dynamic/$slug/': typeof DynamicSlugIndexRoute
|
|
47
|
+
}
|
|
48
|
+
export interface FileRouteTypes {
|
|
49
|
+
fileRoutesByFullPath: FileRoutesByFullPath
|
|
50
|
+
fullPaths: '/' | '/plasmic-host' | '/dynamic/$slug'
|
|
51
|
+
fileRoutesByTo: FileRoutesByTo
|
|
52
|
+
to: '/' | '/plasmic-host' | '/dynamic/$slug'
|
|
53
|
+
id: '__root__' | '/' | '/plasmic-host' | '/dynamic/$slug/'
|
|
54
|
+
fileRoutesById: FileRoutesById
|
|
55
|
+
}
|
|
56
|
+
export interface RootRouteChildren {
|
|
57
|
+
IndexRoute: typeof IndexRoute
|
|
58
|
+
PlasmicHostRoute: typeof PlasmicHostRoute
|
|
59
|
+
DynamicSlugIndexRoute: typeof DynamicSlugIndexRoute
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
declare module '@tanstack/react-router' {
|
|
63
|
+
interface FileRoutesByPath {
|
|
64
|
+
'/plasmic-host': {
|
|
65
|
+
id: '/plasmic-host'
|
|
66
|
+
path: '/plasmic-host'
|
|
67
|
+
fullPath: '/plasmic-host'
|
|
68
|
+
preLoaderRoute: typeof PlasmicHostRouteImport
|
|
69
|
+
parentRoute: typeof rootRouteImport
|
|
70
|
+
}
|
|
71
|
+
'/': {
|
|
72
|
+
id: '/'
|
|
73
|
+
path: '/'
|
|
74
|
+
fullPath: '/'
|
|
75
|
+
preLoaderRoute: typeof IndexRouteImport
|
|
76
|
+
parentRoute: typeof rootRouteImport
|
|
77
|
+
}
|
|
78
|
+
'/dynamic/$slug/': {
|
|
79
|
+
id: '/dynamic/$slug/'
|
|
80
|
+
path: '/dynamic/$slug'
|
|
81
|
+
fullPath: '/dynamic/$slug'
|
|
82
|
+
preLoaderRoute: typeof DynamicSlugIndexRouteImport
|
|
83
|
+
parentRoute: typeof rootRouteImport
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const rootRouteChildren: RootRouteChildren = {
|
|
89
|
+
IndexRoute: IndexRoute,
|
|
90
|
+
PlasmicHostRoute: PlasmicHostRoute,
|
|
91
|
+
DynamicSlugIndexRoute: DynamicSlugIndexRoute,
|
|
92
|
+
}
|
|
93
|
+
export const routeTree = rootRouteImport
|
|
94
|
+
._addFileChildren(rootRouteChildren)
|
|
95
|
+
._addFileTypes<FileRouteTypes>()
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createRouter as createTanstackRouter } from '@tanstack/react-router'
|
|
2
|
+
|
|
3
|
+
// Import the generated route tree
|
|
4
|
+
import { routeTree } from './routeTree.gen'
|
|
5
|
+
|
|
6
|
+
import './styles.css'
|
|
7
|
+
|
|
8
|
+
// Create a new router instance
|
|
9
|
+
export const createRouter = () => {
|
|
10
|
+
const router = createTanstackRouter({
|
|
11
|
+
routeTree,
|
|
12
|
+
scrollRestoration: true,
|
|
13
|
+
defaultPreloadStaleTime: 0,
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
return router
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Register the router instance for type safety
|
|
20
|
+
declare module '@tanstack/react-router' {
|
|
21
|
+
interface Register {
|
|
22
|
+
router: ReturnType<typeof createRouter>
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { createRootRoute, HeadContent, Outlet, Scripts } from '@tanstack/react-router'
|
|
2
|
+
import { TanStackRouterDevtools } from '@tanstack/react-router-devtools'
|
|
3
|
+
import { PlasmicRootProvider } from "@plasmicapp/react-web"
|
|
4
|
+
import appCss from "../styles.css?url";
|
|
5
|
+
|
|
6
|
+
export const Route = createRootRoute({
|
|
7
|
+
head: () => ({
|
|
8
|
+
links: [
|
|
9
|
+
{
|
|
10
|
+
rel: 'stylesheet',
|
|
11
|
+
href: appCss,
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
}),
|
|
15
|
+
component: () => (
|
|
16
|
+
<RootDocument>
|
|
17
|
+
<PlasmicRootProvider>
|
|
18
|
+
<Outlet />
|
|
19
|
+
<TanStackRouterDevtools />
|
|
20
|
+
</PlasmicRootProvider>
|
|
21
|
+
</RootDocument>
|
|
22
|
+
),
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
function RootDocument({ children }: { children: React.ReactNode }) {
|
|
26
|
+
return (
|
|
27
|
+
<html lang="en">
|
|
28
|
+
<head>
|
|
29
|
+
<HeadContent />
|
|
30
|
+
</head>
|
|
31
|
+
<body>
|
|
32
|
+
{children}
|
|
33
|
+
<Scripts />
|
|
34
|
+
</body>
|
|
35
|
+
</html>
|
|
36
|
+
)
|
|
37
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// This is a skeleton starter React page generated by Plasmic.
|
|
2
|
+
// This file is owned by you, feel free to edit as you see fit.
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { PageParamsProvider as PageParamsProvider__ } from "@plasmicapp/react-web/lib/host";
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
PlasmicDynamicPage,
|
|
8
|
+
PlasmicDynamicPage__HeadOptions
|
|
9
|
+
} from "../../../components/plasmic/create_plasmic_app/PlasmicDynamicPage";
|
|
10
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
11
|
+
|
|
12
|
+
export const Route = createFileRoute("/dynamic/$slug/")({
|
|
13
|
+
head: () => ({
|
|
14
|
+
meta: [...PlasmicDynamicPage__HeadOptions.meta],
|
|
15
|
+
links: [...PlasmicDynamicPage__HeadOptions.links]
|
|
16
|
+
}),
|
|
17
|
+
component: DynamicPage
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
function DynamicPage() {
|
|
21
|
+
// Use PlasmicDynamicPage to render this component as it was
|
|
22
|
+
// designed in Plasmic, by activating the appropriate variants,
|
|
23
|
+
// attaching the appropriate event handlers, etc. You
|
|
24
|
+
// can also install whatever React hooks you need here to manage state or
|
|
25
|
+
// fetch data.
|
|
26
|
+
//
|
|
27
|
+
// Props you can pass into PlasmicDynamicPage are:
|
|
28
|
+
// 1. Variants you want to activate,
|
|
29
|
+
// 2. Contents for slots you want to fill,
|
|
30
|
+
// 3. Overrides for any named node in the component to attach behavior and data,
|
|
31
|
+
// 4. Props to set on the root node.
|
|
32
|
+
//
|
|
33
|
+
// By default, PlasmicDynamicPage is wrapped by your project's global
|
|
34
|
+
// variant context providers. These wrappers may be moved to
|
|
35
|
+
// TanStack Router __root Route
|
|
36
|
+
// (https://tanstack.com/router/latest/docs/framework/react/guide/tanstack-start#the-root-of-your-application).
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<PageParamsProvider__
|
|
40
|
+
route={Route.fullPath}
|
|
41
|
+
params={Route.useParams()}
|
|
42
|
+
query={Route.useSearch()}
|
|
43
|
+
>
|
|
44
|
+
<PlasmicDynamicPage />
|
|
45
|
+
</PageParamsProvider__>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export default DynamicPage;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// This is a skeleton starter React page generated by Plasmic.
|
|
2
|
+
// This file is owned by you, feel free to edit as you see fit.
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { PageParamsProvider as PageParamsProvider__ } from "@plasmicapp/react-web/lib/host";
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
PlasmicHomepage,
|
|
8
|
+
PlasmicHomepage__HeadOptions
|
|
9
|
+
} from "../components/plasmic/create_plasmic_app/PlasmicHomepage";
|
|
10
|
+
import { createFileRoute } from "@tanstack/react-router";
|
|
11
|
+
|
|
12
|
+
export const Route = createFileRoute("/")({
|
|
13
|
+
head: () => ({
|
|
14
|
+
meta: [...PlasmicHomepage__HeadOptions.meta],
|
|
15
|
+
links: [...PlasmicHomepage__HeadOptions.links]
|
|
16
|
+
}),
|
|
17
|
+
component: Homepage
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
function Homepage() {
|
|
21
|
+
// Use PlasmicHomepage to render this component as it was
|
|
22
|
+
// designed in Plasmic, by activating the appropriate variants,
|
|
23
|
+
// attaching the appropriate event handlers, etc. You
|
|
24
|
+
// can also install whatever React hooks you need here to manage state or
|
|
25
|
+
// fetch data.
|
|
26
|
+
//
|
|
27
|
+
// Props you can pass into PlasmicHomepage are:
|
|
28
|
+
// 1. Variants you want to activate,
|
|
29
|
+
// 2. Contents for slots you want to fill,
|
|
30
|
+
// 3. Overrides for any named node in the component to attach behavior and data,
|
|
31
|
+
// 4. Props to set on the root node.
|
|
32
|
+
//
|
|
33
|
+
// By default, PlasmicHomepage is wrapped by your project's global
|
|
34
|
+
// variant context providers. These wrappers may be moved to
|
|
35
|
+
// TanStack Router __root Route
|
|
36
|
+
// (https://tanstack.com/router/latest/docs/framework/react/guide/tanstack-start#the-root-of-your-application).
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<PageParamsProvider__
|
|
40
|
+
route={Route.fullPath}
|
|
41
|
+
params={Route.useParams()}
|
|
42
|
+
query={Route.useSearch()}
|
|
43
|
+
>
|
|
44
|
+
<PlasmicHomepage />
|
|
45
|
+
</PageParamsProvider__>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export default Homepage;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createFileRoute } from '@tanstack/react-router'
|
|
2
|
+
import { PlasmicCanvasHost, registerComponent } from '@plasmicapp/react-web/lib/host';
|
|
3
|
+
|
|
4
|
+
export const Route = createFileRoute('/plasmic-host')({
|
|
5
|
+
component: PlasmicHostRouteComponent,
|
|
6
|
+
})
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
// You can register any code components that you want to use here; see
|
|
10
|
+
// https://docs.plasmic.app/learn/code-components-ref/
|
|
11
|
+
// And configure your Plasmic project to use the host url pointing at
|
|
12
|
+
// the /plasmic-host page of your nextjs app (for example,
|
|
13
|
+
// http://localhost:3000/plasmic-host). See
|
|
14
|
+
// https://docs.plasmic.app/learn/app-hosting/#set-a-plasmic-project-to-use-your-app-host
|
|
15
|
+
|
|
16
|
+
// registerComponent(...)
|
|
17
|
+
|
|
18
|
+
function PlasmicHostRouteComponent() {
|
|
19
|
+
return <PlasmicCanvasHost />
|
|
20
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"include": ["**/*.ts", "**/*.tsx"],
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"target": "ES2022",
|
|
5
|
+
"jsx": "react-jsx",
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
8
|
+
"types": ["vite/client"],
|
|
9
|
+
|
|
10
|
+
/* Bundler mode */
|
|
11
|
+
"moduleResolution": "bundler",
|
|
12
|
+
"allowImportingTsExtensions": true,
|
|
13
|
+
"verbatimModuleSyntax": true,
|
|
14
|
+
"noEmit": true,
|
|
15
|
+
|
|
16
|
+
/* Linting */
|
|
17
|
+
"skipLibCheck": true,
|
|
18
|
+
"strict": true,
|
|
19
|
+
"noUnusedLocals": true,
|
|
20
|
+
"noUnusedParameters": true,
|
|
21
|
+
"noFallthroughCasesInSwitch": true,
|
|
22
|
+
"noUncheckedSideEffectImports": true,
|
|
23
|
+
"baseUrl": ".",
|
|
24
|
+
"paths": {
|
|
25
|
+
"@/*": ["./src/*"],
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|