@linktr.ee/create-link-app 0.3.0-next.4 → 0.3.0-next.40
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/README.md +30 -1
- package/dist/commands/build.js +4 -3
- package/dist/commands/create.js +1 -1
- package/dist/commands/deploy.js +1 -1
- package/dist/commands/dev.js +3 -2
- package/dist/commands/generate-types.js +111 -0
- package/dist/commands/grant-access.js +1 -1
- package/dist/commands/login.js +1 -1
- package/dist/commands/logout.js +1 -1
- package/dist/commands/storybook.js +28 -0
- package/dist/lib/create/create-project.js +3 -0
- package/dist/lib/deploy/pack-project.js +12 -1
- package/dist/lib/schema/compile.js +30 -0
- package/dist/postcss/postcss.config.js +31 -0
- package/dist/storybook/global.css +53 -0
- package/dist/storybook/main.js +53 -0
- package/dist/storybook/preview.js +21 -0
- package/dist/webpack/webpack.config.js +40 -40
- package/html-template/development.html +2 -2
- package/html-template/production.html +2 -2
- package/oclif.manifest.json +32 -1
- package/package.json +24 -5
- package/templates/common/README.md +38 -17
- package/templates/common/fixtures/props-data.json +1 -2
- package/templates/common/gitignore +1 -0
- package/templates/common/schema/editablePrivate.jtd.json +6 -0
- package/templates/common/schema/editablePublic.jtd.json +10 -0
- package/templates/common/schema/readonlyPrivate.jtd.json +8 -0
- package/templates/common/schema/readonlyPublic.jtd.json +6 -0
- package/templates/common/schema/system.jtd.json +6 -0
- package/templates/common/settings.json +11 -23
- package/templates/react/package.json +5 -2
- package/templates/react/src/index.jsx +4 -13
- package/templates/react/src/tailwind.css +5 -0
- package/templates/react-ts/package.json +5 -2
- package/templates/react-ts/src/App.tsx +23 -0
- package/templates/react-ts/src/Editor.tsx +7 -0
- package/templates/react-ts/src/Sheet.tsx +7 -0
- package/templates/react-ts/src/components/Layouts.tsx +59 -0
- package/templates/react-ts/src/stories/LinkApp.stories.tsx +94 -0
- package/templates/react-ts/src/stories/tailwind.sb.css +5 -0
- package/templates/react-ts/src/tailwind.css +4 -0
- package/templates/react-ts/src/types/global.d.ts +11 -5
- package/templates/react-ts/src/types/index.ts +8 -7
- package/templates/react-ts/src/types/schema/index.ts +33 -0
- package/templates/react/src/images/logo.png +0 -0
- package/templates/react-ts/src/images/logo.png +0 -0
- package/templates/react-ts/src/index.tsx +0 -19
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react'
|
|
3
|
+
import manifest from '../../manifest.json'
|
|
4
|
+
import fixture from '../../fixtures/props-data.json'
|
|
5
|
+
|
|
6
|
+
import { Layout } from '../types'
|
|
7
|
+
|
|
8
|
+
import LinkApp from '..'
|
|
9
|
+
|
|
10
|
+
import './tailwind.sb.css'
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
title: `Link App/${manifest.name}`,
|
|
14
|
+
component: LinkApp,
|
|
15
|
+
tags: ['autodocs'],
|
|
16
|
+
parameters: {
|
|
17
|
+
layout: 'fullscreen',
|
|
18
|
+
},
|
|
19
|
+
args: {
|
|
20
|
+
...fixture,
|
|
21
|
+
editing: false,
|
|
22
|
+
},
|
|
23
|
+
argTypes: {
|
|
24
|
+
layout: {
|
|
25
|
+
table: {
|
|
26
|
+
disable: true,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
} as ComponentMeta<typeof LinkApp>
|
|
31
|
+
|
|
32
|
+
export const Stack: ComponentStory<typeof LinkApp> = (args) => (
|
|
33
|
+
<div
|
|
34
|
+
data-link-type-id={__LINK_TYPE_SLUG__}
|
|
35
|
+
style={{
|
|
36
|
+
margin: '0.5rem',
|
|
37
|
+
width: 374,
|
|
38
|
+
height: 80,
|
|
39
|
+
}}
|
|
40
|
+
>
|
|
41
|
+
<LinkApp {...args} />
|
|
42
|
+
</div>
|
|
43
|
+
)
|
|
44
|
+
Stack.args = {
|
|
45
|
+
layout: Layout.Stack,
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export const Grid: ComponentStory<typeof LinkApp> = (args) => (
|
|
49
|
+
<div
|
|
50
|
+
data-link-type-id={__LINK_TYPE_SLUG__}
|
|
51
|
+
style={{
|
|
52
|
+
margin: '0.5rem',
|
|
53
|
+
width: 183,
|
|
54
|
+
height: 240,
|
|
55
|
+
}}
|
|
56
|
+
>
|
|
57
|
+
<LinkApp {...args} />
|
|
58
|
+
</div>
|
|
59
|
+
)
|
|
60
|
+
Grid.args = {
|
|
61
|
+
layout: Layout.Grid,
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export const Carousel: ComponentStory<typeof LinkApp> = (args) => (
|
|
65
|
+
<div
|
|
66
|
+
data-link-type-id={__LINK_TYPE_SLUG__}
|
|
67
|
+
style={{
|
|
68
|
+
margin: '0.5rem',
|
|
69
|
+
width: 224,
|
|
70
|
+
height: 296,
|
|
71
|
+
}}
|
|
72
|
+
>
|
|
73
|
+
<LinkApp {...args} />
|
|
74
|
+
</div>
|
|
75
|
+
)
|
|
76
|
+
Carousel.args = {
|
|
77
|
+
layout: Layout.Carousel,
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export const Featured: ComponentStory<typeof LinkApp> = (args) => (
|
|
81
|
+
<div
|
|
82
|
+
data-link-type-id={__LINK_TYPE_SLUG__}
|
|
83
|
+
style={{
|
|
84
|
+
margin: '0.5rem',
|
|
85
|
+
width: 374,
|
|
86
|
+
height: 374,
|
|
87
|
+
}}
|
|
88
|
+
>
|
|
89
|
+
<LinkApp {...args} />
|
|
90
|
+
</div>
|
|
91
|
+
)
|
|
92
|
+
Featured.args = {
|
|
93
|
+
layout: Layout.Featured,
|
|
94
|
+
}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
declare module '
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
// @HACK: These files are removed at build time, but we need it for type checking
|
|
2
|
+
declare module '*manifest.json' {
|
|
3
|
+
export const name: string
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
declare module '*props-data.json' {
|
|
7
|
+
export const name: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
declare const __LINK_TYPE_ID__: string
|
|
11
|
+
declare const __LINK_TYPE_SLUG__: string
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
type
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export type
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import type { HostData } from '@linktr.ee/ui-link-kit/Schemas'
|
|
2
|
+
import { EditablePrivateData, EditablePublicData, ReadonlyPrivateData, ReadonlyPublicData } from './schema'
|
|
3
|
+
|
|
4
|
+
export type { HostData } from '@linktr.ee/ui-link-kit/Schemas'
|
|
5
|
+
export { HostDataLayout as Layout } from '@linktr.ee/ui-link-kit/Schemas'
|
|
6
|
+
|
|
7
|
+
export type AppProps = HostData & EditablePublicData & ReadonlyPublicData
|
|
8
|
+
export type EditorProps = EditablePublicData & ReadonlyPublicData & EditablePrivateData & ReadonlyPrivateData
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* These types were autogenerated by @linktr.ee/create-link-app
|
|
3
|
+
* https://www.npmjs.com/package/@linktr.ee/create-link-app
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* These are properties that the Linker can `read` and `write`, and the Visitor
|
|
8
|
+
* can `read`
|
|
9
|
+
*/
|
|
10
|
+
export interface EditablePublicData {
|
|
11
|
+
thumbnailUrl: string
|
|
12
|
+
title: string
|
|
13
|
+
url: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* These are properties that the Linker can `read`, and the Visitor can `read`
|
|
18
|
+
*/
|
|
19
|
+
export interface ReadonlyPublicData {}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* These are properties that the Linker can `read` and `write`, but the Visitor
|
|
23
|
+
* will never have access to.
|
|
24
|
+
*/
|
|
25
|
+
export interface EditablePrivateData {}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* These are properties that only the Linker can `read`. The Visitor will never
|
|
29
|
+
* have access to these properties
|
|
30
|
+
*/
|
|
31
|
+
export interface ReadonlyPrivateData {
|
|
32
|
+
httpResponseCode: number
|
|
33
|
+
}
|
|
Binary file
|
|
Binary file
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Container, Description, Header } from '@linktr.ee/ui-link-kit'
|
|
2
|
-
import { SettingsData } from './types'
|
|
3
|
-
|
|
4
|
-
import logo from './images/logo.png'
|
|
5
|
-
|
|
6
|
-
function App({ toggle, your_name, __linkUrl }: SettingsData) {
|
|
7
|
-
return (
|
|
8
|
-
<Container
|
|
9
|
-
primaryCta={toggle ? { label: 'Visit our UI docs for more info', href: 'https://blstrco.github.io/ui-link-kit/' } : null}
|
|
10
|
-
secondaryCta={toggle ? { label: 'Original url for your Linktree link', href: __linkUrl } : null}
|
|
11
|
-
logo={logo}
|
|
12
|
-
>
|
|
13
|
-
<Header heading={`Hello ${your_name}!`} secondaryHeading="Congratulations, you now have a Linktree link!" layout="hero" />
|
|
14
|
-
<Description>{your_name}</Description>
|
|
15
|
-
</Container>
|
|
16
|
-
)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export default App
|