create-tina-app 0.1.4 → 0.1.5

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 (41) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/index.js +9 -1
  3. package/{examples/tina-tailwind-sidebar-demo/next-env.d.ts → dist/util/preRunChecks.d.ts} +1 -3
  4. package/package.json +1 -1
  5. package/examples/tina-tailwind-sidebar-demo/.tina/PageTemplate.ts +0 -427
  6. package/examples/tina-tailwind-sidebar-demo/.tina/ThemeTemplate.ts +0 -42
  7. package/examples/tina-tailwind-sidebar-demo/.tina/__generated__/_graphql.json +0 -4180
  8. package/examples/tina-tailwind-sidebar-demo/.tina/__generated__/_lookup.json +0 -68
  9. package/examples/tina-tailwind-sidebar-demo/.tina/__generated__/_schema.json +0 -851
  10. package/examples/tina-tailwind-sidebar-demo/.tina/__generated__/config/schema.json +0 -479
  11. package/examples/tina-tailwind-sidebar-demo/.tina/__generated__/schema.gql +0 -391
  12. package/examples/tina-tailwind-sidebar-demo/.tina/__generated__/types.ts +0 -520
  13. package/examples/tina-tailwind-sidebar-demo/.tina/schema.ts +0 -35
  14. package/examples/tina-tailwind-sidebar-demo/CHANGELOG.md +0 -95
  15. package/examples/tina-tailwind-sidebar-demo/LICENSE +0 -201
  16. package/examples/tina-tailwind-sidebar-demo/README.md +0 -10
  17. package/examples/tina-tailwind-sidebar-demo/components/PageBlocks.tsx +0 -25
  18. package/examples/tina-tailwind-sidebar-demo/components/actions.js +0 -114
  19. package/examples/tina-tailwind-sidebar-demo/components/features.tsx +0 -171
  20. package/examples/tina-tailwind-sidebar-demo/components/footer.tsx +0 -247
  21. package/examples/tina-tailwind-sidebar-demo/components/hero.js +0 -156
  22. package/examples/tina-tailwind-sidebar-demo/components/icon.js +0 -264
  23. package/examples/tina-tailwind-sidebar-demo/components/modal.js +0 -79
  24. package/examples/tina-tailwind-sidebar-demo/components/nav.tsx +0 -121
  25. package/examples/tina-tailwind-sidebar-demo/components/section.js +0 -53
  26. package/examples/tina-tailwind-sidebar-demo/components/testimonial.tsx +0 -87
  27. package/examples/tina-tailwind-sidebar-demo/components/theme.tsx +0 -81
  28. package/examples/tina-tailwind-sidebar-demo/components/tina-wrapper.js +0 -85
  29. package/examples/tina-tailwind-sidebar-demo/content/data/homepage.json +0 -186
  30. package/examples/tina-tailwind-sidebar-demo/content/theme/NormalTheme.json +0 -5
  31. package/examples/tina-tailwind-sidebar-demo/graphql.config.js +0 -24
  32. package/examples/tina-tailwind-sidebar-demo/package.json +0 -41
  33. package/examples/tina-tailwind-sidebar-demo/pages/_app.js +0 -48
  34. package/examples/tina-tailwind-sidebar-demo/pages/admin.tsx +0 -26
  35. package/examples/tina-tailwind-sidebar-demo/pages/index.tsx +0 -186
  36. package/examples/tina-tailwind-sidebar-demo/postcss.config.js +0 -19
  37. package/examples/tina-tailwind-sidebar-demo/public/canal.jpg +0 -0
  38. package/examples/tina-tailwind-sidebar-demo/public/index.html +0 -42
  39. package/examples/tina-tailwind-sidebar-demo/styles.css +0 -20
  40. package/examples/tina-tailwind-sidebar-demo/tailwind.config.js +0 -83
  41. package/examples/tina-tailwind-sidebar-demo/tsconfig.json +0 -19
@@ -1,24 +0,0 @@
1
- /**
2
- Copyright 2021 Forestry.io Holdings, Inc.
3
- Licensed under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License.
5
- You may obtain a copy of the License at
6
- http://www.apache.org/licenses/LICENSE-2.0
7
- Unless required by applicable law or agreed to in writing, software
8
- distributed under the License is distributed on an "AS IS" BASIS,
9
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
- See the License for the specific language governing permissions and
11
- limitations under the License.
12
- */
13
-
14
- module.exports = {
15
- projects: {
16
- app: {
17
- schema: ['.tina/__generated__/schema.gql'],
18
- documents: [
19
- 'pages/**/*.{graphql,js,ts,jsx,tsx}',
20
- 'pages/*.{graphql,js,ts,jsx,tsx}',
21
- ],
22
- },
23
- },
24
- }
@@ -1,41 +0,0 @@
1
- {
2
- "name": "tina-tailwind-sidebar-demo",
3
- "version": "0.1.11",
4
- "private": true,
5
- "description": "",
6
- "keywords": [
7
- "tailwindcss",
8
- "react",
9
- "cms",
10
- "tina",
11
- "tinacms",
12
- "nextjs"
13
- ],
14
- "license": "Apache-2.0",
15
- "main": "src/index.js",
16
- "dependencies": {
17
- "autoprefixer": "^10.2.5",
18
- "chroma-js": "^2.1.1",
19
- "next": "10.0.5",
20
- "postcss": "^8.2.9",
21
- "react": "^16.14.0",
22
- "react-dom": "^16.14.0",
23
- "react-icons": "^4.2.0",
24
- "react-is": "^17.0.2",
25
- "react-tinacms-editor": "^0.52.8",
26
- "styled-components": "^5.3.0",
27
- "tinacms": "latest"
28
- },
29
- "devDependencies": {
30
- "@tinacms/cli": "latest",
31
- "@types/node": "^15.12.2",
32
- "@types/react": "^17.0.11",
33
- "tailwindcss": "^2.0.4",
34
- "typescript": "^3.8.3"
35
- },
36
- "scripts": {
37
- "dev": "yarn tinacms server:start -c \"next dev\"",
38
- "build": "yarn tinacms server:start -c \"next build\"",
39
- "start": "yarn tinacms server:start -c \"next start\""
40
- }
41
- }
@@ -1,48 +0,0 @@
1
- import '../styles.css'
2
- import dynamic from 'next/dynamic'
3
- import { TinaEditProvider } from 'tinacms/dist/edit-state'
4
- const TinaCMS = dynamic(() => import('tinacms'), { ssr: false })
5
-
6
- const NEXT_PUBLIC_TINA_CLIENT_ID = process.env.NEXT_PUBLIC_TINA_CLIENT_ID
7
- const NEXT_PUBLIC_USE_LOCAL_CLIENT =
8
- process.env.NEXT_PUBLIC_USE_LOCAL_CLIENT || true
9
-
10
- const App = ({ Component, pageProps }) => {
11
- return (
12
- <>
13
- <TinaEditProvider
14
- showEditButton={true}
15
- editMode={
16
- <TinaCMS
17
- branch="main"
18
- clientId={NEXT_PUBLIC_TINA_CLIENT_ID}
19
- isLocalClient={Boolean(Number(NEXT_PUBLIC_USE_LOCAL_CLIENT))}
20
- // mediaStore={import('next-tinacms-cloudinary').then(
21
- // ({ TinaCloudCloudinaryMediaStore }) =>
22
- // TinaCloudCloudinaryMediaStore
23
- // )}
24
- // cmsCallback={(cms) => {
25
- // import('react-tinacms-editor').then(({ MarkdownFieldPlugin }) => {
26
- // cms.plugins.add(MarkdownFieldPlugin)
27
- // })
28
- // }}
29
- // formifyCallback={({ formConfig, createForm, createGlobalForm }) => {
30
- // if (formConfig.id === 'getGlobalDocument') {
31
- // return createGlobalForm(formConfig)
32
- // }
33
-
34
- // return createForm(formConfig)
35
- // }}
36
- {...pageProps}
37
- >
38
- {(livePageProps) => <Component {...livePageProps} />}
39
- </TinaCMS>
40
- }
41
- >
42
- <Component {...pageProps} />
43
- </TinaEditProvider>
44
- </>
45
- )
46
- }
47
-
48
- export default App
@@ -1,26 +0,0 @@
1
- /**
2
- Copyright 2021 Forestry.io Holdings, Inc.
3
- Licensed under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License.
5
- You may obtain a copy of the License at
6
- http://www.apache.org/licenses/LICENSE-2.0
7
- Unless required by applicable law or agreed to in writing, software
8
- distributed under the License is distributed on an "AS IS" BASIS,
9
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
- See the License for the specific language governing permissions and
11
- limitations under the License.
12
- */
13
-
14
- import { useRouter } from 'next/router'
15
- import { useEffect } from 'react'
16
- import { useEditState } from '../utils/editState'
17
- const Admin = () => {
18
- const { setEdit } = useEditState()
19
- const router = useRouter()
20
- useEffect(() => {
21
- setEdit(true)
22
- router.back()
23
- }, [])
24
- return <div>Going into edit mode...</div>
25
- }
26
- export default Admin
@@ -1,186 +0,0 @@
1
- /**
2
- Copyright 2021 Forestry.io Holdings, Inc.
3
- Licensed under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License.
5
- You may obtain a copy of the License at
6
- http://www.apache.org/licenses/LICENSE-2.0
7
- Unless required by applicable law or agreed to in writing, software
8
- distributed under the License is distributed on an "AS IS" BASIS,
9
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
- See the License for the specific language governing permissions and
11
- limitations under the License.
12
- */
13
-
14
- import { Hero, hero_template } from '../components/hero'
15
- import { Testimonial, testimonial_template } from '../components/testimonial'
16
- import { Blocks } from '../components/PageBlocks'
17
- import { Nav } from '../components/nav'
18
- import { Footer } from '../components/footer'
19
- import { Features, features_template } from '../components/features'
20
- import { Page, ThemeDocument } from '../.tina/__generated__/types'
21
- import { Theme } from '../components/theme'
22
- import { gql, getStaticPropsForTina } from 'tinacms'
23
-
24
- interface AppProps {
25
- data: {
26
- getPageDocument: { data: Page }
27
- getThemeDocument: ThemeDocument
28
- }
29
- }
30
- const App = ({ data }: AppProps) => {
31
- const { getPageDocument } = data
32
- const { blocks, nav, footer, navlist } = getPageDocument.data
33
- return (
34
- <div className="App">
35
- <Theme theme={data}>
36
- <div className="min-h-screen flex flex-col">
37
- <Nav nav={nav} />
38
- <div className="flex-grow flex flex-col">
39
- <Blocks
40
- blocksData={blocks}
41
- placeholder={
42
- <div className="flex-grow flex items-center justify-center transition duration-150 ease-out text-gray-700 dark:text-gray-100 bg-gradient-to-br from-gray-50 to-white dark:from-gray-900 dark:to-gray-800 body-font overflow-hidden">
43
- <p className="opacity-30">
44
- There's nothing here, try adding some page sections.
45
- </p>
46
- </div>
47
- }
48
- />
49
- </div>
50
- <Footer
51
- name={nav?.wordmark?.name || ''}
52
- footer={footer}
53
- navList={navlist}
54
- />
55
- </div>
56
- </Theme>
57
- {/* {showModal && (
58
- <TinaModal
59
- data={data}
60
- close={() => {
61
- setShowModal(false);
62
- }}
63
- /> */}
64
- {/* )} */}
65
- </div>
66
- )
67
- }
68
-
69
- const PAGE_BLOCKS = {
70
- hero: Hero,
71
- testimonial: Testimonial,
72
- features: Features,
73
- }
74
-
75
- const PAGE_BLOCK_TEMPLATES = {
76
- hero: hero_template,
77
- testimonial: testimonial_template,
78
- features: features_template,
79
- }
80
-
81
- export default App
82
-
83
- export const query = gql`
84
- query ContentQuery {
85
- getThemeDocument(relativePath: "NormalTheme.json") {
86
- data {
87
- color
88
- btnStyle
89
- }
90
- }
91
- getPageDocument(relativePath: "homepage.json") {
92
- id
93
- data {
94
- nav {
95
- wordmark {
96
- icon {
97
- color
98
- name
99
- style
100
- }
101
- name
102
- }
103
- items {
104
- label
105
- link
106
- }
107
- }
108
- blocks {
109
- __typename
110
- ... on PageBlocksHero {
111
- tagline
112
- headline
113
- paragraph
114
- string {
115
- color
116
- }
117
- image {
118
- src
119
- alt
120
- }
121
- actions {
122
- label
123
- type
124
- icon
125
- }
126
- style {
127
- color
128
- }
129
- }
130
- __typename
131
- ... on PageBlocksTestimonial {
132
- quote
133
- author
134
- style {
135
- color
136
- }
137
- }
138
- __typename
139
- ... on PageBlocksFeatures {
140
- items {
141
- icon {
142
- color
143
- name
144
- style
145
- }
146
- title
147
- text
148
- actions {
149
- label
150
- type
151
- icon
152
- }
153
- }
154
- }
155
- }
156
- navlist {
157
- __typename
158
- ... on PageNavlistNav {
159
- title
160
- items {
161
- label
162
- link
163
- }
164
- }
165
- }
166
- footer {
167
- social {
168
- facebook
169
- twitter
170
- instagram
171
- github
172
- }
173
- }
174
- }
175
- }
176
- }
177
- `
178
-
179
- export const getStaticProps = async (ctx) => {
180
- const tinaProps = await getStaticPropsForTina({ query, variables: {} })
181
- return {
182
- props: {
183
- ...tinaProps,
184
- },
185
- }
186
- }
@@ -1,19 +0,0 @@
1
- /**
2
- Copyright 2021 Forestry.io Holdings, Inc.
3
- Licensed under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License.
5
- You may obtain a copy of the License at
6
- http://www.apache.org/licenses/LICENSE-2.0
7
- Unless required by applicable law or agreed to in writing, software
8
- distributed under the License is distributed on an "AS IS" BASIS,
9
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
- See the License for the specific language governing permissions and
11
- limitations under the License.
12
- */
13
-
14
- module.exports = {
15
- plugins: {
16
- tailwindcss: {},
17
- autoprefixer: {},
18
- },
19
- }
@@ -1,42 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta
6
- name="viewport"
7
- content="width=device-width, initial-scale=1, shrink-to-fit=no"
8
- />
9
- <meta name="theme-color" content="#000000" />
10
- <!--
11
- manifest.json provides metadata used when your web app is added to the
12
- homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
13
- -->
14
- <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
15
- <link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
16
- <!--
17
- Notice the use of %PUBLIC_URL% in the tags above.
18
- It will be replaced with the URL of the `public` folder during the build.
19
- Only files inside the `public` folder can be referenced from the HTML.
20
-
21
- Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
22
- work correctly both with client-side routing and a non-root public URL.
23
- Learn how to configure a non-root public URL by running `npm run build`.
24
- -->
25
- <title>Tina Demo</title>
26
- </head>
27
-
28
- <body>
29
- <noscript> You need to enable JavaScript to run this app. </noscript>
30
- <div id="root"></div>
31
- <!--
32
- This HTML file is a template.
33
- If you open it directly in the browser, you will see an empty page.
34
-
35
- You can add webfonts, meta tags, or analytics to this file.
36
- The build step will place the bundled scripts into the <body> tag.
37
-
38
- To begin the development, run `npm start` or `yarn start`.
39
- To create a production bundle, use `npm run build` or `yarn build`.
40
- -->
41
- </body>
42
- </html>
@@ -1,20 +0,0 @@
1
- @tailwind base;
2
- @tailwind components;
3
- @tailwind utilities;
4
-
5
- details summary::-webkit-details-marker {
6
- display: none;
7
- }
8
-
9
- div[class^='ModalBody'],
10
- div[class*=' ModalBody'] {
11
- min-height: 42vh;
12
- }
13
-
14
- button[class^='SidebarToggleButton']:focus,
15
- button[class*=' SidebarToggleButton']:focus,
16
- button[class^='SidebarToggleButton'],
17
- button[class*=' SidebarToggleButton'] {
18
- outline: 0 !important;
19
- outline-color: transparent;
20
- }
@@ -1,83 +0,0 @@
1
- /**
2
- Copyright 2021 Forestry.io Holdings, Inc.
3
- Licensed under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License.
5
- You may obtain a copy of the License at
6
- http://www.apache.org/licenses/LICENSE-2.0
7
- Unless required by applicable law or agreed to in writing, software
8
- distributed under the License is distributed on an "AS IS" BASIS,
9
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
10
- See the License for the specific language governing permissions and
11
- limitations under the License.
12
- */
13
-
14
- const chroma = require('chroma-js')
15
- const colors = require('tailwindcss/colors')
16
-
17
- module.exports = {
18
- purge: [],
19
- darkMode: 'class',
20
- theme: {
21
- colors: {
22
- transparent: 'transparent',
23
- current: 'currentColor',
24
- black: colors.black,
25
- white: colors.white,
26
- gray: colors.coolGray,
27
- blue: colors.blue,
28
- teal: colors.cyan,
29
- green: colors.emerald,
30
- red: colors.rose,
31
- purple: colors.purple,
32
- pink: colors.pink,
33
- yellow: colors.yellow,
34
- orange: colors.orange,
35
- },
36
- screens: {
37
- sm: '600px',
38
- md: '900px',
39
- lg: '1200px',
40
- xl: '1500px',
41
- '2xl': '1800px',
42
- },
43
- extend: {
44
- spacing: {
45
- 128: '32rem',
46
- },
47
- zIndex: {
48
- '-1': '-1',
49
- },
50
- },
51
- },
52
- variants: {
53
- extend: {},
54
- },
55
- plugins: [
56
- /* https://gist.github.com/Merott/d2a19b32db07565e94f10d13d11a8574 */
57
- function ({ addBase, theme }) {
58
- function extractColorVars(colorObj, colorGroup = '') {
59
- return Object.keys(colorObj).reduce((vars, colorKey) => {
60
- const value = colorObj[colorKey]
61
-
62
- if (value === 'transparent' || value === 'currentColor') return
63
-
64
- const newVars =
65
- typeof value === 'string'
66
- ? {
67
- [`--color${colorGroup}-${colorKey}`]: value,
68
- [`--color-rgb${colorGroup}-${colorKey}`]: chroma(value)
69
- .rgb()
70
- .toString(),
71
- }
72
- : extractColorVars(value, `-${colorKey}`)
73
-
74
- return { ...vars, ...newVars }
75
- }, {})
76
- }
77
-
78
- addBase({
79
- ':root': extractColorVars(theme('colors')),
80
- })
81
- },
82
- ],
83
- }
@@ -1,19 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es5",
4
- "lib": ["dom", "dom.iterable", "esnext"],
5
- "allowJs": true,
6
- "skipLibCheck": true,
7
- "strict": false,
8
- "forceConsistentCasingInFileNames": true,
9
- "noEmit": true,
10
- "esModuleInterop": true,
11
- "module": "esnext",
12
- "moduleResolution": "node",
13
- "resolveJsonModule": true,
14
- "isolatedModules": true,
15
- "jsx": "preserve"
16
- },
17
- "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "components/features.ts"],
18
- "exclude": ["node_modules"]
19
- }