create-plasmic-app 0.0.95 → 0.0.97

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.
Files changed (80) hide show
  1. package/cpa-out/react-codegen-js/eslint.config.js +38 -0
  2. package/cpa-out/react-codegen-js/package.json +22 -32
  3. package/cpa-out/react-codegen-js/plasmic.json +16 -10
  4. package/cpa-out/react-codegen-js/src/App.jsx +1 -1
  5. package/cpa-out/react-codegen-js/src/components/Button.jsx +1 -3
  6. package/cpa-out/react-codegen-js/src/components/plasmic/create_plasmic_app/PlasmicButton.jsx +47 -96
  7. package/cpa-out/react-codegen-js/src/components/plasmic/create_plasmic_app/PlasmicDynamicPage.jsx +35 -29
  8. package/cpa-out/react-codegen-js/src/components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen.jsx +2 -14
  9. package/cpa-out/react-codegen-js/src/components/plasmic/create_plasmic_app/PlasmicHomepage.jsx +24 -24
  10. package/cpa-out/react-codegen-js/src/components/plasmic/create_plasmic_app/PlasmicRandomDynamicPageButton.jsx +44 -58
  11. package/cpa-out/react-codegen-js/src/components/plasmic/create_plasmic_app/icons/PlasmicIcon__Checksvg.jsx +2 -2
  12. package/cpa-out/react-codegen-js/src/main.jsx +10 -0
  13. package/cpa-out/react-codegen-js/vite.config.js +7 -0
  14. package/cpa-out/react-codegen-ts/eslint.config.js +28 -0
  15. package/cpa-out/react-codegen-ts/package.json +23 -37
  16. package/cpa-out/react-codegen-ts/plasmic.json +16 -10
  17. package/cpa-out/react-codegen-ts/src/App.tsx +1 -1
  18. package/cpa-out/react-codegen-ts/src/components/Button.tsx +4 -5
  19. package/cpa-out/react-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicButton.tsx +84 -62
  20. package/cpa-out/react-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicDynamicPage.tsx +73 -44
  21. package/cpa-out/react-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen.tsx +2 -14
  22. package/cpa-out/react-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicHomepage.tsx +62 -38
  23. package/cpa-out/react-codegen-ts/src/components/plasmic/create_plasmic_app/PlasmicRandomDynamicPageButton.tsx +83 -70
  24. package/cpa-out/react-codegen-ts/src/components/plasmic/create_plasmic_app/icons/PlasmicIcon__Checksvg.tsx +3 -3
  25. package/cpa-out/react-codegen-ts/src/main.tsx +10 -0
  26. package/cpa-out/react-codegen-ts/src/vite-env.d.ts +1 -0
  27. package/cpa-out/react-codegen-ts/tsconfig.json +4 -23
  28. package/cpa-out/react-codegen-ts/vite.config.ts +7 -0
  29. package/dist/gatsby/template.js +2 -1
  30. package/dist/lib.js +1 -1
  31. package/dist/nextjs/templates/pages-codegen/app.js +2 -1
  32. package/dist/react/react.js +36 -11
  33. package/package.json +2 -2
  34. package/src/gatsby/template.ts +2 -1
  35. package/src/lib.ts +1 -1
  36. package/src/nextjs/templates/pages-codegen/app.ts +2 -1
  37. package/src/react/react.ts +47 -16
  38. package/cpa-out/react-codegen-js/src/index.js +0 -17
  39. package/cpa-out/react-codegen-js/src/reportWebVitals.js +0 -13
  40. package/cpa-out/react-codegen-js/src/setupTests.js +0 -5
  41. package/cpa-out/react-codegen-ts/src/index.tsx +0 -19
  42. package/cpa-out/react-codegen-ts/src/react-app-env.d.ts +0 -1
  43. package/cpa-out/react-codegen-ts/src/reportWebVitals.ts +0 -15
  44. package/cpa-out/react-codegen-ts/src/setupTests.ts +0 -5
  45. package/cpa-out/react-loader-js/package.json +0 -40
  46. package/cpa-out/react-loader-js/plasmic.json +0 -127
  47. package/cpa-out/react-loader-js/src/App.jsx +0 -9
  48. package/cpa-out/react-loader-js/src/components/Button.jsx +0 -13
  49. package/cpa-out/react-loader-js/src/components/DynamicPage.jsx +0 -26
  50. package/cpa-out/react-loader-js/src/components/Homepage.jsx +0 -26
  51. package/cpa-out/react-loader-js/src/components/RandomDynamicPageButton.jsx +0 -24
  52. package/cpa-out/react-loader-js/src/components/plasmic/create_plasmic_app/PlasmicButton.jsx +0 -625
  53. package/cpa-out/react-loader-js/src/components/plasmic/create_plasmic_app/PlasmicDynamicPage.jsx +0 -166
  54. package/cpa-out/react-loader-js/src/components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen.jsx +0 -29
  55. package/cpa-out/react-loader-js/src/components/plasmic/create_plasmic_app/PlasmicHomepage.jsx +0 -210
  56. package/cpa-out/react-loader-js/src/components/plasmic/create_plasmic_app/PlasmicRandomDynamicPageButton.jsx +0 -161
  57. package/cpa-out/react-loader-js/src/components/plasmic/create_plasmic_app/icons/PlasmicIcon__Checksvg.jsx +0 -39
  58. package/cpa-out/react-loader-js/src/components/plasmic/create_plasmic_app/icons/PlasmicIcon__Icon.jsx +0 -37
  59. package/cpa-out/react-loader-js/src/index.js +0 -17
  60. package/cpa-out/react-loader-js/src/reportWebVitals.js +0 -13
  61. package/cpa-out/react-loader-js/src/setupTests.js +0 -5
  62. package/cpa-out/react-loader-ts/package.json +0 -45
  63. package/cpa-out/react-loader-ts/plasmic.json +0 -127
  64. package/cpa-out/react-loader-ts/src/App.tsx +0 -9
  65. package/cpa-out/react-loader-ts/src/components/Button.tsx +0 -36
  66. package/cpa-out/react-loader-ts/src/components/DynamicPage.tsx +0 -45
  67. package/cpa-out/react-loader-ts/src/components/Homepage.tsx +0 -45
  68. package/cpa-out/react-loader-ts/src/components/RandomDynamicPageButton.tsx +0 -44
  69. package/cpa-out/react-loader-ts/src/components/plasmic/create_plasmic_app/PlasmicButton.tsx +0 -725
  70. package/cpa-out/react-loader-ts/src/components/plasmic/create_plasmic_app/PlasmicDynamicPage.tsx +0 -248
  71. package/cpa-out/react-loader-ts/src/components/plasmic/create_plasmic_app/PlasmicGlobalVariant__Screen.tsx +0 -31
  72. package/cpa-out/react-loader-ts/src/components/plasmic/create_plasmic_app/PlasmicHomepage.tsx +0 -294
  73. package/cpa-out/react-loader-ts/src/components/plasmic/create_plasmic_app/PlasmicRandomDynamicPageButton.tsx +0 -240
  74. package/cpa-out/react-loader-ts/src/components/plasmic/create_plasmic_app/icons/PlasmicIcon__Checksvg.tsx +0 -44
  75. package/cpa-out/react-loader-ts/src/components/plasmic/create_plasmic_app/icons/PlasmicIcon__Icon.tsx +0 -41
  76. package/cpa-out/react-loader-ts/src/index.tsx +0 -19
  77. package/cpa-out/react-loader-ts/src/react-app-env.d.ts +0 -1
  78. package/cpa-out/react-loader-ts/src/reportWebVitals.ts +0 -15
  79. package/cpa-out/react-loader-ts/src/setupTests.ts +0 -5
  80. package/cpa-out/react-loader-ts/tsconfig.json +0 -26
@@ -1,240 +0,0 @@
1
- // @ts-nocheck
2
- /* eslint-disable */
3
- /* tslint:disable */
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 * as p from "@plasmicapp/react-web";
17
- import * as ph from "@plasmicapp/react-web/lib/host";
18
-
19
- import {
20
- hasVariant,
21
- classNames,
22
- wrapWithClassName,
23
- createPlasmicElementProxy,
24
- makeFragment,
25
- MultiChoiceArg,
26
- SingleBooleanChoiceArg,
27
- SingleChoiceArg,
28
- pick,
29
- omit,
30
- useTrigger,
31
- StrictProps,
32
- deriveRenderOpts,
33
- ensureGlobalVariants
34
- } from "@plasmicapp/react-web";
35
- import Button from "../../Button"; // plasmic-import: TQcvW_pSKi3/component
36
-
37
- import "@plasmicapp/react-web/lib/plasmic.css";
38
-
39
- import projectcss from "./plasmic_create_plasmic_app.module.css"; // plasmic-import: 47tFXWjN2C4NyHFGGpaYQ3/projectcss
40
- import sty from "./PlasmicRandomDynamicPageButton.module.css"; // plasmic-import: Q23H1_1M_P/css
41
-
42
- import ChecksvgIcon from "./icons/PlasmicIcon__Checksvg"; // plasmic-import: gj-_D7n31Ho/icon
43
- import IconIcon from "./icons/PlasmicIcon__Icon"; // plasmic-import: 6PNxx3YMyDQ/icon
44
-
45
- export type PlasmicRandomDynamicPageButton__VariantMembers = {};
46
- export type PlasmicRandomDynamicPageButton__VariantsArgs = {};
47
- type VariantPropType = keyof PlasmicRandomDynamicPageButton__VariantsArgs;
48
- export const PlasmicRandomDynamicPageButton__VariantProps =
49
- new Array<VariantPropType>();
50
-
51
- export type PlasmicRandomDynamicPageButton__ArgsType = {};
52
- type ArgPropType = keyof PlasmicRandomDynamicPageButton__ArgsType;
53
- export const PlasmicRandomDynamicPageButton__ArgProps =
54
- new Array<ArgPropType>();
55
-
56
- export type PlasmicRandomDynamicPageButton__OverridesType = {
57
- root?: p.Flex<typeof Button>;
58
- };
59
-
60
- export interface DefaultRandomDynamicPageButtonProps {
61
- className?: string;
62
- }
63
-
64
- const __wrapUserFunction =
65
- globalThis.__PlasmicWrapUserFunction ?? ((loc, fn) => fn());
66
- const __wrapUserPromise =
67
- globalThis.__PlasmicWrapUserPromise ??
68
- (async (loc, promise) => {
69
- return await promise;
70
- });
71
-
72
- function PlasmicRandomDynamicPageButton__RenderFunc(props: {
73
- variants: PlasmicRandomDynamicPageButton__VariantsArgs;
74
- args: PlasmicRandomDynamicPageButton__ArgsType;
75
- overrides: PlasmicRandomDynamicPageButton__OverridesType;
76
- forNode?: string;
77
- }) {
78
- const { variants, overrides, forNode } = props;
79
-
80
- const $ctx = ph.useDataEnv?.() || {};
81
- const args = React.useMemo(() => Object.assign({}, props.args), [props.args]);
82
-
83
- const $props = {
84
- ...args,
85
- ...variants
86
- };
87
- const refsRef = React.useRef({});
88
- const $refs = refsRef.current;
89
-
90
- const currentUser = p.useCurrentUser?.() || {};
91
- const [$queries, setDollarQueries] = React.useState({});
92
-
93
- return (
94
- <Button
95
- data-plasmic-name={"root"}
96
- data-plasmic-override={overrides.root}
97
- data-plasmic-root={true}
98
- data-plasmic-for-node={forNode}
99
- className={classNames("__wab_instance", sty.root)}
100
- onClick={async event => {
101
- const $steps = {};
102
- $steps["goToDynamicPage"] = true
103
- ? (() => {
104
- const actionArgs = {
105
- destination: __wrapUserFunction(
106
- {
107
- type: "InteractionArgLoc",
108
- actionName: "navigation",
109
- interactionUuid: "9Y3jL0zxjA",
110
- componentUuid: "Q23H1_1M_P",
111
- argName: "destination"
112
- },
113
- () =>
114
- `/dynamic/${(() => {
115
- try {
116
- return Math.random().toString(36).slice(2);
117
- } catch (e) {
118
- if (e instanceof TypeError) {
119
- return "value";
120
- }
121
- throw e;
122
- }
123
- })()}`
124
- )
125
- };
126
- return __wrapUserFunction(
127
- {
128
- type: "InteractionLoc",
129
- actionName: "navigation",
130
- interactionUuid: "9Y3jL0zxjA",
131
- componentUuid: "Q23H1_1M_P"
132
- },
133
- () =>
134
- (({ destination }) => {
135
- location.assign(destination);
136
- })?.apply(null, [actionArgs]),
137
- actionArgs
138
- );
139
- })()
140
- : undefined;
141
- if (
142
- typeof $steps["goToDynamicPage"] === "object" &&
143
- typeof $steps["goToDynamicPage"].then === "function"
144
- ) {
145
- $steps["goToDynamicPage"] = await __wrapUserPromise(
146
- {
147
- type: "InteractionLoc",
148
- actionName: "navigation",
149
- interactionUuid: "9Y3jL0zxjA",
150
- componentUuid: "Q23H1_1M_P"
151
- },
152
- $steps["goToDynamicPage"]
153
- );
154
- }
155
- }}
156
- >
157
- {"Random Dynamic Page"}
158
- </Button>
159
- ) as React.ReactElement | null;
160
- }
161
-
162
- const PlasmicDescendants = {
163
- root: ["root"]
164
- } as const;
165
- type NodeNameType = keyof typeof PlasmicDescendants;
166
- type DescendantsType<T extends NodeNameType> =
167
- (typeof PlasmicDescendants)[T][number];
168
- type NodeDefaultElementType = {
169
- root: typeof Button;
170
- };
171
-
172
- type ReservedPropsType = "variants" | "args" | "overrides";
173
- type NodeOverridesType<T extends NodeNameType> = Pick<
174
- PlasmicRandomDynamicPageButton__OverridesType,
175
- DescendantsType<T>
176
- >;
177
- type NodeComponentProps<T extends NodeNameType> =
178
- // Explicitly specify variants, args, and overrides as objects
179
- {
180
- variants?: PlasmicRandomDynamicPageButton__VariantsArgs;
181
- args?: PlasmicRandomDynamicPageButton__ArgsType;
182
- overrides?: NodeOverridesType<T>;
183
- } & Omit<PlasmicRandomDynamicPageButton__VariantsArgs, ReservedPropsType> & // Specify variants directly as props
184
- /* Specify args directly as props*/ Omit<
185
- PlasmicRandomDynamicPageButton__ArgsType,
186
- ReservedPropsType
187
- > &
188
- /* Specify overrides for each element directly as props*/ Omit<
189
- NodeOverridesType<T>,
190
- ReservedPropsType | VariantPropType | ArgPropType
191
- > &
192
- /* Specify props for the root element*/ Omit<
193
- Partial<React.ComponentProps<NodeDefaultElementType[T]>>,
194
- ReservedPropsType | VariantPropType | ArgPropType | DescendantsType<T>
195
- >;
196
-
197
- function makeNodeComponent<NodeName extends NodeNameType>(nodeName: NodeName) {
198
- type PropsType = NodeComponentProps<NodeName> & { key?: React.Key };
199
- const func = function <T extends PropsType>(
200
- props: T & StrictProps<T, PropsType>
201
- ) {
202
- const { variants, args, overrides } = React.useMemo(
203
- () =>
204
- deriveRenderOpts(props, {
205
- name: nodeName,
206
- descendantNames: [...PlasmicDescendants[nodeName]],
207
- internalArgPropNames: PlasmicRandomDynamicPageButton__ArgProps,
208
- internalVariantPropNames: PlasmicRandomDynamicPageButton__VariantProps
209
- }),
210
- [props, nodeName]
211
- );
212
- return PlasmicRandomDynamicPageButton__RenderFunc({
213
- variants,
214
- args,
215
- overrides,
216
- forNode: nodeName
217
- });
218
- };
219
- if (nodeName === "root") {
220
- func.displayName = "PlasmicRandomDynamicPageButton";
221
- } else {
222
- func.displayName = `PlasmicRandomDynamicPageButton.${nodeName}`;
223
- }
224
- return func;
225
- }
226
-
227
- export const PlasmicRandomDynamicPageButton = Object.assign(
228
- // Top-level PlasmicRandomDynamicPageButton renders the root element
229
- makeNodeComponent("root"),
230
- {
231
- // Helper components rendering sub-elements
232
-
233
- // Metadata about props expected for PlasmicRandomDynamicPageButton
234
- internalVariantProps: PlasmicRandomDynamicPageButton__VariantProps,
235
- internalArgProps: PlasmicRandomDynamicPageButton__ArgProps
236
- }
237
- );
238
-
239
- export default PlasmicRandomDynamicPageButton;
240
- /* prettier-ignore-end */
@@ -1,44 +0,0 @@
1
- // @ts-nocheck
2
- /* eslint-disable */
3
- /* tslint:disable */
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 */
@@ -1,41 +0,0 @@
1
- // @ts-nocheck
2
- /* eslint-disable */
3
- /* tslint:disable */
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 */
@@ -1,19 +0,0 @@
1
- import React from 'react';
2
- import ReactDOM from 'react-dom/client';
3
- import './index.css';
4
- import App from './App';
5
- import reportWebVitals from './reportWebVitals';
6
-
7
- const root = ReactDOM.createRoot(
8
- document.getElementById('root') as HTMLElement
9
- );
10
- root.render(
11
-
12
- <App />
13
-
14
- );
15
-
16
- // If you want to start measuring performance in your app, pass a function
17
- // to log results (for example: reportWebVitals(console.log))
18
- // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
19
- reportWebVitals();
@@ -1 +0,0 @@
1
- /// <reference types="react-scripts" />
@@ -1,15 +0,0 @@
1
- import { ReportHandler } from 'web-vitals';
2
-
3
- const reportWebVitals = (onPerfEntry?: ReportHandler) => {
4
- if (onPerfEntry && onPerfEntry instanceof Function) {
5
- import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
6
- getCLS(onPerfEntry);
7
- getFID(onPerfEntry);
8
- getFCP(onPerfEntry);
9
- getLCP(onPerfEntry);
10
- getTTFB(onPerfEntry);
11
- });
12
- }
13
- };
14
-
15
- export default reportWebVitals;
@@ -1,5 +0,0 @@
1
- // jest-dom adds custom jest matchers for asserting on DOM nodes.
2
- // allows you to do things like:
3
- // expect(element).toHaveTextContent(/react/i)
4
- // learn more: https://github.com/testing-library/jest-dom
5
- import '@testing-library/jest-dom';
@@ -1,26 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es5",
4
- "lib": [
5
- "dom",
6
- "dom.iterable",
7
- "esnext"
8
- ],
9
- "allowJs": true,
10
- "skipLibCheck": true,
11
- "esModuleInterop": true,
12
- "allowSyntheticDefaultImports": true,
13
- "strict": true,
14
- "forceConsistentCasingInFileNames": true,
15
- "noFallthroughCasesInSwitch": true,
16
- "module": "esnext",
17
- "moduleResolution": "node",
18
- "resolveJsonModule": true,
19
- "isolatedModules": true,
20
- "noEmit": true,
21
- "jsx": "react-jsx"
22
- },
23
- "include": [
24
- "src"
25
- ]
26
- }