@osdk/create-app 0.17.0-beta.0 → 0.17.0-beta.2
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/CHANGELOG.md +13 -0
- package/build/browser/index.js +8 -2
- package/build/browser/index.js.map +1 -1
- package/build/cjs/index.cjs +8 -2
- package/build/cjs/index.cjs.map +1 -1
- package/build/esm/index.js +8 -2
- package/build/esm/index.js.map +1 -1
- package/build/esm/templates.d.ts.map +1 -1
- package/package.json +2 -2
- package/templates/template-tutorial-todo-aip-app/.eslintrc.cjs +18 -0
- package/templates/template-tutorial-todo-aip-app/README.md.hbs +34 -0
- package/templates/template-tutorial-todo-aip-app/index.html +15 -0
- package/templates/template-tutorial-todo-aip-app/package.json.hbs +31 -0
- package/templates/template-tutorial-todo-aip-app/public/aip-icon.svg +3 -0
- package/templates/template-tutorial-todo-aip-app/public/todo-aip-app.svg +19 -0
- package/templates/template-tutorial-todo-aip-app/src/AuthCallback.tsx +24 -0
- package/templates/template-tutorial-todo-aip-app/src/AuthenticatedRoute.tsx +33 -0
- package/templates/template-tutorial-todo-aip-app/src/CreateProjectButton.module.css +3 -0
- package/templates/template-tutorial-todo-aip-app/src/CreateProjectButton.tsx +36 -0
- package/templates/template-tutorial-todo-aip-app/src/CreateProjectDialog.module.css +15 -0
- package/templates/template-tutorial-todo-aip-app/src/CreateProjectDialog.tsx +74 -0
- package/templates/template-tutorial-todo-aip-app/src/CreateTaskButton.module.css +3 -0
- package/templates/template-tutorial-todo-aip-app/src/CreateTaskButton.tsx +38 -0
- package/templates/template-tutorial-todo-aip-app/src/CreateTaskDialog.module.css +66 -0
- package/templates/template-tutorial-todo-aip-app/src/CreateTaskDialog.tsx +140 -0
- package/templates/template-tutorial-todo-aip-app/src/DeleteProjectButton.module.css +3 -0
- package/templates/template-tutorial-todo-aip-app/src/DeleteProjectButton.tsx +37 -0
- package/templates/template-tutorial-todo-aip-app/src/DeleteProjectDialog.module.css +3 -0
- package/templates/template-tutorial-todo-aip-app/src/DeleteProjectDialog.tsx +57 -0
- package/templates/template-tutorial-todo-aip-app/src/Dialog.module.css +11 -0
- package/templates/template-tutorial-todo-aip-app/src/Dialog.tsx +19 -0
- package/templates/template-tutorial-todo-aip-app/src/Home.module.css +80 -0
- package/templates/template-tutorial-todo-aip-app/src/Home.tsx +135 -0
- package/templates/template-tutorial-todo-aip-app/src/Layout.module.css +16 -0
- package/templates/template-tutorial-todo-aip-app/src/Layout.tsx +23 -0
- package/templates/template-tutorial-todo-aip-app/src/Login.module.css +5 -0
- package/templates/template-tutorial-todo-aip-app/src/Login.tsx +44 -0
- package/templates/template-tutorial-todo-aip-app/src/ProjectSelect.tsx +40 -0
- package/templates/template-tutorial-todo-aip-app/src/TaskList.module.css +7 -0
- package/templates/template-tutorial-todo-aip-app/src/TaskList.tsx +44 -0
- package/templates/template-tutorial-todo-aip-app/src/TaskListItem.module.css +35 -0
- package/templates/template-tutorial-todo-aip-app/src/TaskListItem.tsx +58 -0
- package/templates/template-tutorial-todo-aip-app/src/client.ts.hbs +31 -0
- package/templates/template-tutorial-todo-aip-app/src/index.css +75 -0
- package/templates/template-tutorial-todo-aip-app/src/main.tsx +36 -0
- package/templates/template-tutorial-todo-aip-app/src/mocks.ts +187 -0
- package/templates/template-tutorial-todo-aip-app/src/useProjectTasks.ts +75 -0
- package/templates/template-tutorial-todo-aip-app/src/useProjects.ts +58 -0
- package/templates/template-tutorial-todo-aip-app/src/vite-env.d.ts +1 -0
- package/templates/template-tutorial-todo-aip-app/tsconfig.json +25 -0
- package/templates/template-tutorial-todo-aip-app/tsconfig.node.json +10 -0
- package/templates/template-tutorial-todo-aip-app/vite.config.ts.hbs +19 -0
- package/templates/template-tutorial-todo-app/README.md.hbs +1 -1
- package/templates/template-tutorial-todo-app/src/CreateProjectDialog.tsx +3 -3
- package/templates/template-tutorial-todo-app/src/CreateTaskDialog.tsx +3 -3
- package/templates/template-tutorial-todo-app/src/DeleteProjectDialog.tsx +3 -3
- package/templates/template-tutorial-todo-app/src/Dialog.module.css +5 -0
- package/templates/template-tutorial-todo-app/src/Dialog.tsx +1 -1
- package/templates/template-tutorial-todo-app/src/Home.module.css +1 -2
- package/templates/template-tutorial-todo-app/src/Home.tsx +4 -3
- package/templates/template-tutorial-todo-app/src/TaskListItem.module.css +10 -0
- package/templates/template-tutorial-todo-app/src/TaskListItem.tsx +11 -8
- package/templates/template-tutorial-todo-app/src/index.css +0 -5
- package/templates/template-tutorial-todo-app/src/mocks.ts +3 -3
- package/templates/template-tutorial-todo-app/src/useProjectTasks.ts +5 -0
|
@@ -35,12 +35,12 @@ function CreateTaskDialog({ project, isOpen, onClose }: CreateTaskDialogProps) {
|
|
|
35
35
|
<Dialog
|
|
36
36
|
isOpen={isOpen}
|
|
37
37
|
buttons={[
|
|
38
|
-
<button disabled={isCreating} onClick={handleSubmit} key="create">
|
|
39
|
-
Create task
|
|
40
|
-
</button>,
|
|
41
38
|
<button disabled={isCreating} onClick={onClose} key="cancel">
|
|
42
39
|
Cancel
|
|
43
40
|
</button>,
|
|
41
|
+
<button disabled={isCreating} onClick={handleSubmit} key="create">
|
|
42
|
+
Create task
|
|
43
|
+
</button>,
|
|
44
44
|
]}
|
|
45
45
|
>
|
|
46
46
|
<label>
|
|
@@ -31,12 +31,12 @@ function DeleteProjectDialog({
|
|
|
31
31
|
<Dialog
|
|
32
32
|
isOpen={isOpen}
|
|
33
33
|
buttons={[
|
|
34
|
-
<button disabled={isDeleting} onClick={handleSubmit} key="delete">
|
|
35
|
-
Delete
|
|
36
|
-
</button>,
|
|
37
34
|
<button disabled={isDeleting} onClick={onClose} key="cancel">
|
|
38
35
|
Cancel
|
|
39
36
|
</button>,
|
|
37
|
+
<button disabled={isDeleting} onClick={handleSubmit} key="delete">
|
|
38
|
+
Delete
|
|
39
|
+
</button>,
|
|
40
40
|
]}
|
|
41
41
|
>
|
|
42
42
|
Are you sure you want to delete this project?
|
|
@@ -8,7 +8,7 @@ interface DialogProps {
|
|
|
8
8
|
|
|
9
9
|
function Dialog({ children, isOpen, buttons }: PropsWithChildren<DialogProps>) {
|
|
10
10
|
return (
|
|
11
|
-
<dialog open={isOpen}>
|
|
11
|
+
<dialog open={isOpen} className={css.dialog}>
|
|
12
12
|
{children}
|
|
13
13
|
{buttons != null && buttons.length > 0 && (
|
|
14
14
|
<div className={css.buttons}>{buttons}</div>
|
|
@@ -30,11 +30,12 @@ function Home() {
|
|
|
30
30
|
<div className={css.tutorialBannerWrapper}>
|
|
31
31
|
<div className={css.tutorialBanner}>
|
|
32
32
|
<p className={css.tutorialBannerTitle}>
|
|
33
|
-
💡 Welcome to
|
|
33
|
+
💡 Welcome to To Do app tutorial!
|
|
34
34
|
</p>
|
|
35
35
|
<p>
|
|
36
|
-
The
|
|
37
|
-
Can you solve how to switch it to use the Ontology SDK
|
|
36
|
+
The To Do App is implemented with mock in-memory data.
|
|
37
|
+
<br />Can you solve how to switch it to use the Ontology SDK
|
|
38
|
+
instead?
|
|
38
39
|
</p>
|
|
39
40
|
</div>
|
|
40
41
|
</div>
|
|
@@ -20,14 +20,17 @@ function TaskListItem({ task, deleteTask }: TaskListItemProps) {
|
|
|
20
20
|
|
|
21
21
|
return (
|
|
22
22
|
<li>
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
<label
|
|
24
|
+
className={`${css.label} ${isDeleting ? css.checked : ""}`}
|
|
25
|
+
htmlFor={`${task.id}`}
|
|
26
|
+
>
|
|
27
|
+
<input
|
|
28
|
+
type="checkbox"
|
|
29
|
+
onChange={handleClick}
|
|
30
|
+
checked={isDeleting}
|
|
31
|
+
className={css.delete}
|
|
32
|
+
title="Delete task"
|
|
33
|
+
/>
|
|
31
34
|
{task.title}
|
|
32
35
|
</label>
|
|
33
36
|
</li>
|
|
@@ -3,10 +3,6 @@
|
|
|
3
3
|
line-height: 1.5;
|
|
4
4
|
font-weight: 400;
|
|
5
5
|
|
|
6
|
-
color-scheme: light dark;
|
|
7
|
-
color: rgba(255, 255, 255, 0.87);
|
|
8
|
-
background-color: #242424;
|
|
9
|
-
|
|
10
6
|
font-synthesis: none;
|
|
11
7
|
text-rendering: optimizeLegibility;
|
|
12
8
|
-webkit-font-smoothing: antialiased;
|
|
@@ -54,7 +50,6 @@ button {
|
|
|
54
50
|
font-size: 1em;
|
|
55
51
|
font-weight: 500;
|
|
56
52
|
font-family: inherit;
|
|
57
|
-
background-color: #1a1a1a;
|
|
58
53
|
cursor: pointer;
|
|
59
54
|
transition: border-color 0.25s;
|
|
60
55
|
}
|
|
@@ -18,7 +18,7 @@ const projects: MockProject[] = [
|
|
|
18
18
|
$apiName: "MockProject",
|
|
19
19
|
$primaryKey: "1",
|
|
20
20
|
id: "1",
|
|
21
|
-
name: "
|
|
21
|
+
name: "Mock project",
|
|
22
22
|
tasks: [
|
|
23
23
|
{
|
|
24
24
|
$apiName: "MockTask",
|
|
@@ -44,7 +44,7 @@ const projects: MockProject[] = [
|
|
|
44
44
|
$apiName: "MockProject",
|
|
45
45
|
$primaryKey: "2",
|
|
46
46
|
id: "2",
|
|
47
|
-
name: "Yet
|
|
47
|
+
name: "Yet another mock project",
|
|
48
48
|
tasks: [
|
|
49
49
|
{
|
|
50
50
|
$apiName: "MockTask",
|
|
@@ -78,7 +78,7 @@ async function createProject({
|
|
|
78
78
|
name,
|
|
79
79
|
}: {
|
|
80
80
|
name: string;
|
|
81
|
-
}): Promise<
|
|
81
|
+
}): Promise<MockProject["$primaryKey"]> {
|
|
82
82
|
await delay();
|
|
83
83
|
const id = randomId();
|
|
84
84
|
projects.push({
|
|
@@ -37,6 +37,7 @@ export function useProjectTasks(project: MockProject | undefined) {
|
|
|
37
37
|
if (project == null) {
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
|
+
await sleep(1000);
|
|
40
41
|
// Try to implement this with the Ontology SDK!
|
|
41
42
|
await Mocks.deleteTask(task.$primaryKey);
|
|
42
43
|
await mutate();
|
|
@@ -53,3 +54,7 @@ export function useProjectTasks(project: MockProject | undefined) {
|
|
|
53
54
|
deleteTask,
|
|
54
55
|
};
|
|
55
56
|
}
|
|
57
|
+
|
|
58
|
+
function sleep(ms: number) {
|
|
59
|
+
return new Promise(resolve => setTimeout(resolve, ms));
|
|
60
|
+
}
|